0

I would like to add custom field as tax amount and i need to print the tax amount of that order line in account invoice line in odoo11

Thanks, Anand

anand raj
  • 227
  • 3
  • 13
  • 1
    little bit more description about the kind of data will be helpful, please provide the same – Inder Jul 06 '18 at 06:23
  • Can you describe your question bit more and add code what you have done so far to achieve your requirement. – Keval Mehta Jul 06 '18 at 07:13

1 Answers1

0
@api.one
@api.depends('price_unit', 'discount', 'invoice_line_tax_ids', 'quantity',

             'product_id', 'invoice_id.partner_id', 'invoice_id.currency_id')
def _compute_price_tax(self):
    price = self.price_unit * (1 - (self.discount or 0.0) / 100.0)
    currency = self.invoice_id and self.invoice_id.currency_id or None

    if self.invoice_line_tax_ids:
        taxes = self.invoice_line_tax_ids.compute_all(price, currency, self.quantity, product=self.product_id, # call the base function
                                                       partner=self.invoice_id.partner_id)
        tax_amount = 0
        if taxes['total_included']:
            tax_amount = taxes['total_included'] - taxes['total_excluded']
        self.price_subtotal_tax = tax_amount
        if self.invoice_id:
            self.price_subtotal_tax = self.invoice_id.currency_id.round(self.price_subtotal_tax)
KbiR
  • 4,047
  • 6
  • 37
  • 103
anand raj
  • 227
  • 3
  • 13