跳至内容
菜单
此问题已终结
2 回复
2327 查看

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


形象
丢弃
最佳答案

 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

形象
丢弃

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!

编写者

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?

编写者

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

最佳答案

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

形象
丢弃

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

相关帖文 回复 查看 活动
2
4月 25
2922
1
2月 24
2521
4
5月 25
1191
2
5月 25
4289
1
3月 25
651