代码之家  ›  专栏  ›  技术社区  ›  anand raj

如何在odoo 11中打印发票行中的税额

  •  0
  • anand raj  · 技术社区  · 8 年前

    我想添加自定义字段作为税额,我需要在odoo11的帐户发票行中打印该订单行的税额

    谢谢,

    1 回复  |  直到 8 年前
        1
  •  0
  •   KbiR    8 年前
    @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)
    
    推荐文章