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

odoo13 how to delete posted invoice completely?

Subscribe

Get notified when there's activity on this post

This question has been flagged
4 Replies
15672 Views
Avatar
JC

How can I remove/delete the invoice that was posted with the wrong invoice number in odoo13?

0
Avatar
Discard
Niyas Raphy (Walnut Software Solutions)

Thinking out of the box and making data corrupted is good way that you need to implement in your business ? Nice...

Robilife

I found a solution that works for me.

i set the account move to draft then i create an action server with the python code below 

records.with_context(force_delete=True).unlink()

Muhammad Saeed Sher Khan

Yes, You cannot delete a posted invoice, But you can cancel the invoice which helps to remove the entry from accounts.

Avatar
Vishnu Ramesh
Best Answer

You cannot delete a posted invoice, But you can cancel the invoice which helps to remove the entry from accounts.

3
Avatar
Discard
Hussein Kadweka Katana

Why is it whn you override the delete method in odoo the action takes too long

Avatar
Hussein Kadweka Katana
Best Answer

I tried overriding the delete method in odoo but the system takes too long to complete the action...I used the below code 


def delete_from_db(self):
for rec in self:
rec.release_number.with_context(force_delete=True).unlink()
return rec.unlink()
0
Avatar
Discard
Avatar
Do Incredible
Best Answer

You can install the account_cancel module. It will allow you to configure your journal(s) with the possibility to cancel entries (a new checkbox will be visible on the journal configuration).

Then, you will be able to cancel an invoice (the status will then be "canceled") and as soon as the invoice is canceled you can set it back to draft.

But as soon as an invoice has been confirmed, you won't be able to delete it permanently (the invoice number stays reserved for that invoice)

This is a totally wrong method but if you still want you to have no option then you will go with below option 

1- First install an account_cancel module.


2- Go to file:

https://github.com/odoo/odoo/blob/13.0/addons/account/models/account_move.py#L1596

Note: we recommend create a save to file before.

2- Comment the function unlink like:

def unlink(self):
    for move in self:
        # if move.name != '/' and not self._context.get('force_delete'):
        #    raise UserError(_("You cannot delete an entry which has been posted once."))
        move.line_ids.unlink()
    return super(AccountMove, self).unlink()


3- Go to View and Remove the Invoice.

I hope to help you!

0
Avatar
Discard
Niyas Raphy (Walnut Software Solutions)

How can you recommend this way to comment out and do it, if odoo is blocking the deletion of posted entries it has its own reason, better go with standard solution of cancelling the invoice and then delete. And in v13, there is no module account_cancel, it is part of the account module itself

Do Incredible

Yes @Niyas Raphy Your Are Right we all have to go standard and this is totally wrong let me edit my Ans and Add this is on the ans

JC
Author

People that can only follow standard are not thinking out of the box :-P

Avatar
RACHEL NAMWONE
Best Answer

Hello, I can't seem to find the Account cancel module. What do I need to do? Thanks

0
Avatar
Discard
Ray Carnes (ray)

Niyas commented below "And in v13, there is no module account_cancel, it is part of the account module itself. " You need to set the Invoice to draft first.

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