Skip to main content
Amazon

What the «Run Return Stock Automation» button does in Odoo

The Run Return Stock Automation button goes through an account's Amazon returns that are not yet finished on the stock side and tries to receive them in Odoo there and then. It shows on the Accounts screen, but only someone with Manager (or Settings) access can run it. Odoo also does the same job on its own through scheduled tasks, so the button is for launching it by hand and reading the result.

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

Key facts

Module
Amazon
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 who can press it

Account records open from the menu Amazon › Configuration › Accounts. Each step asks for a permission: Amazon asks for Viewer, and Configuration and Accounts ask for Manager. If you lack the permission for a step, you do not see that step.

The Run Return Stock Automation button is on the Accounts screen, and its view puts no condition on it: it always shows, in Odoo 17, 18, 19 and 20.

Code-made diagram: the menu Amazon, Configuration, Accounts, the Run Return Stock Automation button and, to one side, the access message that can stop it
Code-made diagram based on the module (not an Odoo screen): the menu path, the button and the access message that can stop the action.

Seeing the button is not enough to run it. When you press it, the first thing the module does is check your access. If you belong neither to the Amazon connector Manager group nor to the Settings group, the action stops with this message: You need Amazon Seller Connector Manager (or Settings) access for this action. Ask a manager to grant Manager access. If you do have one of those groups, the module also checks that you can write to that account; if you cannot, the action stops as well. Either way it happens before anything starts, so no return is evaluated.

Code-made diagram of the button label in each Odoo language, with Run Return Stock Automation as the original text
Code-made diagram based on the module's published translations (not an Odoo screen): the button label in several languages.
Your Odoo doesn't talk to Amazon, Temu or Shopify?
Video: Your Odoo doesn't talk to Amazon, Temu or Shopify?

What Odoo does on its own before you press anything

The button is not the usual route: the same stock automation runs without anyone launching it. A few checkboxes on the Accounts record, Returns & Reviews tab, decide this:

  • Returns: auto-receive to stock, in the group Return Stock Automation (ON by default). It is ticked by default. Its help text reads: «Automatically creates and validates return pickings in Odoo for finalized Amazon returns.»
  • Enable returns sync, in the group Returns Import. It is also ticked by default.
  • Auto-create credit notes (opt-in). It is unticked by default. It is a separate automation: the button only goes through the stock part.

With those values, two scheduled tasks work, both active on installation:

  • Amazon SP-API - Sync returns, every 3 hours. After importing the returns report, if the receive-to-stock checkbox is ticked, it launches the stock automation on the lines it has just imported (if the import returns none, on the account's pending lines).
  • Amazon SP-API - Auto receive returns to stock, every 15 minutes. This task reaches the automation by both routes: it also goes through the returns sync and, in addition, for accounts with returns sync switched off and receiving to stock switched on, it runs the automation on the account without posting the summary on its record.

The button differs in three ways: you launch it, now; it passes no list of lines (it looks at the account's pending lines, up to the per-run maximum); and if the run is interrupted by an error, you see it on screen. Lines whose attempt ends neither as done nor as skipped are counted under With error.

A case: seeing the result without waiting for the task

Example Illustrative case: the company and its figures are made up to explain the flow.

Menaje Ribera is an invented shop that sells on Amazon and runs its back office in Odoo. Marta, who has Manager permission, wants to check that Amazon returns are already reaching stock, without waiting for the next pass of the scheduled tasks.

She goes to Amazon › Configuration › Accounts, opens the account record and checks on the Returns & Reviews tab that Returns: auto-receive to stock is ticked. She presses Run Return Stock Automation. When it finishes, a summary appears in the account's message history (chatter) with the account, the origin of the run and the counters Lines evaluated: …, Receipts done: …, Skipped: … and With error: ….

Marta reads that summary as a balance of the pass: how many lines were looked at, how many were received and how many were skipped or ended with an error.

What it checks and what it changes, in code order

  1. Access. It checks that you belong to the Amazon connector Manager group or the Settings group and, after that, that you can write to the account. If either fails, it stops without touching anything.
  2. Summary header. For each account it prepares a text that starts with Auto stock returns execution finished., followed by Account: … and Source: …, which here shows that the run is manual and not from the scheduled task.
  3. The checkbox. If Returns: auto-receive to stock is unticked, it adds Auto stock returns is disabled in account settings., records the result, posts it on the account and ends without touching any line.
  4. Which lines it looks at. If it is ticked, it searches for the account's return lines whose stock sync is not shown as finished. When the run comes from an import that returns lines, it is limited to them; the button passes no list. It orders them from the most recent return request date to the oldest and keeps a maximum per run: 300 if no limit is defined.
  5. Line by line. For each one it tries to receive it into stock, without forcing anything. If the outcome is that it was done, it adds to Receipts done; if it was skipped, to Skipped; any other outcome counts as With error.
  6. Closing. It adds the four counters to the summary, saves the text as the run's status and posts it in the account's history.

Which errors you may see and what to do

  • The access message (You need Amazon Seller Connector Manager (or Settings) access for this action. Ask a manager to grant Manager access.): it appears when you press the button without being in the Manager group or the Settings group. Ask a manager to give you that access, as the message itself says.
  • No write permission on the account: even with one of those groups, the module then checks that you can write to that account and, if you cannot, the action stops as well. Review your permissions on the account with whoever administers Odoo.
  • A run interrupted by an error: the module adds an Error: … line to the summary, records it and posts it on the account. Because you launched the action by hand, the error is also raised again and you see it on screen. In automatic runs it is not raised again: the summary is recorded.
  • Lines with another outcome: when a line's attempt returns neither «done» nor «skipped», it is added to the With error counter in the summary.
  • Unticked checkbox: this is not a failure, but the button then does nothing beyond leaving the note that the automation is disabled.

What to take from the case

  • The button is a manual launcher for something Odoo already runs on its own with the default checkboxes.
  • Before pressing it, look at the checkbox on the Returns & Reviews tab.
  • The summary in the account's history is your result: lines evaluated, receipts done, skipped and with error.
  • With insufficient permissions nothing is evaluated.

What you need and how FlexigoTech can help

The module needs the FlexigoTech Cloud subscription, Connector plan: €49 a month or €490 a year, excluding VAT. It is published on Odoo Apps for Odoo 17, 18, 19 and 20; see the Odoo Apps listing or the module page to buy it.

FlexigoTech implements Odoo 17, 18, 19 and 20 and builds connectors and custom integrations. If you want to review how Amazon returns reach your warehouse in Odoo, get in touch.

Keep reading

Checked in the connector's source code (version 20.0) and the linked sources

Sources