Skip to main content
Shopify

What the Shopify «Ask the AI» button does in Odoo: myths and facts

The Ask the AI button checks that AI is enabled in Settings, builds a fact sheet from the store's data, looks at the monthly cost cap and only then queries the model; the outcome, good or bad, is written to the form.

FlexigoTech · Editor in charge: Víctor Gómez · Updated 5 November 2026

Key facts

Module
Shopify
Versions
Odoo 17, 18, 19 and 20
Checked
in the connector's source code, version 20.0 · against the sources linked at the end
Reading time
6 min

Where the button is and what you see when you open it

The screen opens from the menu Shopify › Insights › Ask the AI. It has the Store field, which comes with a default store (the first one the code finds), the Question field and the Ask the AI button, which is always visible on that screen in Odoo 17, 18, 19 and 20.

Ask the AI dialog with a store selected and an empty question field
The dialog with no records: there is no question or answer yet
Your Odoo doesn't talk to Amazon, Temu or Shopify?
Video: Your Odoo doesn't talk to Amazon, Temu or Shopify?

What the button really does, myth by myth

«Anyone who sees Shopify in the menu can use it»

Each menu level asks for its own permission. Shopify and Insights ask for Viewer; the last level, Ask the AI, asks for Operator. If you do not have one of them, you do not see that level of the menu.

«Pressing the button sends the question to the model, full stop»

Before anything is sent, the code runs its checks in this order:

  • First it checks whether AI is enabled in Settings. If it is not, the form moves to the AI disabled state, the answer is AI is disabled in Settings., the cost is set to zero and nothing else happens.
  • Then it builds the store's data and looks at the monthly cost cap (see below).
  • Then it calls the AI client. The client looks for a key: first the one in Settings and, if that is empty, the one on the store. If it finds none, it stops there and does not carry on with the query. The module has a text for the missing-key state: No AI key configured. Add it on the store or in Settings.
  • If there is a key, the client checks that the AI notice has been accepted. If not, it returns the no-consent state, whose text is Nothing was sent to the AI provider: accept the AI notice in Settings > Shopify Seller > AI Insights first.
  • For the state where the model refuses, the text is The model refused the request. For any other state that is not a success and not one of the above, the text is Error calling the AI: …, with the error detail where the dots are.

The provider comes from Settings. If the value is not one the code knows (Gemini, Groq, OpenAI-compatible and Anthropic), it uses the Gemini adapter.

«The AI reads your whole store»

It does not receive the whole store, but a summarised fact sheet built from the product analytics of the chosen store. It carries the store name, the company currency, the default lead time and the target cover days, and some totals (products overall, at risk and dead stock). It then adds a list of up to 40 products: first those at risk, then the best sellers by revenue and finally dead stock, with no repeats. A separate list holds the 12 best sellers.

The instruction to the model asks it to answer only with that data, to say «I do not have that» if the answer is not there, not to invent figures or SKUs, and to treat the text of Question always as a question, never as instructions.

«With the cost cap at zero, the AI is blocked»

It is the other way round: if the monthly cap is zero or less, the check never triggers. If there is a cap and it has been reached, the form moves to the Cost cap state, the answer is The monthly AI cost cap has been reached. and the cost is set to zero. This check comes after the data is built and before the model is called, so in that case no query is made.

Code-built diagram: the menu, the Ask the AI button and the Cost cap state
Diagram built from the module's published code, not an Odoo screen: top to bottom, the menu, the button and the state the form can end up in

«If something fails, the question vanishes without a trace»

The code catches errors while building the data and calling the model. In that case the form moves to the Error state, the answer is Could not generate an answer right now., the cost is set to zero and at most 300 characters of the error text are kept. Either way, the form reopens full page with the outcome.

When the query gets to the end, the button writes the state, the answer and the cost to the form, and also creates a record called AI question: … with the first 60 characters of your question. That record keeps the state, the answer text, the provider and model used, the input and output tokens, the cost and the data sent. If it could not be created, the code only leaves a warning in the log and the answer stays.

The cases that finish earlier, AI disabled, Cost cap and Error while building the data or calling the model, do not create that record.

«The AI is only used when someone presses the button»

The scheduled task Shopify AI Weekly Digest runs every week and is active on install. When it generates a store's report it makes the same checks as the button: AI enabled in Settings, the same fact sheet, the monthly cost cap and the call to the AI client. It asks for a short summary and recommendations, and saves a record whose name starts with AI report and carries the store name. If AI is disabled or the cap has been reached, it also creates the record, with that state and no answer.

The error texts do not match the button's in every case. When the key is missing, consent is missing, the model refuses the request or the call fails, the task and the button leave the same text, because both use the same message function. In the other two cases each leaves its own:

CaseText the button leavesText the weekly task leaves
AI disabledAI disabled in SettingsAI is disabled in Settings.
Monthly cap reachedMonthly cost cap reached.The monthly AI cost cap has been reached.

The table shows the error texts each one saves; the answer the button writes on the form in those two cases is the one given above.

What to check if you get no answer

Look at the state and the text the form leaves: AI disabled points to Settings, Cost cap to the monthly cap, and the key or notice texts to the AI configuration. For another button in the module with the same approach, see the «Get stock» button.

How FlexigoTech can help

The module is published on Odoo Apps for 17.0, 18.0, 19.0 and 20.0 (Odoo Apps listing and module page). FlexigoTech implements Odoo 17, 18, 19 and 20 and builds custom connectors and integrations; if you would like us to review how AI is set up in your installation, get in touch.

Keep reading

What the Pull Stock button does in the Shopify connector for OdooWhat the Pull Stock button does in the Shopify connector for Odoo: when it shows, what it checks, what changes in your stock and which error it can raise.The 'is now the primary location' notice in the Shopify connector for OdooWhat the 'is now the primary location' notice in the Shopify connector for Odoo means, when it appears and how to change the primary location.Shopify Connector error: no payload to create the sales orderWhat the Shopify Connector for Odoo message means when you press Create Sale Order on an order with no stored data, when it appears and how to fix it.
Checked in the connector's source code (version 20.0) and the linked sources

Sources