diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 872507dc297..75326f9b110 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -8799,6 +8799,13 @@ msgid "You cannot do this modification on a reconciled entry. You can just chang "%s." msgstr "" +#. module: account +#: code:addons/account/models/account.py:329 +#, python-format +msgid "You cannot empty the account number once set.\n" +"If you would like to delete the account number, you can do it from the Bank Accounts list." +msgstr "" + #. module: account #: code:addons/account/models/account.py:96 #, python-format diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 36b0077a701..ef521dc7ea3 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -325,6 +325,8 @@ class AccountJournal(models.Model): self.default_debit_account_id.currency_id = vals['currency_id'] if not 'default_credit_account_id' in vals and self.default_credit_account_id: self.default_credit_account_id.currency_id = vals['currency_id'] + if 'bank_acc_number' in vals and not vals.get('bank_acc_number') and journal.bank_account_id: + raise UserError(_('You cannot empty the account number once set.\nIf you would like to delete the account number, you can do it from the Bank Accounts list.')) result = super(AccountJournal, self).write(vals) # Create the bank_account_id if necessary