Merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-mrp_request_return-dev-julio into lp:addons-vauxoo

Proposed by Julio Serna-http://www.vauxoo.com
Status: Merged
Merge reported by: Rodolfo Lopez
Merged at revision: not available
Proposed branch: lp:~vauxoo/addons-vauxoo/addons-vauxoo-mrp_request_return-dev-julio
Merge into: lp:addons-vauxoo
Diff against target: 54 lines (+23/-2)
2 files modified
mrp_request_return/wizard/mrp_request_return.py (+21/-0)
mrp_request_return/wizard/mrp_request_return_view.xml (+2/-2)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-mrp_request_return-dev-julio
Reviewer Review Type Date Requested Status
Isaac López Zúñiga Pending
Rodolfo Lopez Pending
Moisés López - http://www.vauxoo.com Pending
Review via email: mp+128614@code.launchpad.net

Description of the change

agrega default locaciones de los productos a pedir en la orden de produccion y onchange para la unidad de medida del producto

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Rodo,
En las pruebas de este nuevo concepto, asegúrate por favor, que el nombre del stock.move sea estándarizado a como están los otros stock.move, para que cuando genere su póliza contable, conserve el mismo nombre de igual forma.
Ya que creo que está poniendo el nombre del producto en stock.move::name, y el estándard es poner el nombre del production.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp_request_return/wizard/mrp_request_return.py'
2--- mrp_request_return/wizard/mrp_request_return.py 2012-09-25 04:30:22 +0000
3+++ mrp_request_return/wizard/mrp_request_return.py 2012-10-09 00:40:28 +0000
4@@ -95,6 +95,22 @@
5 class mrp_request_return_line(osv.osv_memory):
6 _name='mrp.request.return.line'
7 _rec_name = 'product_id'
8+
9+ def default_get(self, cr, uid, fields, context=None):
10+ if context is None: context = {}
11+ res = super(mrp_request_return_line, self).default_get(cr, uid, fields, context=context)
12+ mrp_ids = context.get('active_ids', [])
13+ if not mrp_ids or (not context.get('active_model') == 'mrp.production') \
14+ or len(mrp_ids) != 1:
15+ return res
16+ mrp_id, = mrp_ids
17+ mrp = self.pool.get('mrp.production').browse(cr, uid, mrp_id, context=context)
18+ res.update({
19+ 'location_id' : mrp.location_src_id.id,
20+ 'location_dest_id' : mrp.location_src_id.id,
21+ 'production_id' : mrp.id})
22+ return res
23+
24 _columns = {
25 'product_id' : fields.many2one('product.product', string="Product", required=True),
26 'product_qty' : fields.float("Quantity", digits_compute=dp.get_precision('Product UoM'), required=True),
27@@ -107,6 +123,11 @@
28 'product_uos_qty' : fields.float('Quantity UoS'),
29 'wizard_id' : fields.many2one('mrp.request.return', string="Wizard"),
30 }
31+
32+ def on_change_product_uom(self, cr, uid, ids, product_id):
33+ product_product = self.pool.get('product.product')
34+ product = product_product.browse(cr, uid, product_id)
35+ return {'value' : { 'product_uom': product.uom_id and product.uom_id.id}}
36
37 mrp_request_return_line()
38
39
40=== modified file 'mrp_request_return/wizard/mrp_request_return_view.xml'
41--- mrp_request_return/wizard/mrp_request_return_view.xml 2012-09-25 03:00:26 +0000
42+++ mrp_request_return/wizard/mrp_request_return_view.xml 2012-10-09 00:40:28 +0000
43@@ -12,9 +12,9 @@
44 <form string="Products">
45 <field name="type"/>
46 <newline/>
47- <field name="re_line_ids" mode="tree" nolabel="1" colspan="4" width="640" height="240">
48+ <field name="re_line_ids" mode="tree" nolabel="1" colspan="4" width="640" height="240" context="context">
49 <tree string="Products" editable="bottom">
50- <field name="product_id"/>
51+ <field name="product_id" on_change="on_change_product_uom(product_id)"/>
52 <field name="product_qty"/>
53 <field name="product_uom"/>
54 </tree>