changeset 4d12b33f2d52 in modules/sale_price_list:default
details: 
https://hg.tryton.org/modules/sale_price_list?cmd=changeset;node=4d12b33f2d52
description:
        Set company context in product instance

        This ensures that the correct value for field depending on the company 
from
        product is used.

        issue8690
        review252281002
diffstat:

 sale.py |  5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diffs (20 lines):

diff -r a1316a51f3e3 -r 4d12b33f2d52 sale.py
--- a/sale.py   Sat Sep 07 23:38:20 2019 +0200
+++ b/sale.py   Tue Oct 01 22:23:55 2019 +0200
@@ -47,8 +47,6 @@
         super(SaleLine, cls).__setup__()
         cls.product.context['price_list'] = Eval(
             '_parent_sale', {}).get('price_list')
-        cls.product.context['company'] = Eval(
-            '_parent_sale', {}).get('company', None)
 
     @fields.depends('sale', '_parent_sale.price_list', '_parent_sale.company')
     def _get_context_sale_price(self):
@@ -56,7 +54,4 @@
         if self.sale:
             if getattr(self.sale, 'price_list', None):
                 context['price_list'] = self.sale.price_list.id
-            # Ensure cost_price is for the one of the sale company
-            if getattr(self.sale, 'company', None):
-                context['company'] = self.sale.company.id
         return context

Reply via email to