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 "<decorator-gen-69>", 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 "<decorator-gen-13>", 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 "<decorator-gen-3>", 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'
If we don't assure the order for the search, there are chances that
several items for the same account and date appear in a incorrect order:
24/02/2023 - BNK1/2023/02/0011 - ...
27/02/2023 - BNK1/2023/02/0013 - ...
27/02/2023 - BNK1/2023/02/0012 - ...
29/02/2023 - BNK1/2023/02/0014 - ...
TT42098
Installing the module in a DB with more than 50000 accounts and groups made the install stall.
It turns out this method's implementation produced almost endless recursion. it was also depending on some fields that never were used.
Now it depends on the parent path, so when one group is moved to another parent, its computed accounts are recomputed, and parents' too, recursively.
Now, the method is much more performant, and the module gets installed in the same DB in 30s.
@moduon MT-1900
Co-authored-by: Eduardo De Miguel <edu@moduon.team>
- Show Initial balance and Ending balance only when it is necessary with currency + hide currency column
- Show currency in the correct column
- Create a dict with all keys when it does not exist
- Prevent wrong values
TT41158