DealerDiscount (Erweiterung um ReportLayoutCategory-'Rabatt')
parent
13ed2e4d24
commit
6487315fe0
|
|
@ -74,6 +74,8 @@ class Invoice(models.Model):
|
|||
if invoice.partner_id and self.fiscal_position_id:
|
||||
taxes_ids = self.fiscal_position_id.map_tax(taxes, discount_product_id, invoice.partner_id).ids
|
||||
|
||||
layout_category_id = self.env['sale.layout_category'].search([('name', '=', discount_product_id.manufacturing_number)])
|
||||
|
||||
if amount > 0:
|
||||
# Create the Invoice line
|
||||
InvoiceLine.create({
|
||||
|
|
@ -86,6 +88,7 @@ class Invoice(models.Model):
|
|||
'product_id': discount_product_id.id,
|
||||
'invoice_id': invoice.id,
|
||||
'invoice_line_tax_ids': [(6, 0, taxes_ids)],
|
||||
'layout_category_id':layout_category_id.id,
|
||||
'sequence': 99999,
|
||||
})
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in New Issue