From 829bb0502fe2857241b56a30f821468ed4f1a56f Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Fri, 23 Nov 2018 09:31:47 -0800 Subject: [PATCH] IMP `product_catch_weight` Add related fields to `stock.quant` for tree view and POS. --- product_catch_weight/models/stock.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/product_catch_weight/models/stock.py b/product_catch_weight/models/stock.py index c5cc9363..0e553569 100644 --- a/product_catch_weight/models/stock.py +++ b/product_catch_weight/models/stock.py @@ -54,3 +54,11 @@ class StockPicking(models.Model): def _compute_has_catch_weight(self): for picking in self: picking.has_catch_weight = any(picking.mapped('move_lines.product_catch_weight_uom_id')) + + +class StockQuant(models.Model): + _inherit = 'stock.quant' + + lot_catch_weight_ratio = fields.Float(related='lot_id.catch_weight_ratio') + lot_catch_weight = fields.Float(related='lot_id.catch_weight') + lot_catch_weight_uom_id = fields.Many2one('product.uom', related='lot_id.catch_weight_uom_id')