changeset 19f9cabe1730 in modules/account:6.4
details: https://hg.tryton.org/modules/account?cmd=changeset&node=19f9cabe1730
description:
Add company property to test tax
A company is needed by TaxableMixin since rev 2a191ce7df99
issue11624
review419641003
(grafted from 0dfc061280bfe417cccbbb7a5949e0c585b2a602)
diffstat:
tax.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diffs (18 lines):
diff -r 045dc2a3e1c0 -r 19f9cabe1730 tax.py
--- a/tax.py Sat Aug 06 10:44:58 2022 +0200
+++ b/tax.py Mon Aug 08 22:19:22 2022 +0200
@@ -1816,6 +1816,14 @@
return company.currency.id
@property
+ def company(self):
+ pool = Pool()
+ Company = pool.get('company.company')
+ company_id = Transaction().context.get('company')
+ if company_id:
+ return Company(company_id)
+
+ @property
def taxable_lines(self):
return [(self.taxes, self.unit_price, self.quantity, self.tax_date)]