From 2a702680e3d63e127c7ea5166da63700ede3db41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 22 Apr 2021 00:03:28 +0200 Subject: [PATCH] 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 --- subscription.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subscription.py b/subscription.py index 902c669444..d17d0d46e0 100644 --- a/subscription.py +++ b/subscription.py @@ -32,9 +32,9 @@ class Subscription(Workflow, ModelSQL, ModelView): company = fields.Many2One( 'company.company', "Company", required=True, select=True, states={ - 'readonly': Eval('state') != 'draft', + 'readonly': (Eval('state') != 'draft') | Eval('party', True), }, - depends=['state'], + depends=['state', 'party'], help="Make the subscription belong to the company.") number = fields.Char(