Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Purchases
  3. Purchase Safe Cancel v 19.0
  4. Sales Conditions FAQ

Purchase Safe Cancel

by Mahmoud Abd Elrazek
Odoo

$ 18.48

v 19.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Purchase (purchase)
• Invoicing (account)
• Discuss (mail)
Lines of code 27
Technical Name purchase_safe_cancel
LicenseOPL-1
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Purchase (purchase)
• Invoicing (account)
• Discuss (mail)
Lines of code 27
Technical Name purchase_safe_cancel
LicenseOPL-1
  • Description
  • License
PS
Purchase Safe Cancel
Odoo 19 • Purchase Control
Production ready

Block unsafe Purchase Order cancellation in Odoo 19.

Prevent cancelling Purchase Orders that still have net received quantities. Keep your inventory history clean and force a proper return workflow instead of silently cancelling already received orders.

Odoo 19 Purchase Inventory Safety Zero configuration
Just install it and keep using the standard Cancel button – the module protects you only when needed.
Cancel Purchase Order
PO00045 • Received items detected
Protected
⚠️ You cannot cancel this Purchase Order!
  • There are completed receipt/return operations linked to this order.
  • Some products still have a net received quantity.
  • Please create Return Transfers first, then cancel again.
Status Cancellation blocked

Why Purchase Safe Cancel?

In Odoo 19, it is possible to cancel a Purchase Order even if products have already been received. This can easily create confusion: the PO looks cancelled, but the stock is still in the warehouse. This module adds a safety layer without changing your normal workflow.

Problem
Cancelled PO, received stock

Buyers can cancel a Purchase Order after receiving goods. The PO disappears from the product purchase history, but the stock remains on hand. This breaks traceability.

Solution
Smart cancellation protection

The module checks each line of the PO. If any line still has qty_received > 0, cancellation is blocked and the user is guided to create a Return Transfer instead.

Result
Clean purchasing history

You only cancel Purchase Orders that have no remaining received quantities. Returns are handled properly and your stock and purchase history stay consistent.

Key behaviour & technical details

No new menus, no extra buttons – just a safe extension of the standard Cancel action.

How it behaves
  • Extends purchase.order » button_cancel().
  • If all lines have qty_received = 0, cancellation is allowed.
  • If any line has qty_received > 0, cancellation is blocked.
  • A clear message is shown to the user with:
    • Completed receipts/returns linked to the PO.
    • Products and their net received quantities.
Compatibility & installation
  • Compatible with Odoo 19 (Community & Enterprise).
  • Does not modify any core Odoo file.
  • Pure Python logic, no JavaScript, no view changes.
  • Simple installation:
    • Drop into your addons path.
    • Update Apps list.
    • Install Purchase Safe Cancel.
🧩 Depends on: purchase

Screenshots

Real Odoo 19 screenshots showing how Purchase Safe Cancel behaves in different scenarios.

Completed receipt linked to the Purchase Order

The incoming shipment for the Purchase Order is in Done state, showing the received quantities for each product.

Completed incoming receipt for Purchase Order
Purchase Order with non-zero received quantities

A standard Purchase Order where both lines have been fully received. In this state, the module will prevent cancellation until the quantities are properly returned.

Purchase Order with received quantities
Cancellation blocked with a clear error message

When trying to cancel a Purchase Order that still has net received quantities, the module blocks the action and shows a detailed message listing completed pickings and products with remaining received quantities.

Error popup blocking unsafe Purchase Order cancellation
Creating a Return Transfer for received products

The user opens the Return wizard from the receipt to send back the received quantities. This is the correct step required before cancelling the Purchase Order.

Return wizard for received products
PO cancelled after all quantities were returned

The Purchase Order has been fully returned and safely cancelled. All lines now show 0 received quantity, while the chatter keeps a clear history of the quantity updates.

Purchase Order cancelled after all quantities were returned

FAQ

A few common questions from functional consultants and end-users.
Does this module change how Receipts or Returns work?
No. Receipts and Return Transfers behave exactly as in standard Odoo. The module only validates whether cancelling the Purchase Order is safe based on net received quantities.
Can I cancel a PO after receiving and then fully returning all quantities?
Yes. Once all lines have qty_received = 0, the cancellation is allowed again and Odoo's standard cancellation logic is executed.
Does it modify stock quantities or moves?
No. It never touches stock quantities or moves. It only decides whether the Cancel action is permitted or not, and shows a clear message when it is not.
Is there any configuration needed?
No configuration is required. Install the module and it immediately starts protecting your Purchase Orders from unsafe cancellation.
© Purchase Safe Cancel — built for Odoo 19.
Developed by Mahmoud Abd Elrazek
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with