Fix usage of context company

Default value of company should be -1 to get the right cast and an impossible
value.
Replace False by None as other value in "in" clause.

issue3394
review1119002
This commit is contained in:
Cédric Krier committed 2013-10-09 18:25:13 +02:00
1 parent 28d31e7b9b
commit 0614e11c0e
1 file changed
+2 -2
+2 -2
View File
@@ -19,13 +19,13 @@ class Statement(Workflow, ModelSQL, ModelView):
company = fields.Many2One('company.company', 'Company', required=True,
select=True, states=_STATES, domain=[
('id', If(Eval('context', {}).contains('company'), '=', '!='),
Eval('context', {}).get('company', 0)),
Eval('context', {}).get('company', -1)),
],
depends=_DEPENDS)
journal = fields.Many2One('account.statement.journal', 'Journal',
required=True,
domain=[
('company', '=', Eval('context', {}).get('company', 0)),
('company', '=', Eval('context', {}).get('company', -1)),
],
states={
'readonly': (Eval('state') != 'draft') | Eval('lines'),