From 8221bfc89a475dccf8540a491156a44441954e44 Mon Sep 17 00:00:00 2001 From: mde-spring <79934758+mde-spring@users.noreply.github.com> Date: Thu, 14 Mar 2024 11:54:18 +0100 Subject: [PATCH] [FIX] account_fiscal_year_closing - create/write When coming from a template, Mapping is used as an Array instead of simple id (due to many in another many). To take into account this particularity, check the type before taking the id of the array. --- .../models/account_fiscalyear_closing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_fiscal_year_closing/models/account_fiscalyear_closing.py b/account_fiscal_year_closing/models/account_fiscalyear_closing.py index 3393971387eb..9bde61725a2d 100644 --- a/account_fiscal_year_closing/models/account_fiscalyear_closing.py +++ b/account_fiscal_year_closing/models/account_fiscalyear_closing.py @@ -553,13 +553,13 @@ class AccountFiscalyearClosingMapping(models.Model): @api.model def create(self, vals): - if "dest_account_id" in vals: + if 'dest_account_id' in vals and type(vals['dest_account_id']) == list: vals["dest_account_id"] = vals["dest_account_id"][0] res = super(AccountFiscalyearClosingMapping, self).create(vals) return res def write(self, vals): - if "dest_account_id" in vals: + if 'dest_account_id' in vals and type(vals['dest_account_id']) == list: vals["dest_account_id"] = vals["dest_account_id"][0] res = super(AccountFiscalyearClosingMapping, self).write(vals) return res