diff --git a/fiscalyear.py b/fiscalyear.py index db8a4eaf1f..9937f95015 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -36,7 +36,8 @@ class FiscalYear(ModelSQL, ModelView): context="{'code': 'account.move', 'company': company}", depends=['company']) company = fields.Many2One('company.company', 'Company', required=True, - domain=["('id', '=', context.get('company', False))"]) + domain=["('id', 'company' in context and '=' or '!=', " \ + "context.get('company', 0))"]) def __init__(self): super(FiscalYear, self).__init__() diff --git a/tax.py b/tax.py index 0beac79e8d..6561b899cd 100644 --- a/tax.py +++ b/tax.py @@ -616,7 +616,8 @@ class Tax(ModelSQL, ModelView): parent = fields.Many2One('account.tax', 'Parent', ondelete='CASCADE') childs = fields.One2Many('account.tax', 'parent', 'Children') company = fields.Many2One('company.company', 'Company', required=True, - domain=["('id', '=', context.get('company', 0))"]) + domain=["('id', 'company' in context and '=' or '!=', " \ + "context.get('company', 0))"]) invoice_account = fields.Many2One('account.account', 'Invoice Account', domain=["('company', '=', company)", ('kind', '!=', 'view')], @@ -1043,7 +1044,8 @@ class Rule(ModelSQL, ModelView): _description = __doc__ name = fields.Char('Name', required=True, translate=True) company = fields.Many2One('company.company', 'Company', required=True, - select=1, domain=["('id', '=', context.get('company', 0))"]) + select=1, domain=["('id', 'company' in context and '=' or '!=', " \ + "context.get('company', 0))"]) lines = fields.One2Many('account.tax.rule.line', 'rule', 'Lines') template = fields.Many2One('account.tax.rule.template', 'Template')