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
1=== modified file 'mrp_operations/mrp_operations.py'
2--- mrp_operations/mrp_operations.py 2011-01-14 00:11:01 +0000
3+++ mrp_operations/mrp_operations.py 2011-02-14 12:24:47 +0000
4@@ -119,11 +119,12 @@
5 @return: Nothing
6 """
7 wf_service = netsvc.LocalService("workflow")
8+ prod_obj_pool = self.pool.get('mrp.production')
9 oper_obj = self.browse(cr, uid, ids)[0]
10 prod_obj = oper_obj.production_id
11 if action == 'start':
12 if prod_obj.state =='confirmed':
13- self.pool.get('mrp.production').force_production(cr, uid, [prod_obj.id])
14+ prod_obj_pool.force_production(cr, uid, [prod_obj.id])
15 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
16 elif prod_obj.state =='ready':
17 wf_service.trg_validate(uid, 'mrp.production', prod_obj.id, 'button_produce', cr)
18@@ -139,6 +140,9 @@
19 if line.state != 'done':
20 flag = False
21 if flag:
22+ for production in prod_obj_pool.browse(cr, uid, [prod_obj.id], context= None):
23+ if production.move_lines or production.move_created_ids:
24+ prod_obj_pool.action_produce(cr,uid, production.id, production.product_qty, 'consume_produce', context = None)
25 wf_service.trg_validate(uid, 'mrp.production', oper_obj.production_id.id, 'button_produce_done', cr)
26 return
27
28@@ -244,10 +248,12 @@
29 wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr)
30 return super(mrp_production,self).action_in_production(cr, uid, ids)
31
32- def action_cancel(self, cr, uid, ids):
33+ def action_cancel(self, cr, uid, ids, context=None):
34 """ Cancels work order if production order is canceled.
35 @return: Super method
36 """
37+ if context is None:
38+ context = {}
39 obj = self.browse(cr, uid, ids)[0]
40 wf_service = netsvc.LocalService("workflow")
41 for workcenter_line in obj.workcenter_lines:
42
43=== modified file 'product/product.py'
44--- product/product.py 2011-02-08 11:04:12 +0000
45+++ product/product.py 2011-02-14 12:24:47 +0000
46@@ -139,7 +139,7 @@
47 context = {}
48 if from_unit.category_id.id <> to_unit.category_id.id:
49 if context.get('raise-exception', True):
50- raise osv.except_osv(_('Error !'), _('Conversion from Product UoM m to Default UoM PCE is not possible as they both belong to different Category!.'))
51+ 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,))
52 else:
53 return qty
54 amount = qty / from_unit.factor

Subscribers

People subscribed via source and target branches