From 85883c4ab017ec8378d19e0875bb70a1175cd895 Mon Sep 17 00:00:00 2001 From: Timon Tschanz Date: Mon, 1 Oct 2018 17:24:34 +0200 Subject: [PATCH] [FIX] stock_available_mrp: remove duplicate button + fix calculation of immediately usable qty --- stock_available_mrp/__manifest__.py | 3 --- .../models/product_template.py | 2 +- .../views/product_template_view.xml | 25 ------------------- 3 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 stock_available_mrp/views/product_template_view.xml diff --git a/stock_available_mrp/__manifest__.py b/stock_available_mrp/__manifest__.py index b70a3108b..5564377f3 100644 --- a/stock_available_mrp/__manifest__.py +++ b/stock_available_mrp/__manifest__.py @@ -11,9 +11,6 @@ 'stock_available', 'mrp' ], - 'data': [ - 'views/product_template_view.xml', - ], 'demo': [ 'demo/mrp_data.xml', ], diff --git a/stock_available_mrp/models/product_template.py b/stock_available_mrp/models/product_template.py index 7e92f7b66..5ae46c3a5 100644 --- a/stock_available_mrp/models/product_template.py +++ b/stock_available_mrp/models/product_template.py @@ -13,5 +13,5 @@ class ProductTemplate(models.Model): res = super(ProductTemplate, self)._compute_available_quantities_dict() for template in self.filtered('bom_ids'): res[template.id]['immediately_usable_qty'] =\ - res[template.id]['potential_qty'] + template.virtual_available + res[template.id]['potential_qty'] return res diff --git a/stock_available_mrp/views/product_template_view.xml b/stock_available_mrp/views/product_template_view.xml deleted file mode 100644 index fa20ec54b..000000000 --- a/stock_available_mrp/views/product_template_view.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Potential quantity on product form - product.template - form - - - - - - - - - -