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. Extra Tools
  3. Delete Section Only - Safe Section Deletion for Odoo 19 v 19.0
  4. Sales Conditions FAQ

Delete Section Only - Safe Section Deletion for Odoo 19

by Odoo DevHouse https://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse
Odoo

$ 30.00

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 • Invoicing (account)
• Discuss (mail)
Lines of code 95
Technical Name safe_section_delete
LicenseOPL-1
Websitehttps://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Invoicing (account)
• Discuss (mail)
Lines of code 95
Technical Name safe_section_delete
LicenseOPL-1
Websitehttps://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse
  • Description
  • License

Delete Section Only - Safe Section Deletion for Odoo 19

When deleting a section or subsection in Odoo 19, choose whether to delete just the section header or the section together with all its child lines. Perfect for accountants and financial users who need to reorganize journal entries, invoices, or any editable list view with section headers without losing existing line data.



Problem: Cascade Deletion of Sections

In Odoo 19, when you delete a Section or Subsection from any editable list view (journal entries, invoices, purchase orders, sales orders, etc.), Odoo automatically deletes all child lines inside that section - with no warning and no choice.

This creates a serious problem:

  • A single click can delete dozens or hundreds of lines unintentionally
  • No confirmation or alternative - the deletion is immediate and irreversible
  • Financial users lose valuable data when just reorganizing section headers
  • Time-consuming manual re-entry of deleted lines is required


Solution: Two-Choice Delete Dialog

This module intercepts the section deletion action and presents a confirmation dialog with two distinct options. Users can choose exactly what they want to do:

  • Delete Section Only - removes just the section header, preserving all child lines
  • Delete Section and Contents - removes the section AND all its child lines (original Odoo behavior)


Key Features
  • Two-Choice Delete Dialog: When deleting a section with children, choose between "Delete Section Only" or "Delete Section and Contents"
  • Preserve Child Lines: Delete just the section header while keeping all line items intact
  • Full Cascade Deletion: Original Odoo behavior still available when needed
  • Works on All Section Types: Supports both Sections and Sub-subsections
  • Odoo 19 Optimized: Built specifically for Odoo 19's SectionAndNoteListRenderer component
  • No Confirmation for Empty Sections: When a section has no children, deletion is immediate (no unnecessary dialog)
  • Works Everywhere: Journal entries, invoices, credit notes, purchase orders, sales orders - any editable list with sections
  • Clean Patch Implementation: Uses Odoo's native patching system - no core file modifications
How It Works

1. Section with Child Lines - Kebab Menu Delete

Click the kebab menu (three dots) on any section that contains child lines, then click Delete.

Section Kebab Menu - Odoo Interface

2. Delete Confirmation Dialog Appears

The module intercepts the deletion and shows a dialog with two clear choices.

Delete Confirmation Dialog - Odoo Interface

3. Delete Section Only - Child Lines Preserved

Choose "Delete Section Only" - the section header is removed, but all child lines remain in the list.

Section Only Delete Result - Odoo Interface

4. Delete Section and Contents - Full Removal

Choose "Delete Section and Contents" - both section header and all child lines are deleted (original Odoo behavior).

Delete Section and Contents - Odoo Interface
Delete Section and Contents - Odoo Interface

Installation & Configuration

  1. Install the Module: Install through Odoo Apps or manually copy to addons path
  2. Restart Server & Update: Restart Odoo and update the app list
  3. No Configuration Required: Module works immediately after installation
  4. Test: Open any journal entry or invoice with sections containing lines, click delete on a section - the dialog appears
Guide: Using Delete Section Only

Step 1: Navigate to an Editable List with Sections

Open any editable document that uses sections and line items, such as:

  • Journal Entry (Accounting -> Journal Entries -> Create/Edit)
  • Customer Invoice (Accounting -> Customers -> Invoices)
  • Vendor Bill (Accounting -> Vendors -> Bills)
  • Sales Order (Sales -> Orders -> Quotations)
  • Purchase Order (Purchase -> Orders -> Requests for Quotation)

Step 2: Locate a Section with Child Lines

Identify a section header (bold row with "Section" display type) that has line items indented below it.

Step 3: Click the Kebab Menu and Select Delete

Click the three dots () at the end of the section row, then click "Delete".

Step 4: Choose Your Option in the Confirmation Dialog

A dialog appears with two choices:

  • "Delete Section Only" - Keeps all child lines, removes only the section header
  • "Delete Section and its X line(s)" - Removes both section header and all child lines

Step 5: Verify the Result

After choosing:

  • If you chose "Delete Section Only" - the section header is gone, but all line items remain in the list
  • If you chose "Delete Section and Contents" - both the section header and all its children are removed
Pro Tip - When to Use Each Option

Delete Section Only - Use when reorganizing your document structure. You want to remove the section heading but keep all the accounting entries or product lines underneath. The lines will remain as free-floating items (belonging to no section).

Delete Section and Contents - Use when you need to completely remove a group of lines. For example, removing an entire category of expenses from a journal entry or removing a product category from a quotation.

Important Note

If you delete a section that has no child lines, no confirmation dialog appears - the deletion happens immediately (same as original Odoo behavior). The dialog only appears when there is at least one child line to protect.

Use Cases

Journal Entry Reorganization

Remove or rename section headers without losing the underlying accounting entries beneath them.

Invoice Restructuring

Reorganize invoice line grouping by adding/removing section headers without rebuilding the entire invoice.

Purchase Order Cleanup

Remove temporary section dividers without deleting the product lines that took time to add.

Sales Order Maintenance

Update quotation section headers without recreating product line configurations.

Template Management

Edit section-only templates without losing predefined line items.

Audit Trail Preservation

Preserve financial line history while removing organizational section headers.

Business Benefits

Prevent Data Loss

Prevent accidental deletion of valuable line data when removing section headers - save time and frustration.

Flexible Document Management

Reorganize document structure freely - remove sections without rebuilding the entire document from scratch.

User Confidence

Users no longer fear deleting sections - the confirmation dialog gives them control over the outcome.

Time Savings

Eliminate the need to re-add dozens or hundreds of lines after accidentally deleting a section.


Do You Need Assistance or Have a Feature Request?

Contact Support
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