~unifield-team/unifield-wm/us-927

« back to all changes in this revision

Viewing changes to msf_custom_settings/stock_picking.py

  • Committer: matthieu.choplin at msf
  • Date: 2012-08-17 14:50:02 UTC
  • mto: This revision was merged to the branch mainline in revision 1116.
  • Revision ID: matthieu.choplin@geneva.msf.org-20120817145002-kuhewnsw7njvjapd
uf-1346: hide the delete button when the doc are not in draft state and remove the method allow_cancel of picking because the method was already done by PMA. The delete button is now a button of type 'object' for the modified doc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        context.update({'picking_screen': True, 'from_so':True})
37
37
        return super(stock_picking, self)._hook_log_picking_modify_message(cr, uid, ids, context=context, message=message, pick=pick)
38
38
 
39
 
    def allow_cancel(self, cr, uid, ids, context=None):
40
 
        res = super(stock_picking, self).allow_cancel(cr, uid, ids, context=context)
41
 
        for pick in self.browse(cr, uid, ids, context=context):
42
 
            if not pick.sale_id:
43
 
                return res
44
 
            else:
45
 
                raise osv.except_osv(_('Error'), _('You cannot cancel picking because it comes from a Field Order !'))
46
 
        return True
 
39
# I delete the method below because the mecanism was already done by PMA
 
40
#    def allow_cancel(self, cr, uid, ids, context=None):
 
41
#        res = super(stock_picking, self).allow_cancel(cr, uid, ids, context=context)
 
42
#        for pick in self.browse(cr, uid, ids, context=context):
 
43
#            if not pick.sale_id:
 
44
#                return res
 
45
#            else:
 
46
#                raise osv.except_osv(_('Error'), _('You cannot cancel picking because it comes from a Field Order !'))
 
47
#        return True
47
48
 
48
49
    def _vals_get_bool(self, cr, uid, ids, fields, arg, context=None):
49
50
        '''