Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3844 Näkymät

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
maalisk. 15
9913
1
tammik. 23
2696
3
toukok. 22
14725
0
heinäk. 21
2424
0
heinäk. 18
5009