[REF] contract - pass self instead of relying on @api.model - #1497
anthonissen-a wants to merge 1 commit into
Conversation
|
Hi @sbejaoui, @florian-dacosta, |
6b89846 to
73138e4
Compare
qgroulard
left a comment
There was a problem hiding this comment.
Great changes 👍
This is backward compatible and it highly improves the extensibility of get_next_invoice_date and get_next_period_date_end for other OCA modules and custom code.
73138e4 to
527685d
Compare
|
This PR has the |
sbejaoui
left a comment
There was a problem hiding this comment.
let see what @pedrobaeza thinks obout this
pedrobaeza
left a comment
There was a problem hiding this comment.
I don't think it's a good idea, as this is mixing both approaches: if you use self, then you should use it for all, but if there's going to be options for still passing arguments, then keep it @api.model, and you will get a predictive behavior, as having some arguments that if omitted, are taken from self implies some kind of "black magic".
Replaces
@api.modelmethods with instance methods across contract methods to improve extensibility and allow overrides to access record data inself.Method parameters are now optional to ensure full backward compatibility.