From 8c477e0a0748f8afd751aa06cc57f1ac05ffda74 Mon Sep 17 00:00:00 2001 From: lreficent Date: Wed, 20 Sep 2017 14:26:33 +0200 Subject: [PATCH] [9.0] mrp_repair_refurbish: send consumed products for standard repair to scrap location. --- mrp_repair_refurbish/models/mrp_repair.py | 5 +++++ mrp_repair_refurbish/views/product_product_view.xml | 2 -- mrp_repair_refurbish/views/product_template_view.xml | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mrp_repair_refurbish/models/mrp_repair.py b/mrp_repair_refurbish/models/mrp_repair.py index 3797b78e2..2a778aeae 100644 --- a/mrp_repair_refurbish/models/mrp_repair.py +++ b/mrp_repair_refurbish/models/mrp_repair.py @@ -88,4 +88,9 @@ class mrp_repair_line(orm.Model): context['to_refurbish']): res['value']['location_dest_id'] = context[ 'refurbish_location_dest_id'] + elif (type == 'add' and 'to_refurbish' in context and not + context['to_refurbish']): + scrap_location_ids = self.pool['stock.location'].search(cr, uid, [ + ('usage', '=', 'customer')], context=context) + res['value']['location_dest_id'] = scrap_location_ids[0] return res diff --git a/mrp_repair_refurbish/views/product_product_view.xml b/mrp_repair_refurbish/views/product_product_view.xml index 29e1eacd0..f418118fe 100644 --- a/mrp_repair_refurbish/views/product_product_view.xml +++ b/mrp_repair_refurbish/views/product_product_view.xml @@ -4,8 +4,6 @@ product.product.form product.product - primary - diff --git a/mrp_repair_refurbish/views/product_template_view.xml b/mrp_repair_refurbish/views/product_template_view.xml index 4885ff6a0..cafa2730b 100644 --- a/mrp_repair_refurbish/views/product_template_view.xml +++ b/mrp_repair_refurbish/views/product_template_view.xml @@ -4,8 +4,6 @@ product.template.product.form product.template - primary -