[CHG] prevent to declare fiscal month and/or year for all companies in a multi-company context

This commit is contained in:
Cédric Pigeon
2018-01-10 14:36:49 +01:00
parent 44b5efe0f4
commit 2a41432c20
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