Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
8083 Visualizzazioni

As far as I know, Odoo Studio only accepts data folder when importing a .zip module in Odoo Studio.

Is there a way to add a function and trigger it with a button in Odoo Studio without adding a module folder in the addons path?

Avatar
Abbandona
Risposta migliore

Hi Jean,

You can indeed only imports data (XML/CSS/SCSS) with a .zip module in Odoo.
There is no way to directly create a field and add a function to it with studio but what you want to do is possible though. 
You can first create your new field with Studio and add it on the form. Then create an automated action
with the trigger condition set to 'Based on Form Modification' and fill in your field name in 'On change Fields trigger'.
Set the 'Action To Do' to 'Execute Python code and then you can execute your custom Python code from there. 

Note: If you can code Python functions and need to do more advanced operations it might be worth it to code it in your own module though? It is easier to keep track off if you do a lot of modifications and you still have more flexibility than through the frontend (for example with Python libraries).


Regards,
Yenthe

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
4
lug 19
3562
2
gen 19
3222
1
dic 20
10802
1
mag 25
513
2
mar 25
956