odoo/odoo#203006

Created by fw-bot
Merged at 9487a6be687a5272a269296299cc0ebc1c1a9d98

Statuses:

label
odoo-dev:17.0-18.0-fix-mandatory-analytic-plans-srma-422547-fw
head
d33a0dca17a17600c70ea40e5926034ea8a1d316
merged
7 months ago by Accounting, Maira Salazar
odoo/odoo
16.0 #201560
17.0 #203006
saas-17.4 #203153
18.0 #203194
saas-18.1 #203338
saas-18.2 #203447
saas-18.3
saas-18.4
19.0
master #203480

[FW][IMP] account: validate mandatory analytic plans when batch posting

When we have an Analytic Plan being Mandatory, confirming an invoice from the form view, if it has a line without an Analytic distribution, correctly raises a ValidationError.
Confirming invoices from the list view does not raise the same error, yet it should.

To replicate:
1. Activate Analytic accounting:
a. Install accountant
b. In Settings, activate Analytic Accounting
c. Create an Analytic plan (with an Analytic account associated)
2. Set its default applicability to mandatory
3. Create two invoices, remove the analytic distribution from one of the lines in one invoice.
4. In the invoices list view, select both newly created invoices, click on Actions > Confirm Entries
5. Click Confirm
6. The invoices were posted, even though they have no analytic distributions.

Ticket link
opw-4603919

Forward-Port-Of: #201560