On Odoo18 if you group:sum by amount_currency, if you don't put currency_id in the group field
the amount_currency is removed by read_group function on account addon
Selecting no value in the "Grouped by" general ledger wizard, but
filtering any account, results in an empty display, due to the weird
trick of having an empty selection value.
This, joined with the fact of not being able to predefine that empty
value with standard tools, makes the switch necessary.
- Set grouped_by as required with non grouped item description.
- Switched selection value from "" (empty) to "none".
- Adapt general_ledger group_by conditionals.
Co-Authored-By: aritzolea
Clicking on the QWeb report for a balance grouped by analytic was causing an error because account.move.line does not have account_analytic_id.
This has been replaced with account_analytic_ids, which is the correct field.
Some reports were failing to render without this fix.
It seems there was a regression introduced in 0a2b2736cdc1a73d6248b91fa79a0f4c6aedc99b.
@moduon MT-8285
The currency_id field of the lines is always set, so follow the same logic as
in report/templates/general_ledger and show the data only if the currency is set
in the account.
TT51204
Set a larger font style for the html report with a
relative font size to make it responsive. For this,
a new html_container is defined so that this does
not affect the other reports and the font style is
customised only for the report in html view.
TT48995
In v15 it was filtered by the internal_type field (type of account.account.type) to use
"other" (most of the accounts had it set). Now in v16, there is the account_type field
exists and has to be compatible. The in or not in operator is set to "simplify" the
domain and avoid having to set almost all types.
Steps:
- Accounting > Reporting > OCA accounting reports > Journal Ledger
- Select Date range and activate Foreign Currency
Get "{'name': 'EUR'} " in currency field
Desired: get EUR
If there are records without partner_id set and we show the detail of partners
we need to take into account those records grouped as "Missing partner".
TT47771
Use case: Generate report (showing foreign currency) with accounts with defined currency.
Traceback:
Error to render compiling AST
AttributeError: 'int' object has no attribute 'decimal_places'
Template: account_financial_report.report_trial_balance_line
Path: /t/div/t[3]/t[1]/t/t/div/span/t
Node: <t t-esc="balance['initial_currency_balance']" t-options="{'widget': 'monetary', 'display_currency': balance['currency_id']}"/>
The error occured while rendering the template account_financial_report.report_trial_balance_line and evaluating the following expression: <t t-esc="balance['initial_currency_balance']" t-options="{'widget': 'monetary', 'display_currency': balance['currency_id']}"/>
Use case: Generate report (showing foreign currency) with accounts with defined currency.
Traceback:
File "/odoo/odoo-server/odoo/addons/base/models/ir_qweb_fields.py", line 448, in value_to_html
fmt = "%.{0}f".format(display_currency.decimal_places)
AttributeError: 'int' object has no attribute 'decimal_places'
The above exception was the direct cause of the following exception:
Error to render compiling AST
AttributeError: 'int' object has no attribute 'decimal_places'
Template: account_financial_report.report_general_ledger_lines
Path: /t/div/div[2]/t[6]/t[1]/div[1]/t[1]/span/t
Node: <t t-raw="account_or_group_item_object['init_bal']['bal_curr']" t-options="{'widget': 'monetary', 'display_currency': account['currency_id']}"/>
TT42804
[FIX] account_financial_report: Prevent error related to currency from General ledger
Use case: Generate xlsx report (showing foreign currency) with accounts with defined currency.
Traceback:
File "/opt/odoo/auto/addons/account_financial_report/report/abstract_report_xlsx.py", line 535, in _get_currency_amt_format
field_name = "{}_{}".format(field_prefix, currency.name)
AttributeError: 'int' object has no attribute 'name'
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'