Add more information in the sale error message

This commit is contained in:
Bernat Brunet Torruella
2017-05-16 17:28:27 +02:00
parent 3c6dce1223
commit b4bb7b14b2
3 changed files with 6 additions and 11 deletions

View File

@@ -44,7 +44,7 @@ class Sale:
})
cls._error_messages.update({
'not_customer_invoice': ('A customer invoice/refund '
'from sale device has not been created.'),
'from sale device (%s) has not been created.'),
})
@staticmethod
@@ -67,7 +67,7 @@ class Sale:
cls.process([sale])
if not sale.invoices and sale.invoice_method == 'order':
cls.raise_user_error('not_customer_invoice')
cls.raise_user_error('not_customer_invoice', (sale.reference,))
grouping = getattr(sale.party, 'sale_invoice_grouping_method',
False)