[FIX] sale: prevent trackback when makeing an SO line without product

Before this fix, an empty sale order produced a traceback when the invoice was created.

closes odoo/odoo#42750

Taskid: 1997415
Related: odoo/enterprise#7540
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
Arnaud Joset
2020-02-06 07:21:44 +00:00
committed by Damien Bouvy
parent 31b1f411f6
commit aaf5504373
@@ -139,7 +139,7 @@ class SaleAdvancePaymentInv(models.TransientModel):
'analytic_tag_ids': analytic_tag_ids,
'tax_id': [(6, 0, tax_ids)],
'is_downpayment': True,
'sequence': order.order_line[-1].sequence + 1 if order.order_line else 10,
'sequence': order.order_line and order.order_line[-1].sequence + 1 or 10,
}
return so_values