diff --git a/stock_warehouse_orderpoint_stock_info/__openerp__.py b/stock_warehouse_orderpoint_stock_info/__openerp__.py index 02ecb0528..4816e0cc2 100644 --- a/stock_warehouse_orderpoint_stock_info/__openerp__.py +++ b/stock_warehouse_orderpoint_stock_info/__openerp__.py @@ -18,7 +18,7 @@ { "name": "Reordering rules stock info", - "version": "1.0", + "version": "8.0.1.0.0", "depends": [ "stock", ], diff --git a/stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py b/stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py index 6daf3aba0..fed845c0c 100644 --- a/stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py +++ b/stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py @@ -11,9 +11,13 @@ class StockWarehouseOrderpoint(models.Model): @api.one def _product_available_qty(self): - self.product_location_qty = self.product_id.with_context( + product_available = self.product_id.with_context( location=self.location_id.id - )._product_available()[self.product_id.id]['qty_available'] + )._product_available()[self.product_id.id] + self.product_location_qty = product_available['qty_available'] + self.incoming_location_qty = product_available['incoming_qty'] + self.outgoing_location_qty = product_available['outgoing_qty'] + self.virtual_location_qty = product_available['virtual_available'] @api.one @api.depends('product_location_qty', 'product_min_qty') @@ -22,6 +26,16 @@ class StockWarehouseOrderpoint(models.Model): product_location_qty = fields.Float( string='Quantity On Location', compute='_product_available_qty') + incoming_location_qty = fields.Float( + string='Incoming On Location', compute='_product_available_qty') + outgoing_location_qty = fields.Float( + string='Outgoing On Location', compute='_product_available_qty') + virtual_location_qty = fields.Float( + string='Forecast On Location', compute='_product_available_qty') + available = fields.Boolean( string='Is enough product available?', compute='_product_available', store=True) + product_category = fields.Many2one(string='Product Category', + related='product_id.categ_id', + store=True) diff --git a/stock_warehouse_orderpoint_stock_info/views/stock_warehouse_orderpoint_view.xml b/stock_warehouse_orderpoint_stock_info/views/stock_warehouse_orderpoint_view.xml index 745d129bb..e76d4c8f9 100644 --- a/stock_warehouse_orderpoint_stock_info/views/stock_warehouse_orderpoint_view.xml +++ b/stock_warehouse_orderpoint_stock_info/views/stock_warehouse_orderpoint_view.xml @@ -6,8 +6,14 @@ stock.warehouse.orderpoint + + + + + + @@ -21,6 +27,9 @@ + + + @@ -31,6 +40,17 @@ stock.warehouse.orderpoint + + + + + + +