Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Trigger Odoo Google Spreadsheet by Schedule, not onOpen

By
Moises Garcia Marquez
on 11/24/16, 11:02 PM 90 views

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'); }}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/24/16, 11:02 PM
Seen: 90 times
Last updated: 11/25/16, 12:36 AM