Do not raise missing accounts errors on readonly transactions

issue6913
review39871002
This commit is contained in:
Sergi Almacellas Abellana
2017-11-27 16:50:33 +01:00
parent 8fa861103d
commit b7dcfe1ecc
+4 -2
View File
@@ -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,
})