Skip to main content
Shopify

The Shopify Refresh Product Analytics scheduled action, run by run

The scheduled action Shopify Refresh Product Analytics runs once a day and is active on installation. On each run it goes through the active Shopify instances, recalculates each product's sales and leaves the result in Shopify › Catalog › Restock Plan.

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 17.0 and 20.0 · against the sources linked at the end
Reading time
5 min

The task and the screen it feeds

The scheduled action Shopify Refresh Product Analytics exists in every published branch of the module: 17.0, 18.0, 19.0 and 20.0. It runs once a day and is active on installation. In Odoo 17.0 it is also set to repeat without end. This is how the task works in Odoo 20.0.

You open its result from the menu Shopify › Catalog › Restock Plan. To see that menu you need the Viewer permission on the Shopify level and on the Catalog level: if you lack either one, you do not see that level.

Diagram made with code, not an Odoo screen: the scheduled action that runs once a day at the top and the Restock Plan menu below it
Diagram made with code from the module's published code (not an Odoo screenshot): the task, active on installation in Odoo 17.0, 18.0, 19.0 and 20.0, and the menu Shopify › Catalog › Restock Plan, with the English labels from the code.
Your Odoo doesn't talk to Amazon, Temu or Shopify?
Video: Your Odoo doesn't talk to Amazon, Temu or Shopify?

Timeline of one run

  1. On installing the module The task is active. In Odoo 17.0 it is set to repeat without end.
  2. Once a day Odoo launches Shopify Refresh Product Analytics, which runs the recalculation of product analytics.
  3. First check It checks that whoever runs it is an administrator. If not, it stops with Only an administrator can run this scheduled action. and nothing is calculated.
  4. Instance search It looks for the active Shopify instances. By default, up to one hundred instances.
  5. Instance by instance It goes through them one at a time. Each one is processed inside a block that catches errors: if one fails, the task discards the pending changes and moves on to the next.
  6. Reading sales For each instance it adds up, per product, the units sold in the last seven, thirty and ninety days, and the revenue of the last thirty. It only counts product lines from orders of that instance that are in one of the two states the code treats as sold.
  7. Products without sales It adds the products with an active binding to that instance, even if they have sold nothing, so that they get a row too.
  8. Calculation per product It works out velocities, days of cover, projected stock-out date and recommended quantity (details below).
  9. Saving If a row already exists for that instance and product, it updates it; if not, it creates one. Each row records when it was refreshed.
  10. End Once it has gone through every instance, the task finishes.

What it calculates for each product

  • Units and velocity. For each window (seven, thirty and ninety days) it stores the units sold and the daily velocity, which is those units divided by the days in the window. Revenue is only stored for the thirty-day window.
  • Planning velocity. This is the thirty-day one.
  • Stock. It takes the product's available quantity in the instance's company.
  • Days of cover. This is stock divided by planning velocity. If that velocity is zero, it is 9999 when there is stock and zero when there is none.
  • Projected stock-out date. It is only calculated if there is planning velocity and stock: it is today plus the whole days of cover.
  • Recommended quantity. If there is planning velocity, it multiplies that velocity by the sum of the instance's default lead time (zero if empty) and the target cover days (thirty if empty, and at least one), subtracts the stock, rounds, and never goes below zero. With no velocity, it stays at zero.
  • Mover class and restock state. The task fills these in too: the class from the thirty-day and ninety-day velocity, and the state from the stock, the velocity, the days of cover, the lead time and the target.
Restock Plan list with no calculated records, showing columns for instance, available quantity, velocity, cover, revenue, class and state, almost everything at zero
The Restock Plan list in a database with no calculated records: the columns for instance, available quantity, velocity, cover, revenue, class and state show no real data, almost everything at zero.

What to check if it does nothing

The code explains several cases in which the Restock Plan looks still or full of zeros:

  • The task is active. It is active on installation; check that it still is.
  • Whoever runs it is an administrator. If not, it stops with Only an administrator can run this scheduled action. before touching anything.
  • The instance is active. The task only goes through active instances, and with the task's own call the limit is one hundred.
  • There are sales or a binding. A product gets a row if it has lines from orders of that instance in the last ninety days, in the states the code treats as sold, or if it has an active binding to the instance. Otherwise the task does not create a row for it; if it already had one from an earlier run, it is not updated and keeps the values and the date of its last refresh.
  • Zeros can be correct. A bound product with no recent sales and no stock comes out with velocities, revenue and days of cover at zero. If it has stock but has not sold in thirty days, its cover comes out as 9999 and there is no stock-out date.
  • An instance may be failing. If an error is raised inside an instance, the task discards what is pending and moves to the next, so the others keep being processed.
  • Permissions to see it. Without Viewer on Shopify and on Catalog you do not see the menu, even if the task has run.

How FlexigoTech can help

FlexigoTech implements Odoo 17, 18, 19 and 20 and builds custom connectors and integrations, in case you need to adjust how your restocking is fed. The module is published on Odoo Apps for 17.0, 18.0, 19.0 and 20.0 (listing, module page). It is a one-off payment per version and needs the FlexigoTech Cloud subscription, Connector plan: €49 a month or €490 a year, excluding VAT. The connection goes through FlexigoTech Cloud, which stores the credentials encrypted, monitors the synchronisation and emails you if it fails.

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 17.0 and 20.0) and the linked sources

Sources