Handle default value for sequence with context for issue609
This commit is contained in:
1 parent
5cb57261d4
commit
dfdad2735f
2 files changed
+8
-4
No files matched your search
+4
-2
@@ -1,4 +1,5 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
'Fiscal Year'
|
||||
|
||||
from trytond.osv import fields, OSV
|
||||
@@ -28,7 +29,8 @@ class FiscalYear(OSV):
|
||||
post_move_sequence = fields.Many2One('ir.sequence', 'Post Move Sequence',
|
||||
required=True, domain="[('code', '=', 'account.move')," \
|
||||
"['OR', ('company', '=', company)," \
|
||||
"('company', '=', False)]]")
|
||||
"('company', '=', False)]]",
|
||||
context="{'code': 'account.move', 'company': company}")
|
||||
company = fields.Many2One('company.company', 'Company', required=True)
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
'Period'
|
||||
|
||||
from trytond.osv import fields, OSV
|
||||
@@ -27,7 +28,8 @@ class Period(OSV):
|
||||
('close', 'Close'),
|
||||
], 'State', readonly=True, required=True)
|
||||
post_move_sequence =fields.Many2One('ir.sequence', 'Post Move Sequence',
|
||||
required=True, domain="[('code', '=', 'account.move')]")
|
||||
required=True, domain="[('code', '=', 'account.move')]",
|
||||
context="{'code': 'account.move'}")
|
||||
type = fields.Selection([
|
||||
('standard', 'Standard'),
|
||||
('adjustment', 'Adjustment'),
|
||||
|
||||
Reference in new issue
Block a user