Use core account test base, helping to ensure we have the correct accounting environment setup.
If any of the localization modules are loaded, this will make this tests be skipped, instead of simply failing
TT28423
On multi-company settings, we need to make sure we are searching and creating objects with the correct company associated.
Also take into account previously created account groups
TT28423
Since v14, Odoo defines the `__slots__` attribute in the `BaseModel` class (ea3e39506a)
This makes it impossible to add attributes to an instance like it was done here in v13.
The use of the `report_data` dictionary passed between method is the closes and simples solution to this "issue".
TT26415
Co-authored-by: Alex Cuellar <acuellar@grupoyacck.com>
Depending on the calling method, data can be something different from a dictionary
(like `None` if no keyword argument is provided), so this will crash. Example:
mis_builder is crashing in its tests.
We prevent that checking for a falsy value before trying to access the dictionary.
We also avoid context mangling for non AFR reports (those without the key
`account_financial_report_lang` in the dictionary), not callign to `with_context`
in that case.
The second invoice created has no explicit so taking the current date could lead to failing tests because the invoice is out of search as the the setup sets date_from as time.strftime("%Y-%m-01") and date_to as time.strftime("%Y-%m-28"). So i choose the easy way by setting an explicit date for the invoice.
Before this commit, amounts such as "10'000.00 CHF" were exceeding their
columns width. Label column could be reduced as it's printed correctly
over two different lines.
* centralization is only calculated on accounts where 'centralized' is True
* Cumul. Balance of each move_line fixed
* Ordering move_lines by date
* Fix trial_balance xlsx when not show_partner_details
`report_journal_ledger` is auto-vacuumed as any transient model, but has some
ondelete="cascade" constraints that auto-remove subtables when a record is removed,
doing this operation very slow when selecting these sub-records.
Letting default ondelete="set null" would result in same performance bottleneck,
as the select on sub-table is performed the same for setting "null" value on them.
As a solution, and for avoiding a costly index operation, we delete by SQL sub-tables
rows in advance.
A bit of extra logic has been added for avoiding to remove that records if it's not
the turn of vacuum the parent table.