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

[ADD] Generic avatax oca rounding #960

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions osi_avatax_rounding_fix/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

========
Overview
========

* Correct rounding issues on avatax lines


=======
Credits
=======

* Open Source Integrators <http://www.opensourceintegrators.com>


Contributors
------------

* Tirth Patel <tpatel@opensourceintegrators.com>
* Raphael Lee <rlee@opensourceintegrators.com>
1 change: 1 addition & 0 deletions osi_avatax_rounding_fix/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions osi_avatax_rounding_fix/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ # noqa
"name": "OSI Avatax Rounding Fix",
"summary": "OSI Avatax Rounding Fix",
"version": "17.0.1.0.0",
"license": "LGPL-3",
"author": "Open Source Integrators",
"maintainer": "Open Source Integrators",
"website": "https://github.com/ursais/osi-addons",
"category": "Accounting",
"depends": [
"account_avatax_sale_oca",
],
"data": [],
"application": False,
"installable": True,
"auto_install": False,
}
1 change: 1 addition & 0 deletions osi_avatax_rounding_fix/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_tax
18 changes: 18 additions & 0 deletions osi_avatax_rounding_fix/models/account_tax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from odoo import api, models


class AccountTax(models.Model):
_inherit = "account.tax"

@api.model
def _prepare_tax_totals(
self, base_lines, currency, tax_lines=None, is_company_currency_requested=False
):
vals = super()._prepare_tax_totals(
base_lines, currency, tax_lines, is_company_currency_requested
)
if vals.get("amount_untaxed"):
vals["amount_untaxed"] = round(vals["amount_untaxed"], 2)
if vals.get("amount_total"):
vals["amount_total"] = round(vals["amount_total"], 2)
return vals
Loading