changeset 3ed55e2684cb in modules/account_invoice:default
details:
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=3ed55e2684cb
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:
invoice.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (17 lines):
diff -r 7c8c818673e2 -r 3ed55e2684cb invoice.py
--- a/invoice.py Tue Apr 20 09:18:57 2021 +0200
+++ b/invoice.py Thu Apr 22 00:03:27 2021 +0200
@@ -50,8 +50,11 @@
_depends = ['state']
company = fields.Many2One(
- 'company.company', "Company", required=True, select=True,
- states=_states, depends=_depends)
+ 'company.company', 'Company', required=True, select=True,
+ states={
+ 'readonly': _states['readonly'] | Eval('party', True),
+ },
+ depends=_depends + ['party'])
company_party = fields.Function(
fields.Many2One(
'party.party', "Company Party",