Pankita Shah(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-cancel-po-atp-improvement_cancel_button-shp
 into lp:~openerp-dev/openobject-addons/trunk-cancel-po-atp.

Requested reviews:
  Atul Patel(OpenERP) (atp-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-cancel-po-atp-improvement_cancel_button-shp/+merge/121413

hello sir ,

i resubmit as per your suggestion

thanks 
shp
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-cancel-po-atp-improvement_cancel_button-shp/+merge/121413
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-cancel-po-atp.
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py	2012-08-15 20:13:20 +0000
+++ purchase/purchase.py	2012-08-27 12:21:40 +0000
@@ -492,12 +492,9 @@
         wf_service = netsvc.LocalService("workflow")
         for purchase in self.browse(cr, uid, ids, context=context):
             for pick in purchase.picking_ids:
-                if pick.state not in ('draft','cancel'):
-                    raise osv.except_osv(
-                        _('Unable to cancel this purchase order.'),
-                        _('First cancel all receptions related to this purchase order.'))
-            for pick in purchase.picking_ids:
-                wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_cancel', cr)
+                if pick.state not in ('done'):
+                    for pick in purchase.picking_ids:
+                        wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_cancel', cr)                    
             for inv in purchase.invoice_ids:
                 if inv and inv.state not in ('cancel','draft'):
                     raise osv.except_osv(

=== modified file 'purchase/purchase_view.xml'
--- purchase/purchase_view.xml	2012-08-17 08:46:11 +0000
+++ purchase/purchase_view.xml	2012-08-27 12:21:40 +0000
@@ -180,7 +180,7 @@
                     <button name="purchase_confirm" states="draft,sent" string="Confirm Quotation" class="oe_highlight"/>
                     <button name="wkf_send_rfq" states="draft" string="Send RFQ" type="object" context="{'send_rfq':True}"/>
                     <button name="wkf_send_rfq" states="confirmed" string="Resend Purchase Order" type="object" class="oe_highlight"/>
-                    <button name="action_cancel" states="except_picking,except_invoice" string="Cancel" type="object" />
+                    <button name="action_cancel" states="except_picking,except_invoice,approved" string="Cancel" type="object" />
                     <button name="picking_ok" states="except_picking" string="Manually Corrected"/>
                     <button name="invoice_ok" states="except_invoice" string="Manually Corrected"/>
                     <button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight"/>

_______________________________________________
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