摘要: 1.检查业务逻辑中的错误,终止代码执行,显示错误或警告信息: raise osv.except_osv(_('Error!'), _('Error Message.'))示例代码: #删除当前销售单,需要验证销售单的状态 def unlink(self, cr, uid, ids, context=None): for rec in self.browse(cr, uid, ids, context=context): if rec.state not in ['draft']: raise osv.except_o... 阅读全文
posted @ 2013-07-22 21:46 cnshen 阅读(2878) 评论(0) 推荐(1) 编辑