Handle default value for sequence with context for issue609

This commit is contained in:
Cédric Krier committed 2008-11-25 12:45:06 +01:00
1 parent 38d484ea4d
commit 4f5cc1a415
1 file changed
+12 -4
+12 -4
View File
@@ -1938,22 +1938,26 @@ class FiscalYear(OSV):
'Customer Invoice Sequence', required=True,
domain="[('code', '=', 'account.invoice')," \
"['OR', ('company', '=', company)," \
"('company', '=', False)]]")
"('company', '=', False)]]",
context="{'code': 'account.invoice', 'company': company}")
in_invoice_sequence = fields.Many2One('ir.sequence.strict',
'Supplier Invoice Sequence', required=True,
domain="[('code', '=', 'account.invoice')," \
"['OR', ('company', '=', company)," \
"('company', '=', False)]]")
"('company', '=', False)]]",
context="{'code': 'account.invoice', 'company': company}")
out_credit_note_sequence = fields.Many2One('ir.sequence.strict',
'Customer Credit Note Sequence', required=True,
domain="[('code', '=', 'account.invoice')," \
"['OR', ('company', '=', company)," \
"('company', '=', False)]]")
"('company', '=', False)]]",
context="{'code': 'account.invoice', 'company': company}")
in_credit_note_sequence = fields.Many2One('ir.sequence.strict',
'Supplier Credit Note Sequence', required=True,
domain="[('code', '=', 'account.invoice')," \
"['OR', ('company', '=', company)," \
"('company', '=', False)]]")
"('company', '=', False)]]",
context="{'code': 'account.invoice', 'company': company}")
def __init__(self):
super(FiscalYear, self).__init__()
@@ -2008,6 +2012,7 @@ class Period(OSV):
out_invoice_sequence = fields.Many2One('ir.sequence.strict',
'Customer Invoice Sequence',
domain="[('code', '=', 'account.invoice')]",
context="{'code': 'account.invoice'}",
states={
'required': "type == 'standard'",
'invisible': "type != 'standard'",
@@ -2015,6 +2020,7 @@ class Period(OSV):
in_invoice_sequence = fields.Many2One('ir.sequence.strict',
'Supplier Invoice Sequence',
domain="[('code', '=', 'account.invoice')]",
context="{'code': 'account.invoice'}",
states={
'required': "type == 'standard'",
'invisible': "type != 'standard'",
@@ -2022,6 +2028,7 @@ class Period(OSV):
out_credit_note_sequence = fields.Many2One('ir.sequence.strict',
'Customer Credit Note Sequence',
domain="[('code', '=', 'account.invoice')]",
context="{'code': 'account.invoice'}",
states={
'required': "type == 'standard'",
'invisible': "type != 'standard'",
@@ -2029,6 +2036,7 @@ class Period(OSV):
in_credit_note_sequence = fields.Many2One('ir.sequence.strict',
'Supplier Credit Note Sequence',
domain="[('code', '=', 'account.invoice')]",
context="{'code': 'account.invoice'}",
states={
'required': "type == 'standard'",
'invisible': "type != 'standard'",