-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
base: master
Are you sure you want to change the base?
[FIX] account: Fixed inconsistent tax grids on journal entries #164801
Conversation
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
@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 |
@@ -1185,6 +1185,12 @@ def action_register_payment(self): | |||
# INVERSE METHODS | |||
# ------------------------------------------------------------------------- | |||
|
|||
@api.onchange('tax_ids') |
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.
This only works in the UI but won't work if the tax is removed programmatically
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.
and what is a better solution in that case?
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.
should I override the write method?
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.
The issue is probably something in _sync_dynamic_lines
that doesn't work
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.
To get started, let's start by writing a test 😉 (not using the Form
emulator)
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