[FIX] l10n_be_intrastat: fix tracebacks
Surprisingly, people don't like tracebacks when they generate an Intrastat report opw-668827
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from openerp import fields, models
|
||||
from openerp import fields, models, api
|
||||
|
||||
|
||||
class account_invoice_line(models.Model):
|
||||
@@ -65,6 +65,7 @@ class product_category(models.Model):
|
||||
|
||||
intrastat_id = fields.Many2one('report.intrastat.code', 'Intrastat Code')
|
||||
|
||||
@api.multi
|
||||
def get_intrastat_recursively(self):
|
||||
""" Recursively search in categories to find an intrastat code id
|
||||
"""
|
||||
@@ -81,6 +82,7 @@ class product_product(models.Model):
|
||||
_name = "product.product"
|
||||
_inherit = "product.product"
|
||||
|
||||
@api.multi
|
||||
def get_intrastat_recursively(self):
|
||||
""" Recursively search in categories to find an intrastat code id
|
||||
"""
|
||||
|
||||
@@ -303,10 +303,9 @@ class xml_decl(osv.TransientModel):
|
||||
amount = inv_line.price_unit * inv_line.quantity
|
||||
else:
|
||||
amount = 0
|
||||
weight = (inv_line.product_id.weight_net or 0.0) * \
|
||||
weight = (inv_line.product_id.weight or 0.0) * \
|
||||
self.pool.get('product.uom')._compute_qty(cr, uid, inv_line.uom_id.id, inv_line.quantity, inv_line.product_id.uom_id.id)
|
||||
if (not inv_line.uos_id.category_id or not inv_line.product_id.uom_id.category_id
|
||||
or inv_line.uos_id.category_id.id != inv_line.product_id.uom_id.category_id.id):
|
||||
if not inv_line.product_id.uom_id.category_id:
|
||||
supply_units = inv_line.quantity
|
||||
else:
|
||||
supply_units = inv_line.quantity * inv_line.uom_id.factor
|
||||
|
||||
Reference in New Issue
Block a user