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) -