Daily updates from Odoo
Sunday, December 1, 2024
3 changes · 18.0
Enhancements to existing features
The portal now checks that a selected state or province matches the chosen country, and requires a state when the country makes it mandatory. This helps prevent incorrect customer address data and reduces downstream processing errors.
Original PR description
Description of the issue/feature this PR addresses: Currently, there is no validation ensuring the selected state corresponds to the chosen country, nor checks that enforce a state selection when required by the country. Current behavior before PR: Users can select a state that doesn't belong to the selected country. No validation exists to require a state selection when the country mandates it. Desired behavior after PR is merged: The selected state will be validated to ensure it belongs to the selected country. A state will be mandatory when the country requires it, and appropriate error messages will be shown when these conditions are not met. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
Improve access related tests for mail.message and their sub models. Currently tests are dependent on discuss.channel model, and not always written in a clear way. Understanding the purpose of each test is not crystal clear. We now use a test model with simple rules, defined in test_mail addon. It allows to simulate models with * public access; * portal access; * internal access; * admin access; using ACLs and ir.rules. Tests are rewritten to be more concise and precise an
Original PR description
Improve access related tests for mail.message and their sub models. Currently tests are dependent on discuss.channel model, and not always written in a clear way. Understanding the purpose of each test is not crystal clear. We now use a test model with simple rules, defined in test_mail addon. It allows to simulate models with * public access; * portal access; * internal access; * admin access; using ACLs and ir.rules. Tests are rewritten to be more concise and precise and use new models. This is done in stable to keep coherency in tests codebase. It also eases writing bugfixes as tests won't have to be modified during forward port process. Finally it allows to backport improvements or fixes in later versions if it applies to previous versions. Task-4320561 Forward-Port-Of: odoo/odoo#189202 Forward-Port-Of: odoo/odoo#186394
**Steps to reproduce:** - Install Accounting - Activate "Budget Management" in Accounting settings - Create an analytic account: * Plan: [any] - Create a Budget: * Budget Type: Expense * Period: [the current month] * A budget line with the created analytic account and any budgeted amount - Open the budget - Create a bill: * Vendor: [any] * Bill Date: [a date in the current month] * An invoice line with the analytic account - Confirm the bill - Check the Budget R
Original PR description
**Steps to reproduce:** - Install Accounting - Activate "Budget Management" in Accounting settings - Create an analytic account: * Plan: [any] - Create a Budget: * Budget Type: Expense * Period: [the…
**Steps to reproduce:**
- Install Accounting
- Activate "Budget Management" in Accounting settings
- Create an analytic account:
* Plan: [any]
- Create a Budget:
* Budget Type: Expense
* Period: [the current month]
* A budget line with the created analytic account and any
budgeted amount
- Open the budget
- Create a bill:
* Vendor: [any]
* Bill Date: [a date in the current month]
* An invoice line with the analytic account
- Confirm the bill
- Check the Budget Report
=> The committed and achieved amounts of the budget is correctly set to the amount of the bill
- Create a credit note
- Check the Budget Report again
**Issue:**
The amount is unchanged.
The credit note is not taken into account.
**Cause:**
The computation is only taking into account the analytic lines with a negative amount for an expense budget and those with a
positive amount for a revenue budget, which is not correct.
In this case, the credit note has positive amount and therefore it is excluded from the expense budget.
**Solution:**
1) An expense budget should take into account all the analytic lines in an expense account and a revenue budget should do the same with all the analytic lines in an income account.
2) Analytic lines with an account that is not an income or an expense one should be ignored.
3) Analytic lines without an account should be taken into account for an expense-type budget if:
- the category is not "other" (the default category)
- the category is "other" and the amount is negative
4) Analytic lines without an account should be taken into account for a revenue-type budget if the category is "other" and the amount is positive.
opw-4214599
Forward-Port-Of: odoo/enterprise#74235