Hello Jhony,
@api.one: Decorate a record-style method where self is expected to be a singleton instance. The decorated method automatically loops on records, and makes a list with the results. In case the method is decorated with @returns, it concatenates the resulting instances. Such a method:
@api.one
def method(self, args): return self.name
may be called in both record and traditional styles, like:
# recs = model.browse(cr, uid, ids, context)
names = recs.method(args)
names = model.method(cr, uid, ids, args, context=context)
@api.multi: Decorate a record-style method where self is a recordset. The method typically defines an operation on records. Such a method:
@api.multi
def method(self, args):
...
may be called in both record and traditional styles, like:
# recs = model.browse(cr, uid, ids, context)
recs.method(args)
model.method(cr, uid, ids, args, context=context)
@api.model: Decorate a record-style method where self is a recordset, but its contents is not relevant, only the model is. Such a method:
@api.model
def method(self, args):
...
may be called in both record and traditional styles, like:
# recs = model.browse(cr, uid, ids, context)
recs.method(args)
model.method(cr, uid, args, context=context)
For more details, Go through Doc.
Hope this will help you.
Thanks Mansi for your useful answer..., but i'm still confused with @api.model in definition what it means by "content is not relevant " ?? can you please explain?!
ok thnaks mansi now it's more clear to me. and yes you can upvote question if it is useful...