Prevalidate invoice date on 'in invoice' and 'in credit note'

issue4865
review18401002
This commit is contained in:
Ralf Peschke committed 2015-09-24 10:34:12 +02:00
1 parent 969e02cf3a
commit 3f0d75766d
1 file changed
+12
+12
View File
@@ -250,9 +250,21 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
'tryton-go-previous'),
},
'validate_invoice': {
'pre_validate':
['OR',
('invoice_date', '!=', None),
('type', 'not in',
['in_invoice', 'in_credit_note']),
],
'invisible': Eval('state') != 'draft',
},
'post': {
'pre_validate':
['OR',
('invoice_date', '!=', None),
('type', 'not in',
['in_invoice', 'in_credit_note']),
],
'invisible': ~Eval('state').in_(['draft', 'validated']),
},
'pay': {