Feedback 1142: Fehler bei Rechnungsanlage

develop
Ahmed Aly 2017-12-05 10:56:11 +01:00
parent 9df9a9c31e
commit 45e9b0d76a
1 changed files with 2 additions and 3 deletions

View File

@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## ##############################################################################
from odoo import api, fields, models, _ from odoo import api, fields, models
class AccountInvoiceLine(models.Model): class AccountInvoiceLine(models.Model):
@ -29,6 +29,5 @@ class AccountInvoiceLine(models.Model):
@api.model @api.model
def create(self, vals): def create(self, vals):
if vals.get('product_id', False) and not vals.get('intrastat_id', False): 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) return super(AccountInvoiceLine, self).create(vals)