fixes #1
This commit is contained in:
parent
096ff281cf
commit
9eeef4bdc4
|
@ -5,6 +5,7 @@ from trytond.modules.product import price_digits
|
|||
from trytond.transaction import Transaction
|
||||
from trytond.pyson import If, Eval, Bool
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.modules.account.tax import TaxableMixin
|
||||
|
||||
|
||||
class InvoiceLine(metaclass=PoolMeta):
|
||||
|
@ -38,6 +39,7 @@ class InvoiceLine(metaclass=PoolMeta):
|
|||
else:
|
||||
invoice_type = getattr(self, 'invoice_type', None)
|
||||
if invoice_type == 'in':
|
||||
unit_price = 'unit_price'
|
||||
if context.get('_deductible_rate') is not None:
|
||||
deductible_rate = context['_deductible_rate']
|
||||
else:
|
||||
|
@ -48,9 +50,11 @@ class InvoiceLine(metaclass=PoolMeta):
|
|||
return []
|
||||
else:
|
||||
deductible_rate = 1
|
||||
unit_price = 'unit_price_days'
|
||||
|
||||
return [(
|
||||
getattr(self, 'taxes', None) or [],
|
||||
((getattr(self, 'unit_price_days', None) or Decimal(0))
|
||||
((getattr(self, unit_price, None) or Decimal(0))
|
||||
* deductible_rate),
|
||||
getattr(self, 'quantity', None) or 0,
|
||||
getattr(self, 'tax_date', None),
|
||||
|
|
Loading…
Reference in New Issue