From b7dcfe1ecc640dc70d77c95caffa11d5cc47b375 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 27 Nov 2017 16:50:33 +0100 Subject: [PATCH] Do not raise missing accounts errors on readonly transactions issue6913 review39871002 --- party.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/party.py b/party.py index 776aca6ec9..3bee6db81b 100644 --- a/party.py +++ b/party.py @@ -232,7 +232,8 @@ class Party(CompanyMultiValueMixin): if not account: config = Configuration(1) account = config.get_multivalue('default_account_payable') - if not account: + # Allow empty values on on_change + if not account and not Transaction().readonly: self.raise_user_error('missing_payable_account', { 'name': self.rec_name, }) @@ -246,7 +247,8 @@ class Party(CompanyMultiValueMixin): if not account: config = Configuration(1) account = config.get_multivalue('default_account_receivable') - if not account: + # Allow empty values on on_change + if not account and not Transaction().readonly: self.raise_user_error('missing_receivable_account', { 'name': self.rec_name, })