Somesh Khare has proposed merging 
lp:~openerp-dev/openobject-addons/5.0-opw-17363-skh into 
lp:openobject-addons/5.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/5.0-opw-17363-skh/+merge/74421

Hello,

Current scenario: 
   When create a sale order with MTO product/Buy, and cancel the picking for 
the order and cancel the sale order,
--- Procurement order is still in the confirm state.

Expected Scenario: 
   When the sale order cancelled with all its picking, Procurement order should 
also be in the cancelled state.

proposed patch fixed this issue.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/5.0-opw-17363-skh/+merge/74421
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/5.0-opw-17363-skh.
=== modified file 'sale/sale.py'
--- sale/sale.py	2011-05-16 14:11:53 +0000
+++ sale/sale.py	2011-09-07 13:03:34 +0000
@@ -501,6 +501,7 @@
     
     def action_cancel(self, cr, uid, ids, context={}):
         ok = True
+        wf_service = netsvc.LocalService("workflow")
         sale_order_line_obj = self.pool.get('sale.order.line')
         for sale in self.browse(cr, uid, ids):
             for pick in sale.picking_ids:
@@ -508,6 +509,12 @@
                     raise osv.except_osv(
                         _('Could not cancel sale order !'),
                         _('You must first cancel all packing attached to this sale order.'))
+                if pick.state == 'cancel':
+                    for mov in pick.move_lines:
+                        proc_ids = self.pool.get('mrp.procurement').search(cr, uid, [('move_id', '=', mov.id)])
+                        if proc_ids:
+                            for proc in proc_ids:
+                                wf_service.trg_validate(uid, 'mrp.procurement', proc, 'button_check', cr)
             for r in self.read(cr, uid, ids, ['picking_ids']):
                 for pick in r['picking_ids']:
                     wf_service = netsvc.LocalService("workflow")

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to