Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Compute and Onchange after create

by
ClosingAp Open Source Integrators Europe, LDA, Daniel Reis
- 04/08/2023 16:33:50
What I usually do is to create a specific method to be used by the API.
It will create the record and then call the relevant onchanges.

I find that often there is more than that, and this pattern is convenient:
You may also need to set some sane defaults, run specific checks, do some data conversion cleaning, or even some automation.


On 04/08/2023 15:28, Fernando La Chica wrote:
I am building an API in Odoo 16.0. As we know, there are fields that can be computed (compute) and others that change their value (onchange) depending on the change in another one. Well, what I need to know is if there is a standard way for after creating the object ("model.create") to launch all these computations without having to worry about calling these methods

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


--
DANIEL REIS
MANAGING PARTNER

M: +351 919 991 307
E: dreis@OpenSourceIntegrators.com
A: Avenida da República 3000, Estoril Office B, 3º Escr.34, 2649-517 Cascais

Reference