Community Mailinglisten Archive
Re: Iterating recordset with @api.multi and without.durch
@api.multi is implied in this context AFAIK -- if you don't use another decorator, Odoo acts, as if you used @api.multi.
I would like to get a better feeling about when to use @api decorators and when not. I've read a lot about them, but I still don't have a good feeling. They are not very intuitive to me. I get the feeling that you have to use them on almost every method to control the behavior of self.
I am interested in the following example from account_invoice:
Here why don't we use @api.multi?
@api.onchange('amount_total') def _onchange_amount_total(self): for inv in self: if inv.amount_total < 0: raise Warning(_('You cannot validate an invoice with a negative total amount. You should create a credit note instead.')) Thanks, Dimitar--
Dimitar Epitropov | Odoo developer
+359 883 356 833
Consulting | Project Outsourcing | Software Development