From 833bffa75430d9ce8f1d0c616443f4892effd701 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Tue, 6 Feb 2018 17:22:13 +1100 Subject: [PATCH 1/2] Only Clear Bank Journal if in absolute violation of company. When the default comes up, if it calls onchange (depending what was there) - which clears the default journal, and the journal type, meaning the journal is not even selectable any more by domain. --- mcfix_account/models/account_bank_statement.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcfix_account/models/account_bank_statement.py b/mcfix_account/models/account_bank_statement.py index 2501d10b..455ab15a 100644 --- a/mcfix_account/models/account_bank_statement.py +++ b/mcfix_account/models/account_bank_statement.py @@ -23,7 +23,8 @@ def name_get(self): @api.onchange('company_id') def onchange_company_id(self): - self.journal_id = False + if self.company_in and self.journal_id.company_id != self.company_id: + self.journal_id = False def reconciliation_widget_preprocess(self): # This is the same code as the original method except for the fact From 66eec6ff3aeaadace2cf6ec2ce21a0c43f60d9e3 Mon Sep 17 00:00:00 2001 From: Richard deMeester Date: Thu, 8 Feb 2018 07:39:20 +1100 Subject: [PATCH 2/2] Typo fix. --- mcfix_account/models/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcfix_account/models/account_bank_statement.py b/mcfix_account/models/account_bank_statement.py index 455ab15a..92a65a5e 100644 --- a/mcfix_account/models/account_bank_statement.py +++ b/mcfix_account/models/account_bank_statement.py @@ -23,7 +23,7 @@ def name_get(self): @api.onchange('company_id') def onchange_company_id(self): - if self.company_in and self.journal_id.company_id != self.company_id: + if self.company_id and self.journal_id.company_id != self.company_id: self.journal_id = False def reconciliation_widget_preprocess(self):