Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3853 Weergaven

Hi, Odoo community. I'm trying to schedule a trigger to run the formula entered in the Odoo-Google spreadsheet model. The problem is that the "onOpen" trigger is needed in the google script to generate the menu from which, as far as I know, is pulled the login data to interact with our Odoo database.

I'm trying to "extract" the logic, such as variables, out of the "onOpen" function so that it only generates the menu which is needed to interact with Odoo, and having another function triggered by schedule to run the formula.

This is the "onOpen" trigger for reference:

function onOpen() {

var ss = SpreadsheetApp.getActiveSpreadsheet();

var menuEntries = [{name: "Insert Selection Field", functionName: "menu_insertSelection"}, {name: "Settings", functionName: "menu_settings"} ]; ss.addMenu("Odoo", menuEntries);

var a1 = ss.getRange("O60"); if ((a1.getFormula().indexOf('oe_settings') > -1 && ScriptProperties.getProperty('url')) || a1.getFormula().indexOf('oe_call_signin') > -1){ a1.setFormula(""); }

if (ScriptProperties.getProperty('oe_call_settings')){ menu_settings(); ScriptProperties.deleteProperty('oe_call_settings'); }

if (ScriptProperties.getProperty('oe_call_signin')){ menu_settings([["username", "Username"], ["password", "Password"]]); ScriptProperties.deleteProperty('oe_call_signin'); }}

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 15
9915
1
jan. 23
2699
3
mei 22
14742
0
jul. 21
2427
0
jul. 18
5010