Sunday, December 1, 2024
2 changes · 18.0
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