Как напечатать сумму налога в строке счета в odoo 11 - PullRequest
0 голосов
/ 06 июля 2018

Я хотел бы добавить настраиваемое поле в качестве суммы налога, и мне нужно напечатать сумму налога для этой строки заказа в строке счета-фактуры в odoo11

Спасибо, Ананд

1 Ответ

0 голосов
/ 06 июля 2018
@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)
...