From 55b5593e8ffd44ccbdefe765ab5fc0304c1b0417 Mon Sep 17 00:00:00 2001 From: Dave Lasley Date: Tue, 9 May 2017 10:29:35 -0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20contract:=20Operator=20issue=20in=20pri?= =?UTF-8?q?ce=20get=20*=20Add=20a=20default=20date=20in=20the=20instance?= =?UTF-8?q?=20that=20an=20analytic=20account=20doesn=E2=80=99t=20exist=20(?= =?UTF-8?q?templates)=20-=20fixes=20#68?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contract/models/account_analytic_invoice_line.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contract/models/account_analytic_invoice_line.py b/contract/models/account_analytic_invoice_line.py index e3a0487a..6467bbf2 100644 --- a/contract/models/account_analytic_invoice_line.py +++ b/contract/models/account_analytic_invoice_line.py @@ -68,11 +68,16 @@ class AccountAnalyticInvoiceLine(models.Model): self.uom_id.category_id.id): vals['uom_id'] = self.product_id.uom_id + date = ( + self.analytic_account_id.recurring_next_date or + fields.Datetime.now() + ) + product = self.product_id.with_context( lang=self.analytic_account_id.partner_id.lang, partner=self.analytic_account_id.partner_id.id, quantity=self.quantity, - date=self.analytic_account_id.recurring_next_date, + date=date, pricelist=self.analytic_account_id.pricelist_id.id, uom=self.uom_id.id )