Merge lp:~openerp-dev/openobject-addons/ron-dev-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2

Proposed by Rohan Nayani(Open ERP)
Status: Merged
Merged at revision: 4010
Proposed branch: lp:~openerp-dev/openobject-addons/ron-dev-addons2
Merge into: lp:~openerp-dev/openobject-addons/trunk-dev-addons2
Diff against target: 54 lines (+9/-3)
2 files modified
mrp_operations/mrp_operations.py (+8/-2)
product/product.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/ron-dev-addons2
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+49618@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mrp_operations/mrp_operations.py'
--- mrp_operations/mrp_operations.py 2011-01-14 00:11:01 +0000
+++ mrp_operations/mrp_operations.py 2011-02-14 12:24:47 +0000
@@ -119,11 +119,12 @@
119 @return: Nothing119 @return: Nothing
120 """120 """
121 wf_service = netsvc.LocalService("workflow")121 wf_service = netsvc.LocalService("workflow")
122 prod_obj_pool = self.pool.get('mrp.production')
122 oper_obj = self.browse(cr, uid, ids)[0]123 oper_obj = self.browse(cr, uid, ids)[0]
123 prod_obj = oper_obj.production_id124 prod_obj = oper_obj.production_id
124 if action == 'start':125 if action == 'start':
125 if prod_obj.state =='confirmed':126 if prod_obj.state =='confirmed':
126 self.pool.get('mrp.production').force_production(cr, uid, [prod_obj.id])127 prod_obj_pool.force_production(cr, uid, [prod_obj.id])
127 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)128 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
128 elif prod_obj.state =='ready':129 elif prod_obj.state =='ready':
129 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)130 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
@@ -139,6 +140,9 @@
139 if line.state != 'done':140 if line.state != 'done':
140 flag = False141 flag = False
141 if flag:142 if flag:
143 for production in prod_obj_pool.browse(cr, uid, [prod_obj.id], context= None):
144 if production.move_lines or production.move_created_ids:
145 prod_obj_pool.action_produce(cr,uid, production.id, production.product_qty, 'consume_produce', context = None)
142 wf_service.trg_validate(uid, 'mrp.production', oper_obj.production_id.id, 'button_produce_done', cr)146 wf_service.trg_validate(uid, 'mrp.production', oper_obj.production_id.id, 'button_produce_done', cr)
143 return147 return
144148
@@ -244,10 +248,12 @@
244 wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)248 wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
245 return super(mrp_production,self).action_in_production(cr, uid, ids)249 return super(mrp_production,self).action_in_production(cr, uid, ids)
246 250
247 def action_cancel(self, cr, uid, ids):251 def action_cancel(self, cr, uid, ids, context=None):
248 """ Cancels work order if production order is canceled.252 """ Cancels work order if production order is canceled.
249 @return: Super method253 @return: Super method
250 """254 """
255 if context is None:
256 context = {}
251 obj = self.browse(cr, uid, ids)[0]257 obj = self.browse(cr, uid, ids)[0]
252 wf_service = netsvc.LocalService("workflow")258 wf_service = netsvc.LocalService("workflow")
253 for workcenter_line in obj.workcenter_lines:259 for workcenter_line in obj.workcenter_lines:
254260
=== modified file 'product/product.py'
--- product/product.py 2011-02-08 11:04:12 +0000
+++ product/product.py 2011-02-14 12:24:47 +0000
@@ -139,7 +139,7 @@
139 context = {}139 context = {}
140 if from_unit.category_id.id <> to_unit.category_id.id:140 if from_unit.category_id.id <> to_unit.category_id.id:
141 if context.get('raise-exception', True):141 if context.get('raise-exception', True):
142 raise osv.except_osv(_('Error !'), _('Conversion from Product UoM m to Default UoM PCE is not possible as they both belong to different Category!.'))142 raise osv.except_osv(_('Error !'), _('Conversion from Product UoM %s to Default UoM %s is not possible as they both belong to different Category!.') % (from_unit.name,to_unit.name,))
143 else:143 else:
144 return qty144 return qty
145 amount = qty / from_unit.factor145 amount = qty / from_unit.factor

Subscribers

People subscribed via source and target branches