2
0

[FIX][account_chart_update] Remove account tax browsing since already a recordset

todo_dict["account_dict"]["account.tax"].keys() are already records, not just ID, so we can use them directly. Trying to browse causes an error : `psycopg2.ProgrammingError: can't adapt type 'account.tax'`.
This commit is contained in:
Camille Morand 2023-08-03 11:16:15 +02:00
parent 938dad1eb9
commit 57f5e06097

View File

@ -1079,7 +1079,7 @@ class WizardUpdateChartsAccounts(models.TransientModel):
when the referenced accounts are still not available). when the referenced accounts are still not available).
""" """
done = self.env["account.tax"] done = self.env["account.tax"]
for k, v in todo_dict["account_dict"]["account.tax"].items(): for tax, v in todo_dict["account_dict"]["account.tax"].items():
vals = {} vals = {}
for fld in [ for fld in [
"cash_basis_transition_account_id", "cash_basis_transition_account_id",
@ -1096,7 +1096,6 @@ class WizardUpdateChartsAccounts(models.TransientModel):
% v[fld].id % v[fld].id
) )
if vals: if vals:
tax = self.env["account.tax"].browse(k)
tax.write(vals) tax.write(vals)
done |= tax done |= tax