Rename invoice state from cancel to cancelled
issue8927 review303661003
This commit is contained in:
1 parent
5c9562737e
commit
d0ff0bedcb
2 files changed
+4
-7
No files matched your search
+3
-6
@@ -327,7 +327,7 @@ class Commission(ModelSQL, ModelView):
|
||||
('', ''),
|
||||
('invoiced', 'Invoiced'),
|
||||
('paid', 'Paid'),
|
||||
('cancel', 'Canceled'),
|
||||
('cancelled', 'Cancelled'),
|
||||
], "Invoice State",
|
||||
help="The current state of the invoice "
|
||||
"that the commission appears on."),
|
||||
@@ -381,11 +381,8 @@ class Commission(ModelSQL, ModelView):
|
||||
if self.invoice_line:
|
||||
state = 'invoiced'
|
||||
invoice = self.invoice_line.invoice
|
||||
if invoice:
|
||||
if invoice.state == 'paid':
|
||||
state = 'paid'
|
||||
elif invoice.state == 'cancel':
|
||||
state = 'cancel'
|
||||
if invoice and invoice.state in {'paid', 'cancelled'}:
|
||||
state = invoice.state
|
||||
return state
|
||||
|
||||
@classmethod
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ class Invoice(metaclass=PoolMeta):
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('cancel')
|
||||
@Workflow.transition('cancelled')
|
||||
def cancel(cls, invoices):
|
||||
pool = Pool()
|
||||
Commission = pool.get('commission')
|
||||
|
||||
Reference in new issue
Block a user