From 1b3ac016af4238b2dfa33e059ae4ea9aeb997c0f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 21 Aug 2017 13:53:11 +0200 Subject: [PATCH] [FIX] account: P3 invalid comparison Python 3 removed "universal" ordering. ``ResCompany.fiscalyear_lock_date`` is not required and thus needs a fallback in case it's empty lest we try comparing a string and None or False, which is an error. --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 384e9b0f8e7..bce56c0829f 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1847,6 +1847,6 @@ class AccountFullReconcile(models.Model): # The move date should be the maximum date between payment and invoice # (in case of payment in advance). However, we should make sure the # move date is not recorded after the end of year closing. - if move_date > company.fiscalyear_lock_date: + if move_date > (company.fiscalyear_lock_date or '0000-00-00'): res['date'] = move_date return res