diff --git a/INSTALL b/INSTALL index a333c18f5c..91269ed19a 100644 --- a/INSTALL +++ b/INSTALL @@ -9,6 +9,7 @@ Prerequisites * trytond_account_stock_landed_cost (http://www.tryton.org/) * trytond_product (http://www.tryton.org/) * trytond_product_measurements (http://www.tryton.org/) + * trytond_stock_shipment_measurements (http://www.tryton.org/) Installation ------------ diff --git a/account.py b/account.py index e89a22945e..861d164c2b 100644 --- a/account.py +++ b/account.py @@ -2,7 +2,7 @@ # this repository contains the full copyright notices and license terms. from decimal import Decimal -from trytond.pool import PoolMeta, Pool +from trytond.pool import PoolMeta __all__ = ['LandedCost'] @@ -21,25 +21,13 @@ class LandedCost: def _get_weight_factors(self): "Return the factor for each move based on weight" - pool = Pool() - ModelData = pool.get('ir.model.data') - Uom = pool.get('product.uom') - - kg = Uom(ModelData.get_id('product', 'uom_kilogram')) moves = [m for s in self.shipments for m in s.incoming_moves if m.state != 'cancel'] sum_weight = Decimal(0) weights = {} for move in moves: - if not move.product.weight: - weight = 0 - else: - weight = Uom.compute_qty( - move.product.weight_uom, - move.product.weight * move.internal_quantity, - kg, round=False) - weight = Decimal(str(weight)) + weight = Decimal(str(move.internal_weight or 0)) weights[move.id] = weight sum_weight += weight factors = {} diff --git a/tryton.cfg b/tryton.cfg index 245b41b4e9..fffc0f828d 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -5,3 +5,4 @@ depends: ir product product_measurements + stock_shipment_measurements