Thursday, October 17, 2024
3 changes · saas-17.2
Resolved issues and error corrections
Refreshing the Point of Sale after parking an order no longer makes that parked order the active sale again. This helps cashiers continue with the correct new order and avoids accidentally modifying or charging a parked order.
Original PR description
After parking an order, if you refresh the page the parked order would be selected as the current order. Steps to reproduce: ------------------- * Setup a PoS with atleast one trusted PoS * Open the PoS and add some products to the order * Park the order * Refresh the page > Observation: The parked order is selected Why the fix: ------------ When setting the start order we take the last order saved instead of the first one. opw-4104298 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Dropshipping flows now correctly recognize inter-company transit locations when goods move between vendors, other companies, and customers. This helps avoid incorrect handling or accounting of dropshipped stock in multi-company setups.
Original PR description
Consider the Inter-Company transit location (which is a 'transit' location with no company set) as either a 'customer' or 'supplier' location for dropship purposes. Both 'supplier' and 'customer' need to be considered as the dropship could be either from Vendor -> Other Company or Other Company -> Customer. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix prevents country-based localization modules from being installed automatically while an accounting chart template is still loading. It avoids incomplete accounting setup data and reduces the risk of setup or test failures when creating companies without a predefined country.
Original PR description
Currently there is the following problem when loading a chart template on a company. In case the company has no country set the loading of the template may set it. This can i.e. happen when the…
Currently there is the following problem when loading a chart template on a company.
In case the company has no country set the loading of the template may set it.
This can i.e. happen when the template specifies a `account_fiscal_country_id`.
Setting a country on a company (`write`) may trigger the installation of additional
localization modules related to the country (`install_l10n_modules`).
The problematic `write` happens in `_pre_load_data` but the actual
template data is not loaded yet (happens later in `_load_data`).
This can cause the following 2 issues.
Issue (1)
The new modules may add new data to the current template (modifies the
result of `_get_chart_template_data`).
But this new data is not considered during the current loading
since the template data is fetched before the automatic installation happens.
The module may not work as intended for companies w/o the new data though.
So we would have to reload the chart template manually.
Issue (2)
The auto-installation happens after the chart template info (field `chart_template`)
is set on the company but before the data is actually loaded.
The module installation may trigger a post init hook to set up new
data on companies with the current template (field `chart_template`).
This new setup may rely on the chart template data (from before the
module was installed) being laoded already though.
Issue (2) i.e. causes runbut build error-60149.
During the populate test a company with chart_template 'generic_coa'
is created which causes the installation of module `l10n_us_reports`
during the 'generic_coa' chart template loading.
There the deferred expense and revenue accounts are loaded in a post init hook
via `_load_data` for every company where the `chart_template` field has value 'generic_coa'.
```python
ChartTemplate._load_data({
'res.company': , {
company.id: {
'deferred_expense_account_id': 'prepaid_expenses',
'deferred_revenue_account_id': 'deferred_revenue',
}
}
})
```
Here 'prepaid_expenses' and 'deferred_revenue' are xmlids of accounts of the
'generic_coa' chart template from module 'account'.
Since the template data has not been loaded yet we cannot derefence
these 2 xmlids. In the log we get the following warning:
> Failed when trying to recover prepaid_expenses for field=res.company.deferred_expense_account_id
To avoid this problem we just skip the automatic installing in case we are in the process
of loading a chart template.
runbot build error-60149