hello

The warning module just give the warning and keep flow continue to the user.

example: 
    def onchange_partner_id(self, cr, uid, ids, part):
        if not part:
            return {'value':{'partner_address_id': False}}
        warning = {}
        title = False
        message = False
        partner = self.pool.get('res.partner').browse(cr, uid, part)
        if partner.purchase_warn != 'no-message':
            if partner.purchase_warn == 'block':
                raise osv.except_osv(_('Alert for %s !') % (partner.name), 
partner.purchase_warn_msg)
            title = _("Warning for %s") % partner.name
            message = partner.purchase_warn_msg
            warning = {
                'title': title,
                'message': message
                }
        result =  super(purchase_order, self).onchange_partner_id(cr, uid, ids, 
part)
        
        if result.get('warning',False):
            warning['title'] = title and title +' & '+ 
result['warning']['title'] or result['warning']['title']
            warning['message'] = message and message + ' ' + 
result['warning']['message'] or result['warning']['message']
            
        return {'value': result.get('value',{}), 'warning':warning}


thanks
mra




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=51381#51381

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman2/listinfo/tinyerp-users

Reply via email to