Here is the example.
# An old way
def copy(self, cr, uid, id, default=None, context=None):
raise osv.except_osv(_('Warning!'), _('You are not allowed to duplicate this!!!'))
# for new api
def copy(self, default=None):
raise UserError(_('You are not allowed to duplicate this!!!'))
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 6/10/16, 6:28 AM|
|Seen: 333 times|
|Last updated: 6/12/16, 9:14 AM|