From 8eac04d5cf045f1fd6996ae225cbe1ddc6857693 Mon Sep 17 00:00:00 2001 From: "Docker @ kuntrawant" Date: Tue, 11 Apr 2023 10:26:55 +0200 Subject: [PATCH] [FIX] account_financial_report fix to take the id of the currency if is set, that fix the following error: opt/odoo/odoo/odoo/models.py", line 3681, in write field.write(self, vals[fname]) File "/opt/odoo/odoo/odoo/fields.py", line 3057, in write return self.write_batch([(records, value)]) File "/opt/odoo/odoo/odoo/fields.py", line 3078, in write_batch return self.write_real(records_commands_list, create) File "/opt/odoo/odoo/odoo/fields.py", line 3254, in write_real flush() File "/opt/odoo/odoo/odoo/fields.py", line 3216, in flush comodel.create(to_create) File "", line 2, in create File "/opt/odoo/odoo/odoo/api.py", line 348, in _model_create_multi return create(self, arg) File "/opt/odoo/odoo/odoo/addons/base/models/ir_fields.py", line 534, in create recs = super().create(vals_list) File "", line 2, in create File "/opt/odoo/odoo/odoo/api.py", line 348, in _model_create_multi return create(self, arg) File "/opt/odoo/odoo/odoo/models.py", line 3886, in create records = self._create(data_list) File "/opt/odoo/odoo/odoo/models.py", line 3992, in _create cr.execute(query, params) File "", line 2, in execute File "/opt/odoo/odoo/odoo/sql_db.py", line 101, in check return f(self, *args, **kwargs) File "/opt/odoo/odoo/odoo/sql_db.py", line 301, in execute res = self._obj.execute(query, params) Exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/odoo/odoo/odoo/http.py", line 641, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo/odoo/http.py", line 317, in _handle_exception raise exception.with_traceback(None) from new_cause psycopg2.ProgrammingError: can't adapt type 'res.currency' --- account_financial_report/report/abstract_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report/report/abstract_report.py b/account_financial_report/report/abstract_report.py index 12274615..a4ae732d 100644 --- a/account_financial_report/report/abstract_report.py +++ b/account_financial_report/report/abstract_report.py @@ -135,7 +135,7 @@ class AgedPartnerBalanceReport(models.AbstractModel): "name": account.name, "hide_account": False, "group_id": account.group_id.id, - "currency_id": account.currency_id or False, + "currency_id": account.currency_id.id, "currency_name": account.currency_id.name, "centralized": account.centralized, }