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

[16.0][FIX] account_avatax_oca, skip exception raise on lines with not product in display_type #404

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

Conversation

ChrisOForgeFlow
Copy link

@OCA-git-bot
Copy link
Contributor

Hi @dreispt,
some modules you are maintaining are being modified, check this out!

@ChrisOForgeFlow ChrisOForgeFlow marked this pull request as draft December 26, 2023 13:20
@ChrisOForgeFlow ChrisOForgeFlow force-pushed the 16.0-fix-compute_all_exception branch 3 times, most recently from a1592a9 to 43ccfee Compare December 26, 2023 14:00
@ChrisOForgeFlow ChrisOForgeFlow marked this pull request as ready for review December 26, 2023 14:10
and float_compare(line.quantity, quantity, digits) == 0
):
avatax_amount = copysign(line.avatax_amt_line, base)
break
Copy link
Member

Choose a reason for hiding this comment

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

A lot of logic changes here that I don't understand , I'm not comfortable with this.

Copy link
Author

Choose a reason for hiding this comment

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

This change is only for adding a process of current aml, if that is not found, should be done standard behavior, you can notice change in showed only for tab adding in else condition


if not hasattr(AccountMoveLine, "_compute_all_tax_origin"):
AccountMoveLine._compute_all_tax_origin = AccountMoveLine._compute_all_tax
AccountMoveLine._compute_all_tax = _compute_all_tax_new
Copy link
Member

Choose a reason for hiding this comment

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

It looks like we are monkey patching the _compute_all_tax method.
Why would we need to do that?

Copy link
Author

Choose a reason for hiding this comment

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

It's needed because in this line https://github.com/odoo/odoo/blob/16.0/addons/account/models/account_move_line.py#L940, I'm adding a context with current aml, to know what account move line trigger tax compute, then in next process I can process with more precision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants