changeset 198a51be7fc6 in modules/company:default
details: https://hg.tryton.org/modules/company?cmd=changeset&node=198a51be7fc6
description:
        Only set employe company context when parent record is saved

        issue10639
        review336761003
diffstat:

 company.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r adc0321e572b -r 198a51be7fc6 company.py
--- a/company.py        Mon Jul 12 22:56:26 2021 +0200
+++ b/company.py        Tue Aug 17 10:21:19 2021 +0200
@@ -52,7 +52,8 @@
     __name__ = 'company.employee'
     party = fields.Many2One('party.party', 'Party', required=True,
         context={
-            'company': Eval('company', -1),
+            'company': If(
+                Eval('company', -1) >= 0, Eval('company', None), None),
             },
         depends=['company'],
         help="The party which represents the employee.")

Reply via email to