Merge lp:~openerp-dev/openobject-addons/trunk-bug-1185457-amitvora into lp:openobject-addons

Proposed by Amit Vora(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1185457-amitvora
Merge into: lp:openobject-addons
Diff against target: 31 lines (+9/-1)
2 files modified
mrp/mrp.py (+8/-0)
mrp/mrp_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1185457-amitvora
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+166661@code.launchpad.net

Description of the change

Hello,
         I have fixed mrp.production.line form should auto fill fields when choosing a product
Thanks,
Amit.

To post a comment you must log in.

Unmerged revisions

8740. By Amit Vora(OpenERP)

[FIX] set value product_uom field

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 2013-04-15 10:23:49 +0000
3+++ mrp/mrp.py 2013-05-31 06:59:32 +0000
4@@ -1040,6 +1040,14 @@
5 class mrp_production_product_line(osv.osv):
6 _name = 'mrp.production.product.line'
7 _description = 'Production Scheduled Product'
8+
9+ def product_id_change(self, cr, uid, ids, product, context=None):
10+ value={}
11+ product_obj = self.pool.get('product.product')
12+ product_obj = product_obj.browse(cr, uid, product, context)
13+ value['product_uom'] = product_obj.uom_id.id
14+ return {'value' : value}
15+
16 _columns = {
17 'name': fields.char('Name', size=64, required=True),
18 'product_id': fields.many2one('product.product', 'Product', required=True),
19
20=== modified file 'mrp/mrp_view.xml'
21--- mrp/mrp_view.xml 2013-03-21 09:37:16 +0000
22+++ mrp/mrp_view.xml 2013-05-31 06:59:32 +0000
23@@ -908,7 +908,7 @@
24 <form string="Scheduled Products" version="7.0">
25 <group col="4">
26 <field name="name"/>
27- <field name="product_id"/>
28+ <field name="product_id" on_change="product_id_change(product_id)"/>
29 <field name="product_qty"/>
30 <field name="product_uom" groups="product.group_uom"/>
31 <field name="product_uos_qty" groups="product.group_uos"/>

Subscribers

People subscribed via source and target branches

to all changes: