New decorators are just mapper around the new API. The decorator are mandatory as webclient and HTTP controller are not compliant with new API.
api namespace decorators will detect signature using variable name and decide to match old signature or not.
The @api.returns guaranties to returned value. It will return a RecordSet of specified model based on original returned value. If an old API function calls a new API function it will automatically convert it into a list of ids.
The @api.one loops automatically on Records of RecordSet for you. Self is redefined as current record:
In @api.multi Self will be the current RecordSet without iteration. It is the default behavior:
The @api.model will convert old API calls to decorated function to new API signature. It allows to be polite when migrating code.
The @api.constrains will ensure that decorated function will be called on create, write, unlink operation. If a constraint is met the function should raise a openerp.exceptions. Warning with appropriate message.
The @api.depends will trigger the call to the decorated function if any of the fields specified in the decorator is altered by ORM or changed in the form: