From 45e9b0d76abbadc018af5b7c8453f582c973a7a2 Mon Sep 17 00:00:00 2001 From: Ahmed Aly Date: Tue, 5 Dec 2017 10:56:11 +0100 Subject: [PATCH] Feedback 1142: Fehler bei Rechnungsanlage --- ext/custom-addons/dp_custom/models/account.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py index 6fcdfcf6..246e16d2 100644 --- a/ext/custom-addons/dp_custom/models/account.py +++ b/ext/custom-addons/dp_custom/models/account.py @@ -18,7 +18,7 @@ # along with this program. If not, see . # ############################################################################## -from odoo import api, fields, models, _ +from odoo import api, fields, models class AccountInvoiceLine(models.Model): @@ -29,6 +29,5 @@ class AccountInvoiceLine(models.Model): @api.model def create(self, vals): if vals.get('product_id', False) and not vals.get('intrastat_id', False): - vals.update(intrastat_id=vals['product_id'].intrastat_id.id) + vals.update(intrastat_id=self.env['product.template'].browse(vals['product_id']).intrastat_id.id) return super(AccountInvoiceLine, self).create(vals) -