Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2546 Visualizzazioni

what if i want to create an Automation Rule for Create only? i can see there is a On Save trigger but it works on both Create and Write (Update). I want it to Execute Code on Create only. it was present in earler versions, why is missing in 17? 

how to implement it specifically for On Create not Write (Update).


regards


if possible, please help on this too...

https://www.odoo.com/forum/help-1/function-to-get-last-or-greatest-value-241479


Avatar
Abbandona
Risposta migliore

 It is possible to use the old triggers (including Create) by making a small change to the XML to use the Selection widget:



This trigger my be removed in future, so the official workaround is to use “On Save” and then select creation date as the trigger (labelled as “when updating”) – because this will never change.


Full details including an option with Studio here:  https://odootricks.tips/automation-rules-odoo-17

Avatar
Abbandona

Just for reference
This can be done with no coding as well in the developer app
Click on the Field - go to field properties - widget - choose "Selection (selection)"

the question is why "base_automation_trigger_selection" doesn't show all the options?

Yes, good question Ricardo. It seems that they have simplified the interface and lost some functionality in doing that. Maybe someone can create a simple add-on to give us back what we had before!

Autore

thank you @Chris TRINGHAM for help.
will check this and give feedback. i am struggling for a Compute field which require much code ('much' for me) at here

https://www.odoo.com/forum/help-1/add-compute-field-to-calculate-employee-loan-amount-244620

please help for this too. i will be much grateful.

regards

Hi Ahmed (akaSmithJohn45)

I (try to) answer questions that will be of general interest, not solve specific problems for people free of charge. Maybe you should hire an Odoo developer?

Autore

thank you @Chris TRINGHAM

i am trying my best and will continue struggle to achieve this, if you have seen on given link what i already have done yet.

regards

Risposta migliore

Hi,

In Odoo 17 actually the On create Method is deprecated , They prefer to use On save instead of On create.


The above screenshot is from Odoo addons. In that they are specifying that On create is depricated in odoo 17


Hope it helps

Avatar
Abbandona

Yes, it still works, but may be removed at some point.

Post correlati Risposte Visualizzazioni Attività
2
apr 25
3207
1
feb 24
2776
4
giu 25
1353
4
mag 25
1662
2
mag 25
4916