From c37cf25ec3d2baa6007f213f75a4b238a843d2f3 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 9 Sep 2016 02:25:10 +0200 Subject: [PATCH] [FIX] contract: Assign contract unconditionally --- contract/models/contract.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contract/models/contract.py b/contract/models/contract.py index 4a15d27a..33b72d37 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -163,18 +163,17 @@ class AccountAnalyticAccount(models.Model): # Get other invoice line values from product onchange invoice_line._onchange_product_id() invoice_line_vals = invoice_line._convert_to_write(invoice_line._cache) - + # Insert markers name = line.name + 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'] - contract = line.analytic_account_id lang = lang_obj.search( [('code', '=', contract.partner_id.lang)]) date_format = lang.date_format or '%m/%d/%Y' name = self._insert_markers( name, self.env.context['old_date'], self.env.context['next_date'], date_format) - invoice_line_vals.update({ 'name': name, 'account_analytic_id': contract.id,