[FIX] stock_account: add taxes to invoice when creating an invoice from delivery
Generating an invoice from a delivery now add the taxes to the invoice. This impacts a returned purchase for which the invoice is created from the delivery, and a sale order which is set to create invoice on delivery. opw-634565
This commit is contained in:
parent
94aae97c04
commit
61a5bbfb21
|
@ -151,6 +151,13 @@ class stock_move(osv.osv):
|
|||
if move.product_uos:
|
||||
uos_id = move.product_uos.id
|
||||
quantity = move.product_uos_qty
|
||||
|
||||
taxes_ids = []
|
||||
if move.origin_returned_move_id.purchase_line_id.taxes_id:
|
||||
taxes_ids = [tax.id for tax in move.origin_returned_move_id.purchase_line_id.taxes_id]
|
||||
elif move.procurement_id.sale_line_id.tax_id:
|
||||
taxes_ids = [tax.id for tax in move.procurement_id.sale_line_id.tax_id]
|
||||
|
||||
return {
|
||||
'name': move.name,
|
||||
'account_id': account_id,
|
||||
|
@ -158,6 +165,7 @@ class stock_move(osv.osv):
|
|||
'uos_id': uos_id,
|
||||
'quantity': quantity,
|
||||
'price_unit': self._get_price_unit_invoice(cr, uid, move, inv_type),
|
||||
'invoice_line_tax_id': [(6, 0, taxes_ids)],
|
||||
'discount': 0.0,
|
||||
'account_analytic_id': False,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue