[FIX] account_move_fiscal_year: check if the company is defined.

This commit is contained in:
Adrien Peiffer (ACSONE)
2017-10-18 09:30:16 +02:00
parent a9d0a3de1b
commit bd4f8a584b

View File

@@ -26,7 +26,8 @@ class AccountMove(models.Model):
for rec in self:
date = fields.Date.from_string(rec.date)
company = rec.company_id
rec.date_range_fy_id = company.find_daterange_fy(date)
rec.date_range_fy_id =\
company and company.find_daterange_fy(date) or False
@api.model
def _search_date_range_fy(self, operator, value):