Community mailing list archives
Iterating recordset with @api.multi and without.by
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
LITEX Service Sp. z o.o., Michał Węgrzynek