changeset 1197f4b3cf0d in modules/purchase:default
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=1197f4b3cf0d
description:
        Prevent changing the company when party is set

        As many fields are set using party which depends on the company 
context, the
        company can not be changed once they are set.

        issue10289
        review332591002
diffstat:

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

diffs (16 lines):

diff -r 6a01f72c9bde -r 1197f4b3cf0d purchase.py
--- a/purchase.py       Wed Apr 21 23:45:25 2021 +0200
+++ b/purchase.py       Thu Apr 22 00:03:28 2021 +0200
@@ -77,7 +77,11 @@
     company = fields.Many2One(
         'company.company', "Company", required=True, select=True,
         states={
-            'readonly': (Eval('state') != 'draft') | Eval('lines', [0]),
+            'readonly': (
+                (Eval('state') != 'draft')
+                | Eval('lines', [0])
+                | Eval('party', True)
+                | Eval('invoice_party', True)),
             },
         depends=['state'])
     number = fields.Char('Number', size=None, readonly=True, select=True)

Reply via email to