-
Notifications
You must be signed in to change notification settings - Fork 30k
[FIX] analytic: adapt lines columns when changing plan of account #199287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d423f8a
to
eb29cf6
Compare
da53d10
to
e177895
Compare
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
There was a problem hiding this 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.
addons/web/static/src/views/form/form_error_dialog/form_error_dialog.js
Outdated
Show resolved
Hide resolved
addons/web/static/src/views/form/form_error_dialog/form_error_dialog.xml
Outdated
Show resolved
Hide resolved
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>
e177895
to
8fdcc6b
Compare
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
8fdcc6b
to
0e7057a
Compare
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.
0e7057a
to
0ec87c7
Compare
There was a problem hiding this 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
@epictete you may want to rebuild or fix this PR as it has failed CI. |
Merge method set to rebase and fast-forward. |
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>
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
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
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
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
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
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
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
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
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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