Merge PR #283 into 17.0

Signed-off-by StefanRijnhart
This commit is contained in:
OCA-git-bot
2024-12-04 09:47:25 +00:00
4 changed files with 19 additions and 1 deletions

View File

@@ -53,6 +53,12 @@ Installation
This module is NOT compatible with the *account_intrastat* module from This module is NOT compatible with the *account_intrastat* module from
Odoo Enterprise. Odoo Enterprise.
We recommended to install the module **product_net_weight** from
``OCA/product-attribute <https://github.com/OCA/product-attribute>``\ \_.
If this module is installed, Odoo will use the *Net Weight* field of the
product to compute the intrastat declaration instead of the native
*Weight* field.
Configuration Configuration
============= =============

View File

@@ -363,7 +363,12 @@ class IntrastatProductDeclaration(models.Model):
elif source_uom.category_id == product.uom_id.category_id: elif source_uom.category_id == product.uom_id.category_id:
# We suppose that, on product.template, # We suppose that, on product.template,
# the 'weight' field is per uom_id # 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 line_qty, product.uom_id
) )
else: else:

View File

@@ -1,2 +1,4 @@
This module is NOT compatible with the *account_intrastat* module from This module is NOT compatible with the *account_intrastat* module from
Odoo Enterprise. Odoo Enterprise.
We recommended to install the module **product_net_weight** from `OCA/product-attribute <https://github.com/OCA/product-attribute>`_. If this module is installed, Odoo will use the *Net Weight* field of the product to compute the intrastat declaration instead of the native *Weight* field.

View File

@@ -402,6 +402,11 @@ those countries.</p>
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1> <h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<p>This module is NOT compatible with the <em>account_intrastat</em> module from <p>This module is NOT compatible with the <em>account_intrastat</em> module from
Odoo Enterprise.</p> Odoo Enterprise.</p>
<p>We recommended to install the module <strong>product_net_weight</strong> from
<tt class="docutils literal"><span class="pre">OCA/product-attribute</span> <span class="pre">&lt;https://github.com/OCA/product-attribute&gt;</span></tt>_.
If this module is installed, Odoo will use the <em>Net Weight</em> field of the
product to compute the intrastat declaration instead of the native
<em>Weight</em> field.</p>
</div> </div>
<div class="section" id="configuration"> <div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1> <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>