[FIX] doc: missing self params in examples

This commit is contained in:
xmo-odoo 2015-02-04 14:34:13 +01:00
parent 9831636ffb
commit d87aedb731
1 changed files with 3 additions and 3 deletions

View File

@ -498,7 +498,7 @@ Two decorators can expose a new-style method to the old API:
empty. Its "old API" signature is ``cr, uid, *arguments, context``:: empty. Its "old API" signature is ``cr, uid, *arguments, context``::
@api.model @api.model
def some_method(foo): def some_method(self, a_value):
pass pass
# can be called as # can be called as
old_style_model.some_method(cr, uid, a_value, context=context) old_style_model.some_method(cr, uid, a_value, context=context)
@ -508,7 +508,7 @@ Two decorators can expose a new-style method to the old API:
"old API" signature is ``cr, uid, ids, *arguments, context``:: "old API" signature is ``cr, uid, ids, *arguments, context``::
@api.multi @api.multi
def some_method(foo): def some_method(self, a_value):
pass pass
# can be called as # can be called as
old_style_model.some_method(cr, uid, [id1, id2], a_value, context=context) old_style_model.some_method(cr, uid, [id1, id2], a_value, context=context)
@ -525,7 +525,7 @@ return lists of ids, there is also a decorator managing this:
>>> @api.multi >>> @api.multi
... @api.returns('self') ... @api.returns('self')
... def some_method(): ... def some_method(self):
... return self ... return self
>>> new_style_model = env['a.model'].browse(1, 2, 3) >>> new_style_model = env['a.model'].browse(1, 2, 3)
>>> new_style_model.some_method() >>> new_style_model.some_method()