mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-19 16:02:04 +02:00
19.0 vanilla
This commit is contained in:
parent
ba20ce7443
commit
768b70e05e
2357 changed files with 1057103 additions and 712486 deletions
|
|
@ -0,0 +1,36 @@
|
|||
from odoo.addons.account.tests.test_tax import TestTaxCommon
|
||||
|
||||
|
||||
class TestTaxCommonAccountTaxPython(TestTaxCommon):
|
||||
|
||||
def _jsonify_tax(self, tax):
|
||||
values = super()._jsonify_tax(tax)
|
||||
values['formula_decoded_info'] = tax.formula_decoded_info
|
||||
return values
|
||||
|
||||
def assert_python_taxes_computation(
|
||||
self,
|
||||
formula,
|
||||
price_unit,
|
||||
expected_values,
|
||||
product_values=None,
|
||||
product_uom_values=None,
|
||||
price_include_override='tax_excluded',
|
||||
):
|
||||
tax = self.python_tax(formula, price_include_override=price_include_override)
|
||||
if product_values:
|
||||
product = self.env['product.product'].create({
|
||||
'name': "assert_python_taxes_computation",
|
||||
**product_values,
|
||||
})
|
||||
else:
|
||||
product = None
|
||||
if product_uom_values:
|
||||
uom = self.env['uom.uom'].create({
|
||||
'name': "assert_python_taxes_computation",
|
||||
'relative_uom_id': self.env.ref('uom.product_uom_unit').id,
|
||||
**product_uom_values,
|
||||
})
|
||||
else:
|
||||
uom = None
|
||||
return self.assert_taxes_computation(tax, price_unit, expected_values, product=product, product_uom=uom)
|
||||
Loading…
Add table
Add a link
Reference in a new issue