mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
[IMP] intrastat_product: if module product_net_weight is installed, use it
If the OCA module product_net_weight from https://github.com/OCA/product-attribute is installed, use the field net_weight added by this module instead of the native weight field
This commit is contained in:
@@ -380,7 +380,12 @@ class IntrastatProductDeclaration(models.Model):
|
||||
elif source_uom.category_id == product.uom_id.category_id:
|
||||
# We suppose that, on product.template,
|
||||
# the 'weight' field is per uom_id
|
||||
weight = product.weight * source_uom._compute_quantity(
|
||||
# Test if module product_net_weight from OCA/product-attribute is installed
|
||||
if hasattr(product, "net_weight"):
|
||||
product_weight = product.net_weight
|
||||
else:
|
||||
product_weight = product.weight
|
||||
weight = product_weight * source_uom._compute_quantity(
|
||||
line_qty, product.uom_id
|
||||
)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user