Skip to content

Conversation

william-andre
Copy link
Contributor

Currently, changing the plan of an analytic account won't do anything with regards to the analytic lines currently using that account: the value will stay recorded in a wrong field.

This commit will update all the lines currently using that account in the column of the previous plan.

opw-4338406

@robodoo
Copy link
Contributor

robodoo commented Feb 25, 2025

Pull request status dashboard

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Feb 25, 2025
@william-andre william-andre force-pushed the 17.0-automate-change-plan-wan branch 3 times, most recently from d423f8a to eb29cf6 Compare February 25, 2025 16:37
@william-andre william-andre force-pushed the 17.0-automate-change-plan-wan branch 2 times, most recently from da53d10 to e177895 Compare February 26, 2025 15:38
@C3POdoo C3POdoo requested review from a team, BastienFafchamps and kebeclibre and removed request for a team February 26, 2025 15:41
aab-odoo added a commit to odoo-dev/odoo that referenced this pull request Feb 28, 2025
This commit improves the tests of the oh snap dialog feature in
form view. Some existing tests relied on the presence of classname
`o_form_error_dialog` to be relevant. However, that classname did
not exist (anymore?). We thus re-introduce it. Moreover, there was
no test asserting that clicking on the save button doesn't trigger
that dialog. We introduce one.

Spotted when reviewing odoo#199287
Copy link
Contributor

@aab-odoo aab-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the test, I think you can find inspiration from "Auto save: error on save when action button clicked". Call makeServerError with type RedirectWarning and your arguments (you'll need to make makeServerError support arguments, for now it hardcodes []). You can also add a fake action service (see test "do not perform button action for records with invalid datas" for instance), to mock doAction to assert that clicking on the redirect button works as expected.

robodoo pushed a commit that referenced this pull request Feb 28, 2025
This commit improves the tests of the oh snap dialog feature in
form view. Some existing tests relied on the presence of classname
`o_form_error_dialog` to be relevant. However, that classname did
not exist (anymore?). We thus re-introduce it. Moreover, there was
no test asserting that clicking on the save button doesn't trigger
that dialog. We introduce one.

Spotted when reviewing #199287

closes #199732

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
@william-andre william-andre force-pushed the 17.0-automate-change-plan-wan branch from e177895 to 8fdcc6b Compare March 5, 2025 16:44
Currently, changing the plan of an analytic account won't do anything
with regards to the analytic lines currently using that account: the
value will stay recorded in a wrong field.

This commit will update all the lines currently using that account in
the column of the previous plan.

opw-4338406
@william-andre william-andre force-pushed the 17.0-automate-change-plan-wan branch from 8fdcc6b to 0e7057a Compare March 5, 2025 16:45
@william-andre william-andre requested a review from aab-odoo March 5, 2025 16:45
Before this commit, a RedirectWarning triggered while saving a record
would be displayed as a server error:
* without the redirect action accessible
* with some ugly technical text in the dialog

This commit takes into account this type of exception.
@william-andre william-andre force-pushed the 17.0-automate-change-plan-wan branch from 0e7057a to 0ec87c7 Compare March 5, 2025 16:50
Copy link
Contributor

@epictete epictete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 👍

@robodoo r+ rebase-ff

@robodoo
Copy link
Contributor

robodoo commented Mar 6, 2025

@epictete you may want to rebuild or fix this PR as it has failed CI.

@robodoo
Copy link
Contributor

robodoo commented Mar 6, 2025

Merge method set to rebase and fast-forward.

robodoo pushed a commit that referenced this pull request Apr 4, 2025
This commit moves the logic added in #199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

Part-of: #202028
Signed-off-by: William André (wan) <wan@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 4, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of #199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

closes #202028

Signed-off-by: William André (wan) <wan@odoo.com>
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
This commit moves the logic added in odoo#199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of odoo#199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

X-original-commit: 91e2bf1
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
This commit moves the logic added in odoo#199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of odoo#199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

X-original-commit: 91e2bf1
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
This commit moves the logic added in odoo#199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of odoo#199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

X-original-commit: 91e2bf1
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
This commit moves the logic added in odoo#199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of odoo#199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

X-original-commit: 91e2bf1
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
This commit moves the logic added in odoo#199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Apr 4, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of odoo#199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

X-original-commit: 91e2bf1
robodoo pushed a commit that referenced this pull request Apr 6, 2025
This commit moves the logic added in #199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
Part-of: #204898
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of #199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

closes #204898

X-original-commit: 91e2bf1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
This commit moves the logic added in #199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
Part-of: #204881
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of #199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

closes #204881

X-original-commit: 91e2bf1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
This commit moves the logic added in #199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
Part-of: #204862
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of #199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

closes #204862

X-original-commit: 91e2bf1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
This commit moves the logic added in #199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
Part-of: #204872
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of #199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

closes #204872

X-original-commit: 91e2bf1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
This commit moves the logic added in #199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
Part-of: #204893
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 6, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of #199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

closes #204893

X-original-commit: 91e2bf1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 7, 2025
This commit moves the logic added in #199287, adapting the
analytic lines' columns when changing the analytic account,
to a dedicated function.

This allows the function to be called from other models.

X-original-commit: dc9596f
Part-of: #204872
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
robodoo pushed a commit that referenced this pull request Apr 7, 2025
To replicate:

1. With `accountant` installed, activate Analytic Accounting in the Settings
2. Create an Analytic Plan with an Analytic Account
3. Create an Analytic Item with any amount, using the created account.
4. Verify that the Analytic Account has a balance associated to it.
5. Returning to the Analytic Plan, set a parent plan.
6. The Analytic Account has no balance associated to it, and the Analytic Item
does not have the account anywhere.

When changing the parent plan of an Analytic Plan, this change is not propagated
correctly to the analytic items using the now child plan's accounts.

This commit will update the lines using accounts from the now child plan,
setting the accounts in the correct plan column if possible, using the same
logic of #199287. If there are lines that already have a different account
in the new parent plan column, a RedirectWarning is shown.

opw-4607129

closes #204872

X-original-commit: 91e2bf1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maira Salazar <srma@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants