Merge lp:~openerp-dev/openobject-addons/7.0-improve-mrp-domain-psa into lp:openobject-addons/7.0

Proposed by Paramjit Singh Sahota(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-improve-mrp-domain-psa
Merge into: lp:openobject-addons/7.0
Diff against target: 37 lines (+7/-2)
2 files modified
mrp/mrp.py (+5/-0)
mrp/mrp_view.xml (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-improve-mrp-domain-psa
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+154890@code.launchpad.net

Description of the change

Hello,

>> MRP Issue: producing a BoM with a component of Service type is not possible.

>>Video of the issue:
>https://docs.google.com/file/d/0B7c_6dPUa6bca0FEV0JOYjRpdGs/edit

Thankz YoU.
 -PSA.

To post a comment you must log in.
8913. By Paramjit Singh Sahota(OpenERP)

[MERGE] Merged lp:openobject-addons/7.0

Unmerged revisions

8913. By Paramjit Singh Sahota(OpenERP)

[MERGE] Merged lp:openobject-addons/7.0

8912. By Paramjit Singh Sahota(OpenERP)

[IMP] MRP Issue: producing a BoM with a component of Service type is not possible and added a warning message to prompt to user.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp/mrp.py'
2--- mrp/mrp.py 2012-12-20 11:47:30 +0000
3+++ mrp/mrp.py 2013-04-11 06:03:28 +0000
4@@ -375,6 +375,11 @@
5 default.update(name=_("%s (copy)") % (bom_data['name']), bom_id=False)
6 return super(mrp_bom, self).copy_data(cr, uid, id, default, context=context)
7
8+ def write(self, cr, uid, ids, vals, context=None):
9+ for bom in self.browse(cr, uid, ids, context=context):
10+ if bom.product_id.type == 'service':
11+ raise osv.except_osv(_('Warning!'), _('You cannot have service type products as a component of BoM.'))
12+ return super(mrp_bom, self).write(cr, uid, ids, vals, context=context)
13
14 def rounding(f, r):
15 import math
16
17=== modified file 'mrp/mrp_view.xml'
18--- mrp/mrp_view.xml 2013-03-19 12:52:16 +0000
19+++ mrp/mrp_view.xml 2013-04-11 06:03:28 +0000
20@@ -380,7 +380,7 @@
21 <page string="Components">
22 <field name="bom_lines" widget="one2many_list">
23 <tree string="Components" editable="bottom">
24- <field name="product_id" context="{'default_supply_method':'produce'}" on_change="onchange_product_id(product_id, name)"/>
25+ <field name="product_id" context="{'default_supply_method':'produce'}" on_change="onchange_product_id(product_id, name)" domain="[('type', '!=', 'service')]"/>
26 <field name="product_qty"/>
27 <field name="product_uom" on_change="onchange_uom(product_id, product_uom)" groups="product.group_uom"/>
28 <field name="name" invisible="1"/>
29@@ -635,7 +635,7 @@
30 </div>
31 <group>
32 <group>
33- <field name="product_id" on_change="product_id_change(product_id)" domain="[('bom_ids','!=',False),('bom_ids.bom_id','=',False)]" class="oe_inline" context='{"default_supply_method":"produce", "default_type": "product"}'/>
34+ <field name="product_id" on_change="product_id_change(product_id)" domain="[('bom_ids','!=',False),('bom_ids.bom_id','=',False),('type','!=','service')]" class="oe_inline" context='{"default_supply_method":"produce", "default_type": "product"}'/>
35 <label for="product_qty"/>
36 <div>
37 <field name="product_qty" class="oe_inline"/>