-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]> | ||
* Raphael Lee <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
{ # noqa | ||
{ # 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": [ | ||
"account_avatax_sale_oca", | ||
], | ||
"data": [], | ||
"application": False, | ||
"installable": True, | ||
"auto_install": False | ||
"auto_install": False, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
from odoo import api, fields, models | ||
from odoo import api, models | ||
|
||
|
||
class AccountTax(models.Model): | ||
_inherit = 'account.tax' | ||
_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) | ||
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 |