Rename invoice state from cancel to cancelled
issue8927 review303661003
This commit is contained in:
1 parent
e745ab43d1
commit
bf6191ef2c
2 files changed
+4
-4
No files matched your search
+1
-1
@@ -92,7 +92,7 @@ class Invoice(metaclass=PoolMeta):
|
||||
@Workflow.transition('draft')
|
||||
def draft(cls, invoices):
|
||||
for invoice in invoices:
|
||||
if invoice.sales and invoice.state == 'cancel':
|
||||
if invoice.sales and invoice.state == 'cancelled':
|
||||
raise AccessError(
|
||||
gettext('sale.msg_sale_invoice_reset_draft',
|
||||
invoice=invoice.rec_name))
|
||||
|
||||
@@ -555,7 +555,7 @@ class Sale(
|
||||
skip_ids.update(x.id for x in self.invoices_recreated)
|
||||
invoices = [i for i in self.invoices if i.id not in skip_ids]
|
||||
if invoices:
|
||||
if any(i.state == 'cancel' for i in invoices):
|
||||
if any(i.state == 'cancelled' for i in invoices):
|
||||
return 'exception'
|
||||
elif all(i.state == 'paid' for i in invoices):
|
||||
return 'paid'
|
||||
@@ -1615,7 +1615,7 @@ class SaleLine(sequence_ordered(), ModelSQL, ModelView):
|
||||
invoiced_quantity = 0
|
||||
for invoice_line in self.invoice_lines:
|
||||
if (not invoice_line.invoice
|
||||
or invoice_line.invoice.state != 'cancel'):
|
||||
or invoice_line.invoice.state != 'cancelled'):
|
||||
invoiced_quantity += Uom.compute_qty(
|
||||
invoice_line.unit, invoice_line.quantity, self.unit)
|
||||
self.actual_quantity = max(moved_quantity, invoiced_quantity, key=abs)
|
||||
@@ -1839,7 +1839,7 @@ class HandleInvoiceException(Wizard):
|
||||
skips.update(sale.invoices_recreated)
|
||||
invoices = []
|
||||
for invoice in sale.invoices:
|
||||
if invoice.state == 'cancel' and invoice not in skips:
|
||||
if invoice.state == 'cancelled' and invoice not in skips:
|
||||
invoices.append(invoice.id)
|
||||
return {
|
||||
'recreate_invoices': invoices,
|
||||
|
||||
Reference in new issue
Block a user