changeset b6cdedd37deb in modules/account_product:default
details: 
https://hg.tryton.org/modules/account_product?cmd=changeset&node=b6cdedd37deb
description:
        Only return taxes for the current company

        issue10509
        review336421003
diffstat:

 product.py |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r bbd98609cce0 -r b6cdedd37deb product.py
--- a/product.py        Mon May 03 15:43:41 2021 +0200
+++ b/product.py        Thu Jun 17 17:31:34 2021 +0200
@@ -194,10 +194,12 @@
             return self.get_multivalue(name[:-5], **pattern)
 
     def get_taxes(self, name):
+        company = Transaction().context.get('company')
         if self.taxes_parent:
             return [x.id for x in getattr(self.parent, name)]
         else:
-            return [x.id for x in getattr(self, name[:-5])]
+            return [x.id for x in getattr(self, name[:-5])
+                if x.company.id == company]
 
     @fields.depends('parent', '_parent_parent.accounting', 'accounting')
     def on_change_with_accounting(self):

Reply via email to