diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index c53a777a7c7..4858afdaa19 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -424,7 +424,7 @@ class SaleOrder(models.Model): if references.get(invoices.get(group_key)): if order not in references[invoices[group_key]]: - references[invoice] = references[invoice] | order + references[invoices[group_key]] |= order if not invoices: raise UserError(_('There is no invoiceable line.'))