Skip to content
Snippets Groups Projects
Commit 6ddd93bf authored by Swapnesh Shah's avatar Swapnesh Shah
Browse files

[FIX] l10n_ch: Update l10n_ch_postal if related field is set

Fixes https://github.com/odoo/odoo/issues/43122


Before this commit, Creating Journal without Bank account number will be failed as, It tries to update Related field 'l10n_ch_postal' while bank_account_id is not set.

In this commit, we update 'l10n_ch_postal' if 'bank_account_id' is present on Journal

closes odoo/odoo#43158

Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
parent c72af086
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ class AccountJournal(models.Model):
# The call to super() creates the related bank_account_id field if necessary
if 'l10n_ch_postal' in vals:
for record in self:
for record in self.filtered('bank_account_id'):
record.bank_account_id.l10n_ch_postal = vals['l10n_ch_postal']
return rslt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment