From bd4f8a584be70bcc4d99aedad2c9739991245267 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Wed, 18 Oct 2017 09:30:16 +0200 Subject: [PATCH] [FIX] account_move_fiscal_year: check if the company is defined. --- account_move_fiscal_year/models/account_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_move_fiscal_year/models/account_move.py b/account_move_fiscal_year/models/account_move.py index 48208dd2f..eba8c0e38 100644 --- a/account_move_fiscal_year/models/account_move.py +++ b/account_move_fiscal_year/models/account_move.py @@ -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):