From 4e519ae1976d2fb44d84b6d9ac9ed1498364752b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 16 Sep 2008 19:43:47 +0200 Subject: [PATCH] Improve sequence on period for the new field type --- invoice.py | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/invoice.py b/invoice.py index 07589eb644..eb9ec45d37 100644 --- a/invoice.py +++ b/invoice.py @@ -2064,17 +2064,33 @@ FiscalYear() class Period(OSV): _name = 'account.period' out_invoice_sequence = fields.Many2One('ir.sequence.strict', - 'Customer Invoice Sequence', required=True, - domain="[('code', '=', 'account.invoice')]") + 'Customer Invoice Sequence', + domain="[('code', '=', 'account.invoice')]", + states={ + 'required': "type == 'standard'", + 'invisible': "type != 'standard'", + }) in_invoice_sequence = fields.Many2One('ir.sequence.strict', - 'Supplier Invoice Sequence', required=True, - domain="[('code', '=', 'account.invoice')]") + 'Supplier Invoice Sequence', + domain="[('code', '=', 'account.invoice')]", + states={ + 'required': "type == 'standard'", + 'invisible': "type != 'standard'", + }) out_refund_sequence = fields.Many2One('ir.sequence.strict', - 'Customer Refund Sequence', required=True, - domain="[('code', '=', 'account.invoice')]") + 'Customer Refund Sequence', + domain="[('code', '=', 'account.invoice')]", + states={ + 'required': "type == 'standard'", + 'invisible': "type != 'standard'", + }) in_refund_sequence = fields.Many2One('ir.sequence.strict', - 'Supplier Refund Sequence', required=True, - domain="[('code', '=', 'account.invoice')]") + 'Supplier Refund Sequence', + domain="[('code', '=', 'account.invoice')]", + states={ + 'required': "type == 'standard'", + 'invisible': "type != 'standard'", + }) def __init__(self): super(Period, self).__init__()