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
    • Estate 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
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

ODOO 14 Community: how can I delete an invoice?

Subscribe

Get notified when there's activity on this post

This question has been flagged
5 Replies
11298 Views
Avatar
Joan

Hello, 


INTRODUCTION

You can jump directly to the question if you want...

We are evaluating Odoo 14 as our accounting program as we have an old system that works, but needs a complex architecture (One data server (linux), one license server (windows) and then n client computers).  This old system starts to fail and we are willing to migrate to a newer thing.

I'm a programmer, not an accountant, but I'm in charge of validating the options we are thinking about.

Then, we are thinking on a dockerized Odoo system inside a NAS, which could be accessed from everywhere using a simple web navigator.


THE QUESTION ITSELF:

Our accountant department manager is telling me she can't delete invoices.

Of course this is not a normal practice, but in case of making a mistake she would like to be able to do it.

She is aware she can set the invoice to draft again and then update it, but in case it's the last invoice before closing the year (or any other accounting milestone), she would like to remove it from the system, of course, before being paid...

This should be able to be done in both invoices to customers and from vendors.


How can this be done?


As an example (now I have only 3 invoices in the demo system) 2 in vendors and one in customers.

I have both vendor invoices cancelled and not paid, but even that, I can't remove those invoices from the system.

In the invoice I have in the customers section, it sports a draft status and it's neither paid, but can't be deleted.


In all cases the message that appears is:



User Error

You cannot delete an entry which has been posted once.



Notice I'm trying to do this from the administrator account, so it must not be a privileges issue.


Thank you very much in advance.
1
Avatar
Discard
Joan
Author

It works, thanks you very much!


I guess then we should go through the journal items and do the same with the elements that are related to that invoice...


Is that right?  can this be automated?


Thank you very much again.

Sandhya Elizabeth

Hello, i tried doing this but I am unable to delete.

Odoo Mates

See: https://www.youtube.com/watch?v=Avo42KGbkKA

Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Best Answer

Once the invoice is validated/posted, it cannot be deleted. But there is still an option to delete the invoice forcefully.

Follow the following steps:

1) Enable developer mode and click on Edit Action:


2) Add 'force_delete': True in the Context Value field which will allow you to delete the invoice:



8
Avatar
Discard
Chris TRINGHAM

This seems rather dangerous, as it would allow any invoice to be deleted, overriding the validation in Odoo.

Sudhir Arya (ERP Harbor Consulting Services)

This is just a temporary option to delete the invoice. Of course, it is dangerous if the user deletes the wrong invoice by mistake. So the user will have to be careful before deleting the invoice.

Chris TRINGHAM

In which case it might be better to create a new menu option for Force Delete with only the Administrator authorized to use it.

Avatar
Thoutmos Sanebankh
Best Answer

As    Sudhir Arya  said :

  but  better  to  put True  in  quote:    'force_delete': 'True' 

my old context value:

{'default_move_type': 'out_invoice'  }

my new context value:

{'default_move_type': 'out_invoice' ,  'force_delete': 'True'}

This  worked for  me.


1
Avatar
Discard
Avatar
Carlo Dischler
Best Answer

I also changed the context value and seems like i had an typo in it.

Now i'm not able to open the accounting module any more. Where can i change this context entry from technical settings menu? Or how can i access the "Edit action" window when not able to open the needed page?

0
Avatar
Discard
Josep Anton Belchi Riera

You can use the menu (in debug mode) Settings / Technical / Actions / Actions

Carlo Dischler

I can find the action there but I can't find a way how to edit the Context field there. Any idea?

Avatar
SOMEONE
Best Answer

Hello! I did this , and cannot acces invoice view . 

ERROR:

Traceback:
Error: Expected "}", got "(end)"
Please let me know how I can fix this ? 
0
Avatar
Discard
Avatar
Bx6MbVtUu1uFbjAI5fwE
Best Answer

I experienced the same as Elizabeth Sandhya. Took me a while to figure out what the problem was, therefore maybe for future reference see below.

In step 2 of the answer of Sudhir Arya, there is a discrepancy between the red text and the screenshot itself. Basically there were two options that worked for me: 'force_delete': 'True' (4 quotes) was succesful, and also 'force_delete': True (2 quotes). Not sure which is the official method, but both worked for me.

However the key to making this work for was to go in two steps: First add the "force_delete" stuff and save. Than "leave" the invoice by restarting the accounting menu and open the invoice again. If I skipped this intermediate step, the system would not allow me to fully delete the invoice.

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
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
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

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

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now