changeset b345cf7b6ac0 in modules/analytic_purchase:default
details: 
https://hg.tryton.org/modules/analytic_purchase?cmd=changeset&node=b345cf7b6ac0
description:
        Remove context from company domain of analytic_accounts

        issue11373
        review378591002
diffstat:

 purchase.py |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r e3fe01761778 -r b345cf7b6ac0 purchase.py
--- a/purchase.py       Sun Apr 10 19:11:38 2022 +0200
+++ b/purchase.py       Mon Apr 11 22:29:29 2022 +0200
@@ -3,7 +3,7 @@
 from trytond.model import fields
 from trytond.modules.analytic_account import AnalyticMixin
 from trytond.pool import Pool, PoolMeta
-from trytond.pyson import Eval, If
+from trytond.pyson import Eval
 
 
 class PurchaseLine(AnalyticMixin, metaclass=PoolMeta):
@@ -13,9 +13,7 @@
     def __setup__(cls):
         super(PurchaseLine, cls).__setup__()
         cls.analytic_accounts.domain = [
-            ('company', '=', If(~Eval('_parent_purchase'),
-                    Eval('context', {}).get('company', -1),
-                    Eval('_parent_purchase', {}).get('company', -1))),
+            ('company', '=', Eval('company', -1)),
             ]
         cls.analytic_accounts.states = {
             'invisible': Eval('type') != 'line',

Reply via email to