From 945e648d0f63a06ed7add8689203925ff0faf899 Mon Sep 17 00:00:00 2001 From: lreficent Date: Thu, 22 Dec 2016 15:25:38 +0100 Subject: [PATCH] stock_orderpoint_manual_procurement: Migrated to 9.0 --- .../README.rst | 10 ++--- .../__openerp__.py | 4 +- .../models/stock_warehouse_orderpoint.py | 7 +-- .../views/procurement_order_view.xml | 28 ++++++------ .../views/stock_warehouse_orderpoint_view.xml | 44 +++++++++---------- 5 files changed, 44 insertions(+), 49 deletions(-) diff --git a/stock_orderpoint_manual_procurement/README.rst b/stock_orderpoint_manual_procurement/README.rst index 18dd9112d..c796d1930 100644 --- a/stock_orderpoint_manual_procurement/README.rst +++ b/stock_orderpoint_manual_procurement/README.rst @@ -9,13 +9,12 @@ Stock Orderpoint Manual Procurement This module allows users to manually start procurements from the list of reordering rules, based on the quantity that is recommended to be procured. - Usage ===== -Go to 'Configuration / Reordering Rules' and review the quantity recommended -to be procured. You can now start the procurement for a single or a list of -reordering rules. +Go to 'Inventory > Inventory Control > Reordering Rules' and review the +quantity recommended to be procured. You can now start the procurement for a +single or a list of reordering rules. The recommended quantity to procure is adjusted to the procurement unit of measure indicated in the reordering rule. @@ -28,7 +27,6 @@ procurements from reordering rules', under 'Settings / Users / Users'. :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/153/8.0 - Bug Tracker =========== @@ -49,7 +47,7 @@ Contributors ------------ * Jordi Ballester Alomar - +* Lois Rilo Antelo Maintainer ---------- diff --git a/stock_orderpoint_manual_procurement/__openerp__.py b/stock_orderpoint_manual_procurement/__openerp__.py index 18b423543..97582d2a2 100644 --- a/stock_orderpoint_manual_procurement/__openerp__.py +++ b/stock_orderpoint_manual_procurement/__openerp__.py @@ -6,7 +6,7 @@ "name": "Stock Orderpoint manual procurement", "summary": "Allows to create procurement orders from orderpoints instead " "of relying only on the scheduler", - "version": "8.0.1.0.0", + "version": "9.0.1.0.0", "author": "Eficent Business and IT Consulting Services S.L," "Odoo Community Association (OCA)", "website": "https://www.odoo-community.org", @@ -20,5 +20,5 @@ ], "license": "AGPL-3", 'installable': True, - 'application': True, + 'application': False, } diff --git a/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py b/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py index 449d1c353..953f45681 100644 --- a/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py +++ b/stock_orderpoint_manual_procurement/models/stock_warehouse_orderpoint.py @@ -19,12 +19,14 @@ class StockWarehouseOrderpoint(models.Model): @api.depends("product_min_qty", "product_id", "qty_multiple") def _compute_procure_recommended(self): procurement_model = self.env['procurement.order'] + op_qtys = self.subtract_procurements_from_orderpoints(self.ids) for op in self: op.procure_recommended_date = \ procurement_model._get_orderpoint_date_planned( op, datetime.today()) procure_recommended_qty = 0.0 - prods = procurement_model._product_virtual_get(op) + prods = op.with_context( + location=op.location_id.id).product_id.virtual_available if prods is None: continue if float_compare(prods, op.product_min_qty, @@ -41,8 +43,7 @@ class StockWarehouseOrderpoint(models.Model): precision_rounding=op.product_uom.rounding) <= 0: continue - qty -= op.subtract_procurements(op) - + qty -= op_qtys[op.id] qty_rounded = float_round( qty, precision_rounding=op.product_uom.rounding) if qty_rounded > 0: diff --git a/stock_orderpoint_manual_procurement/views/procurement_order_view.xml b/stock_orderpoint_manual_procurement/views/procurement_order_view.xml index e97c69b09..ccae0d9cc 100644 --- a/stock_orderpoint_manual_procurement/views/procurement_order_view.xml +++ b/stock_orderpoint_manual_procurement/views/procurement_order_view.xml @@ -1,19 +1,17 @@ - - - - - procurement.order.select - procurement.order - - - - - + + + procurement.order.select + procurement.order + + + + - - - + + + + diff --git a/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml b/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml index 272b34f72..27cafe54b 100644 --- a/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml +++ b/stock_orderpoint_manual_procurement/views/stock_warehouse_orderpoint_view.xml @@ -1,29 +1,27 @@ - - - stock.warehouse.orderpoint.tree - stock.warehouse.orderpoint - - - - - - -