From 657ffc03c7a4e4a157956b7a52f7641c016e0f88 Mon Sep 17 00:00:00 2001 From: "Docker @ kuntrawant" Date: Wed, 13 Jul 2022 11:17:07 +0200 Subject: [PATCH] [FIX][account_fiscal_year_closing] fix create and write --- .../models/account_fiscalyear_closing.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/account_fiscal_year_closing/models/account_fiscalyear_closing.py b/account_fiscal_year_closing/models/account_fiscalyear_closing.py index 5e136002cb8a..4d341019ae0d 100644 --- a/account_fiscal_year_closing/models/account_fiscalyear_closing.py +++ b/account_fiscal_year_closing/models/account_fiscalyear_closing.py @@ -551,6 +551,19 @@ class AccountFiscalyearClosingMapping(models.Model): string="Destination account", ) + @api.model + def create(self, vals): + if 'dest_account_id' in vals: + vals['dest_account_id'] = vals['dest_account_id'][:1] + res = super(AccountFiscalyearClosingMapping, self).create(vals) + return res + + def write(self, vals): + if 'dest_account_id' in vals: + vals['dest_account_id'] = vals['dest_account_id'][:1] + res = super(AccountFiscalyearClosingMapping, self).write(vals) + return res + def dest_move_line_prepare(self, dest, balance, partner_id=False): self.ensure_one() move_line = {}