[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
This commit is contained in:
Goffin Simon 2015-04-22 22:02:10 +02:00
parent 5b479e6114
commit 8a7993958d
2 changed files with 4 additions and 0 deletions

View File

@ -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]))

View File

@ -384,6 +384,7 @@
<field name="date_start"/>
<field name="date_stop"/>
<field name="attribute_value_ids" widget="many2many_tags" domain="[('product_ids.product_tmpl_id', '=', parent.product_tmpl_id)]"/>
<field name="property_ids" widget="many2many_tags"/>
</tree>
</field>
</page>