Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 24, 2025

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: #203006
Forward-Port-Of: #201560

@robodoo
Copy link
Contributor

robodoo commented Mar 24, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 24, 2025

@mairasalazar @lordkrandel cherrypicking of pull request #201560 failed.

stdout:

Auto-merging addons/account/models/account_move_line.py
Auto-merging addons/account/tests/test_account_analytic.py
Auto-merging addons/account/wizard/account_validate_move_view.xml
CONFLICT (content): Merge conflict in addons/account/wizard/account_validate_move_view.xml

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Mar 24, 2025
@mairasalazar mairasalazar force-pushed the saas-17.4-18.0-fix-mandatory-analytic-plans-srma-424841-fw branch from 4a9b272 to 515ea81 Compare March 24, 2025 15:41
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 24, 2025
To replicate:
1. [Activate](https://www.odoo.com/documentation/18.0/applications/finance/accounting/reporting/analytic_accounting.html)
Analytic Accounting:
   a. Install `accountant`
   b. In Settings, activate Analytic Accounting
   c. Create an Analytic plan (with an Analytic account associated)
2. Set the plan's 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.

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.

This commit ensures the validation check for the mandatory analytic plans when
mass posting entries, and adds a RedirectWarning to show a list view of the
entries that should be reviewed.

opw-4603919

X-original-commit: 9487a6b
@mairasalazar mairasalazar force-pushed the saas-17.4-18.0-fix-mandatory-analytic-plans-srma-424841-fw branch from 515ea81 to 8e4fb93 Compare March 24, 2025 21:00
@mairasalazar
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 24, 2025
To replicate:
1. [Activate](https://www.odoo.com/documentation/18.0/applications/finance/accounting/reporting/analytic_accounting.html)
Analytic Accounting:
   a. Install `accountant`
   b. In Settings, activate Analytic Accounting
   c. Create an Analytic plan (with an Analytic account associated)
2. Set the plan's 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.

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.

This commit ensures the validation check for the mandatory analytic plans when
mass posting entries, and adds a RedirectWarning to show a list view of the
entries that should be reviewed.

opw-4603919

closes #203153

X-original-commit: 9487a6b
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
@robodoo robodoo closed this Mar 25, 2025
@fw-bot fw-bot deleted the saas-17.4-18.0-fix-mandatory-analytic-plans-srma-424841-fw branch April 1, 2025 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants