[FIX] sale: invoice_status of a SO line from an advance payment

When making an advance payment, the SO line created from this payment
must have a qty_invoiced equal to 0 and the invoice line created for
this SO line must have a quantity equal to 0. In this way, the SO line
created is "Fully invoiced".

opw:668844
This commit is contained in:
Goffin Simon
2016-02-09 14:03:57 +01:00
parent d8503b68a2
commit 98ccb8539e
@@ -81,7 +81,7 @@ class SaleAdvancePaymentInv(models.TransientModel):
'origin': order.name,
'account_id': account_id,
'price_unit': amount,
'quantity': 1.0,
'quantity': 0.0,
'discount': 0.0,
'uom_id': self.product_id.uom_id.id,
'product_id': self.product_id.id,
@@ -131,6 +131,7 @@ class SaleAdvancePaymentInv(models.TransientModel):
'product_uom': self.product_id.uom_id.id,
'product_id': self.product_id.id,
'tax_id': [(6, 0, self.product_id.taxes_id.ids)],
'qty_invoiced': 0.0,
})
self._create_invoice(order, so_line, amount)
if self._context.get('open_invoices', False):