Skip to content

Commit

Permalink
[ADD] Generic avatax oca rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
tirth-osi committed Nov 4, 2024
1 parent e827e6f commit 2188e2f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
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
18 changes: 18 additions & 0 deletions osi_avatax_rounding_fix/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-

{ # noqa
"name": "Proslat Accounting Enhancement",
"summary": "Proslat Accounting Enhancement",
"version": "17.0.1.0.0",
"author": "Open Source Integrators",
"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
14 changes: 14 additions & 0 deletions osi_avatax_rounding_fix/models/account_tax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from odoo import api, fields, 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

0 comments on commit 2188e2f

Please sign in to comment.