From 13acf42c62ad724ddabb7691dc4acd258e7a12ea Mon Sep 17 00:00:00 2001 From: Sunny Sheth Date: Wed, 26 Dec 2018 01:37:51 +0530 Subject: [PATCH] [FIX] Issue-199: if not set Partner Language then language should be company's partner language for date format. --- contract/__manifest__.py | 2 +- contract/models/account_analytic_account.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contract/__manifest__.py b/contract/__manifest__.py index e63b2fc2..038d8838 100644 --- a/contract/__manifest__.py +++ b/contract/__manifest__.py @@ -9,7 +9,7 @@ { 'name': 'Contracts Management - Recurring', - 'version': '10.0.4.2.0', + 'version': '10.0.4.2.1', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "OpenERP SA, " diff --git a/contract/models/account_analytic_account.py b/contract/models/account_analytic_account.py index f5e5dd0a..ee0f6ee9 100644 --- a/contract/models/account_analytic_account.py +++ b/contract/models/account_analytic_account.py @@ -198,8 +198,8 @@ class AccountAnalyticAccount(models.Model): contract = line.analytic_account_id if 'old_date' in self.env.context and 'next_date' in self.env.context: lang_obj = self.env['res.lang'] - lang = lang_obj.search( - [('code', '=', contract.partner_id.lang)]) + code = contract.partner_id.lang or self.company_id.partner_id.lang + lang = lang_obj.search([('code', '=', code)]) date_format = lang.date_format or '%m/%d/%Y' name = self._insert_markers( line, self.env.context['old_date'],