From 8a7993958d7a3c862c039e3bb73097478ebc48a0 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 22 Apr 2015 22:02:10 +0200 Subject: [PATCH] [IMP] mrp: properties on mrp.bom.line Now it's possible to put a property on a bom line. For example, the bom for an apple pie and for an apricot pie can be made in a single bom. Three lines are necessary in the bom of the product "pie": - First line with product " dough" without property - Second line, with product "apple" with property "apple" if you want an apple pie - Third line, with product "apricot" with property "apricot" if you want an apricot pie The type of this bom pie must be "set" to allow the customer to assemblate his favorite pie by himself. Now to sell an apple pie, you must create a SO with the product "pie" and the property "apple". In that way, the delivery order consists of two lines: - dough - apple --- addons/mrp/mrp.py | 3 +++ addons/mrp/mrp_view.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index fa6f189a262..0d0e10ffa44 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -297,6 +297,9 @@ class mrp_bom(osv.osv): if not product or (set(map(int,bom_line_id.attribute_value_ids or [])) - set(map(int,product.attribute_value_ids))): continue + if set(map(int, bom_line_id.property_ids or [])) - set(properties or []): + continue + if previous_products and bom_line_id.product_id.product_tmpl_id.id in previous_products: raise osv.except_osv(_('Invalid Action!'), _('BoM "%s" contains a BoM line with a product recursion: "%s".') % (master_bom.name,bom_line_id.product_id.name_get()[0][1])) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index f2c47a0cb34..89af1189d79 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -384,6 +384,7 @@ +