Skip to content
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

[FIX] account: Fixed inconsistent tax grids on journal entries #164801

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hsal-odoo
Copy link
Contributor

This commit ensure that tax_tag_ids are cleared when tax_ids are cleared on the account_move_line.

Before this commit, when a new journal entry is created, adding a tax with tax grids then removing the tax does not remove the grids.

task-3906808


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

This commit ensure that tax_tag_ids are cleared when tax_ids are cleared on the account_move_line.

Before this commit, when a new journal entry is created, adding a tax with tax grids then removing the tax does not remove the grids.

task-3906808
@robodoo
Copy link
Contributor

robodoo commented May 7, 2024

Pull request status dashboard.

@hsal-odoo
Copy link
Contributor Author

@william-andre There might be a better solution to the problem, but I spent some time trying to figure out another solution but could not find any. The problem I could identify was that the _compute_all_tax() compute function does not trigger when tax_ids is emptied.

@@ -1185,6 +1185,12 @@ def action_register_payment(self):
# INVERSE METHODS
# -------------------------------------------------------------------------

@api.onchange('tax_ids')
Copy link
Contributor

Choose a reason for hiding this comment

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

This only works in the UI but won't work if the tax is removed programmatically

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and what is a better solution in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should I override the write method?

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue is probably something in _sync_dynamic_lines that doesn't work

Copy link
Contributor

Choose a reason for hiding this comment

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

To get started, let's start by writing a test 😉 (not using the Form emulator)

@C3POdoo C3POdoo added the RD research & development, internal work label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants