Merge pull request #599 from acsone/10.0-fiscal_month_year-cpi

[10.0] account_fiscal_year + account_fiscal_month: prevent to declare fiscal month and/or year for all companies in a multi-company context
This commit is contained in:
Pedro M. Baeza
2018-02-14 09:38:45 +01:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -17,5 +17,7 @@ class ResCompany(models.Model):
('type_id', '=', fm_id.id),
('date_start', '<=', date_str),
('date_end', '>=', date_str),
'|',
('company_id', '=', self.id),
])
('company_id', '=', False),
], limit=1, order='company_id asc')

View File

@@ -19,9 +19,13 @@ class ResCompany(models.Model):
('type_id', '=', fy_id.id),
('date_start', '<=', date_str),
('date_end', '>=', date_str),
'|',
('company_id', '=', self.id),
('company_id', '=', False),
]
date_range = self.env['date.range'].search(s_args)
date_range = self.env['date.range'].search(s_args,
limit=1,
order='company_id asc')
return date_range
@api.multi