Skip to main content
Octopia (Cdiscount)

Octopia Connector: ‘Set a cancellation reason first.’

The message Set a cancellation reason first. appears when you press Request Cancellation on an outbound shipment whose Cancellation Reason field is empty. Fill in that field on the shipment form and press the button again.

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

Key facts

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
4 min

What the message means and when it appears

The message Set a cancellation reason first. is an error: the action stops. It appears when you press the Request Cancellation button on an outbound shipment form, and only if the Cancellation Reason field of that shipment is empty. That is the literal condition in the code: if the reason has no content, the module stops there. As soon as the field has content, that check is passed.

The message is in the published code of Odoo branches 17, 18, 19 and 20.

Diagram built from code, not an Odoo screen: the Octopia, Fulfillment, Outbound Shipments menu; the Request Cancellation button; the Cancellation Reason field; and the message Set a cancellation reason first.
Diagram built from the module's published code (Odoo 17, 18, 19 and 20), using the labels of the original code: menu, button, field and message.

The code checks the reason first, before getting the module's client or passing it anything. If you see the message, the action has stopped there and nothing it was going to change has been saved on that shipment.

48 business hours to accept each Cdiscount order. Do it in Odoo
Video: 48 business hours to accept each Cdiscount order. Do it in Odoo

Before you press the button

These checks tell you whether you are about to hit the message, and why.

  • Open the shipment form from the menu Octopia › Fulfillment › Outbound Shipments. If you cannot see the Octopia branch of the menu, you are missing the Octopia User permission.
  • Check that you can see the Request Cancellation button. With default values it is visible. It is hidden when the Status field of the shipment is Shipped, Delivered or Cancelled, or when the Cancellation Status field already has a value. That condition is the same in Odoo 17, 18, 19 and 20.
  • Find the Cancellation Reason field on the Outbound Shipments form. It is the field the code looks at.
  • Check whether the field has content. If it is empty, the message will appear as soon as you press the button.
  • Enter the reason before pressing. The check that raises this message is only that the field is not empty.

When you press the button and when you see the message

  • Press Request Cancellation. Odoo asks for confirmation with the text Request cancellation of this outbound shipment?.
  • If the reason is empty, Set a cancellation reason first. appears and the action stops. The code goes through the shipments it is working with and stops at the first one that has no reason.
  • Close the notice, go back to the form and fill in Cancellation Reason.
  • Press Request Cancellation again and confirm.

Depending on the language of your Odoo, the message looks like this:

Diagram built from code, not an Odoo screen: the text Set a cancellation reason first. with its translations into Spanish, German, French, Italian and Portuguese.
Diagram built from the module's published translations: in Spanish, Establezca primero un motivo de cancelación.; in German, Legen Sie zuerst einen Stornogrund fest.; in French, Définissez d'abord un motif d'annulation.; in Italian, Imposta prima un motivo di annullamento.; in Portuguese, Defina primeiro um motivo de cancelamento.

What the button does once the reason is there

Once the check is passed, the method follows this order for each shipment:

  • It gets the module's client from the shipment's account.
  • It passes that client the cancellation request, with the shipment's external identifier and the reason you entered.
  • It saves a value in Cancellation Status (the code writes Created) and, if the response it receives includes a reference for the request, it saves that reference on the shipment too.

Because the button is hidden when Cancellation Status has a value, once a request has been saved you will no longer see the button on that shipment.

After requesting the cancellation

  • Open the shipment form again and check that Cancellation Status now has a value.
  • Check that the Request Cancellation button has gone from that shipment. That is expected, given its visibility condition.
  • If the shipment's Status is Shipped, Delivered or Cancelled, do not expect to see the button: it is hidden in those cases.

How FlexigoTech can help

FlexigoTech implements Odoo 17, 18, 19 and 20 and builds custom connectors and integrations. Octopia Connector is published on Odoo Apps for those four versions. It is a one-off purchase 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 synchronisation and emails you if it fails. If you would like to review your cancellation flow with us, get in touch.

Odoo Apps listing

Keep reading

What the Open Discussion button in Octopia Connector does: myths and factsWhat the Open Discussion button in Octopia Connector does in Odoo: when it shows, what it checks, what changes and which errors it gives, myth by myth.What the Submit to Octopia button does on promotions, step by stepHow the Submit to Octopia button works on Odoo promotions: when it shows, what it checks, what it changes and which warnings it can give.Declare to Octopia in Odoo: a step-by-step button checklistChecklist for the Declare to Octopia button in Octopia Connector: when it appears, what it checks, what it changes and the messages that can stop it.
Checked in the connector's source code (version 20.0) and the linked sources

Sources