← Back to team overview

openerp-india team mailing list archive

[Bug 1027755] [NEW] Can`t delete the Requests for Quotation

 

Public bug reported:

OpenERP V6.0 
It`s error When delete the Requests for Quotation 

"A document was modified since you last viewed it (Purchase Order:xxx)"

I think we need to delete  the context['__last_update']

    def unlink(self, cr, uid, ids, context=None):
        purchase_orders = self.read(cr, uid, ids, ['state'], context=context)
        unlink_ids = []
        for s in purchase_orders:
            if s['state'] in ['draft','cancel']:
                unlink_ids.append(s['id'])
            else:
                raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!')  % _(dict(purchase_order.STATE_SELECTION).get(s['state'])))

        # TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
        # automatically sending subflow.delete upon deletion
        wf_service = netsvc.LocalService("workflow")
        for id in unlink_ids:
            wf_service.trg_validate(uid, 'purchase.order', id, 'purchase_cancel', cr)
        del context['__last_update']
        return super(purchase_order, self).unlink(cr, uid, unlink_ids, context=context)

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1027755

Title:
  Can`t delete the Requests for Quotation

Status in OpenERP Addons (modules):
  New

Bug description:
  OpenERP V6.0 
  It`s error When delete the Requests for Quotation 

  "A document was modified since you last viewed it (Purchase
  Order:xxx)"

  I think we need to delete  the context['__last_update']

      def unlink(self, cr, uid, ids, context=None):
          purchase_orders = self.read(cr, uid, ids, ['state'], context=context)
          unlink_ids = []
          for s in purchase_orders:
              if s['state'] in ['draft','cancel']:
                  unlink_ids.append(s['id'])
              else:
                  raise osv.except_osv(_('Invalid action !'), _('Cannot delete Purchase Order(s) which are in %s State!')  % _(dict(purchase_order.STATE_SELECTION).get(s['state'])))

          # TODO: temporary fix in 5.0, to remove in 5.2 when subflows support
          # automatically sending subflow.delete upon deletion
          wf_service = netsvc.LocalService("workflow")
          for id in unlink_ids:
              wf_service.trg_validate(uid, 'purchase.order', id, 'purchase_cancel', cr)
          del context['__last_update']
          return super(purchase_order, self).unlink(cr, uid, unlink_ids, context=context)

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1027755/+subscriptions


Follow ups

References