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

        issue10509
        review336421003
        (grafted from b6cdedd37debee3a9cf4578c036910b22e248bd7)
diffstat:

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

diffs (17 lines):

diff -r 8c87e781a083 -r fe1bafbeec05 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