|
|
"""
Note: as total_amount_currency can be set directly by the user (for product without cost)
or needs to be computed (for product with cost), `untaxed_amount_currency` can't be computed in the same method as `total_amount_currency`.
"""
for expense in self:
base_lines = [expense._convert_to_tax_base_line_dict(price_unit=expense.total_amount_currency)]
taxes_totals = self.env['account.tax']._compute_taxes(base_lines)['totals'][expense.currency_id]
expense.tax_amount_currency = taxes_totals['amount_tax']
expense.untaxed_amount_currency = taxes_totals['amount_untaxed']
|
|