can you please tell me how to override the force_assign method in stock module, in model stock.picking. Especially I want to know how to use the @api.returns decorator in the case of overriding the force_assign method. force_assign is a small method in stock module of object stock.picking. I am using odoo v9. In case, you need I have copied the code of force_assign here.
The overriding method should just simply raise a UserError:
def force_assign(self,cr,uid,ids,context=context)
"""changes state to assigned
@return:True
"""
res=self.write(cr,uid,ids,{'state':'assigned'},context=context)
self.check_recompute_pack_op (cr,uid,ids,context=context)
return res