Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How to delete an invoice after validation?

Odebírat

Get notified when there's activity on this post

This question has been flagged
invoice
23 Odpovědi
73301 Zobrazení
Avatar
s.salahcharki

How to delete an invoice after validation?

1
Avatar
Zrušit
Odoo Mates

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

Avatar
ClueLogics Technologies Pvt. Ltd.
Nejlepší odpověď

Hi After validation you can't delete any invoice , for that case you can do one thing ,just refund the invoice and then cancelit

you can consider it as deleted one as it will not be counted for invoice register

Thanks
Sandeep

4
Avatar
Zrušit
Avatar
ravi
Nejlepší odpověď

Hi, In order to Delete an invoice(which is validated), you have to edit the unlink method of account_invoice.

1) At first you have to install a account_cancel module.

2) Allow Cancelling Entries of corresponding journals.

3) After that you will have to cancel posted journal entries of that invoice.

4) then you are able to cancel the invoice. now you are ready to delete this invoice.

Go to Addons>>account module, open account_invoice.py file. find the unlink method which is same as:

def unlink(self, cr, uid, ids, context=None):
    if context is None:
        context = {}
    invoices = self.read(cr, uid, ids, ['state','internal_number'], context=context)
    unlink_ids = []
    for t in invoices:
        if t['state'] in ('draft', 'cancel') and t['internal_number']== False:
            unlink_ids.append(t['id'])
        else:
            raise osv.except_osv(_('Invalid Action!'), _('You can not delete an invoice which is not cancelled. You should refund it instead.'))
    osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
    return True

Just remove "and t['internal_number']== False" from if statement or change it to "and t['internal_number']== True", and save it. after doing it you have to restart the openerp server. Now go to admin and delete the canceled invoice, it will work perfectly.

There is also an another trick, which will work every time.

In account_invoice.py in the 'action_cancel' method

self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})

just replace this code with below one:

self.write(cr, uid, ids, {'state':'cancel', 'internal_number':False ,'move_id':False})

11
Avatar
Zrušit
Avatar
Ray Carnes
Nejlepší odpověď

If the Invoice has not been paid, you can CANCEL it.

Only do this if you are sure the Invoice has not been sent to your Customer/Supplier.

6
Avatar
Zrušit
s.salahcharki
Autor

thank you very much for your answer, but how can I remove it

Ray Carnes

Also - if you unreconcile the payments to reopen it, you can cancel an invoice previously recorded as paid.

Gopakumar N G

@Bista Solutions, I have unreconciled the payments and tried to re-open the invoice but. it's still in PAID state. This is in V7.

Agustin Ruiz Nattero

Thats right Ray, it must be very sure to do this.

Here is a few steps to make this possible.

https://www.odoo.com/forum/help-1/question/how-to-delete-a-validated-invoice-in-the-online-odoo-version-125118

Avatar
Jose Carlos Ramos Carmenates
Nejlepší odpověď

How to delete an invoice after validation? On Odoo V10 (version 10)

1- To install a account_cancel module.

2- Go to file:

sudo nano /usr/lib/python2.7/dist-packages/odoo/addons/account/models/account_invoice.py

or:

addons/account/models/account_invoice.py

Note: I recommend create a save to file before.

2- Comment the function unlink like:    

    @api.multi        
def unlink(self):
        #for invoice in self:
        # #if invoice.state not in ('draft', 'cancel'):
        # # raise UserError(_('You cannot delete an invoice which is not draft or cancelled. You should refund it instead.'))
# #elif invoice.move_name:
        # # raise UserError(_('You cannot delete an invoice after it has been validated (and received a number). You can set it back to "Draft" state and modify its content, then re-confirm it.'))
return super(AccountInvoice, self).unlink()


3- Go to View and Remove the Invoce.


I hope help you!

Jose Carlos Ramos Carmenates

3
Avatar
Zrušit
Hamza rana

Thanks man. This was the best method. I was trying to figure this out for like 2 months.

Really appreciated.

Avatar
Cyril Gaspard (GEM)
Nejlepší odpověď

Hi,

use a refund for that.

bye

1
Avatar
Zrušit
Avatar
Agustin Ruiz Nattero
Nejlepší odpověď

 Here is my response to the same issue with a few steps to make this possible., without install any module, or addon

https://www.odoo.com/forum/help-1/question/how-to-delete-a-validated-invoice-in-the-online-odoo-version-125118

0
Avatar
Zrušit
Avatar
vim24
Nejlepší odpověď

You can set the sales journal to allow canceling entries. by going to Configuration > Journals. Then you can cancel the invoice to remove any journal entries and the invoice will appear grayed out in your list. OR you can refund it if thats more applicable to the particular situation.

However, you shouldn't be able to delete the record completely from OpenERP, once it has been validated. Full deletion would not be fantastic accounting practice as there wouldn't be any traceability :)

Hope that helps.

0
Avatar
Zrušit
Claudiu Dominic Bolonyi

Hi! What if all you entries that you made until the moment you want to delete them are for test purpose only. How can you delete those entries (invoice, payments...) ?

vim24

If you are just testing, maybe its worth creating a separate database for testing purposes and keeping all your production entries in a real one. If its too late and you HAVE to remove entries you can do this manually by deleting them from postgres, but this is not advisable if there is an alternative.

Jaime

I have faced the same problem, and I have deleted all records from account_invoice* tables in openerp database. That data were not for testing, is just a bad operation For example, I have created a proforma invoice, then I needed to change the price but proforma does not allow to change it. I tried to refund, but new records were created. After some trials to cancel an invoice, I got 6 new invoices in my accounting system. So the only solution was to delete data from database.

Avatar
Piotr Kaczmarski
Nejlepší odpověď

Hello,

I stuck at step 4 ... In my installation (openerp 7, python 2.6, centos) following fragment of account_invoice.py code is little different, eg:

def unlink(self, cr, uid, ids, context=None):
         if context is None:
             context = {}
         invoices = self.read(cr, uid, ids, ['state','internal_number'], context=context)
         unlink_ids = []

         for t in invoices:
             if t['state'] not in ('draft', 'cancel'):
                 raise openerp.exceptions.Warning(_('You cannot delete an invoice which is not draft or cancelled. You should refund it instead.'))
             elif t['internal_number']:
                 raise openerp.exceptions.Warning(_('You cannot delete an invoice after it has been validated (and received a number).  You can set it back to "Draft" state and modify its content, the        n re-confirm it.'))
             else:
                 unlink_ids.append(t['id'])

         osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
         return True

     def onchange_partner_id(self, cr, uid, ids, type, partner_id,\
             date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False):
         partner_payment_term = False
         acc_id = False
         bank_id = False
         fiscal_position = False

There is no such thing like: t['internal_number']== False. I tried delete this line, modify content sth, but installation just hangs.

Also, I can modify account_invoice.py content using second method, openerp working, but with no effect (invoice still cant be deleted). In log i have following output:

Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/openerp-7.0_20130908_231053-py2.6.egg/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130908_231053-py2.6.egg/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130908_231053-py2.6.egg/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130908_231053-py2.6.egg/openerp/addons/sale/sale.py", line 1012, in unlink return super(account_invoice, self).unlink(cr, uid, ids, context=context) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130908_231053-py2.6.egg/openerp/addons/account/account_invoice.py", line 474, in unlink

Any ideas will be welcomed :)

0
Avatar
Zrušit
ravi

now for this situation you just comment the elif part. after that don't forget to restart the openerp server......

Avatar
Greater Global - HK
Nejlepší odpověď

2) Allow Cancelling Entries of corresponding journals.

Hi, I am stuck on step 2. I have installed account_cancel module.

Yet, in settings-->>accounting-->>configuration -- I do not have any check options relating to journals. I have unistalled and re-installed account_cancel module, updated it, looked at the technical features tab etc and nothing.

It simply isn't showing up under settings. I can't select "cancel entries of corresponding journals" because I cannot find it!

any advice/ thoughts please? Very much appreciated.

0
Avatar
Zrušit
Ray Carnes

What you are looking for is a checkbox on the Journal form view. Accounting --> Configuration --> Journals -> Journals. Open the Journal for which you want to allow cancelling, and make sure "Allow Cancelling Entries" is checked.

Greater Global - HK

Hi Ray, thank you for taking the time to answer.

That option isn't showing. I cannot access journals under configuration. I have since discovered that the online edition doesn't allow for modules to be added / updated, thus explaining why this configuration option isn't showing up. Many thanks anyways!

Ray Carnes

The online edition allows for modules written by OpenERP to be installed. The module "Cancel Journal Entries" is one of these modules. You need to be logged in as the administrator of your database to install the module, and a member of the Technical Features group to see all of the hidden menus.

sneha antony

Is there any option same as that used to delete the invoice so that all the other documents like sales orders,delivery orders,internal moves etc can be deleted in various statuses without much difficulty?

Avatar
Peter Pisarcik
Nejlepší odpověď

Hello everyone here is my fastest solution: 

  1. Install account_cancel module

  2. Cancel invoice

  3. Set invoice to draft

  4. Go to the database and find table account_invoice and set move_name = null

  5. Go back to invoices and delete an invoice

  6. Change counter in a journal back if you want

0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
change between 2 Invoice formats Vyřešeno
invoice
Avatar
Avatar
1
čvc 25
1766
Hello, how can I change the size of the logo and the invoice? Vyřešeno
invoice
Avatar
Avatar
Avatar
2
čvc 25
2142
Validation Error. You will need to clear the Journal Entry's Number to proceed
invoice
Avatar
Avatar
1
čvc 25
3082
Restricting Salesperson Access to Customer Invoice Details
invoice
Avatar
Avatar
Avatar
3
dub 25
2946
Odoo 16 - Download invoice preview doesn't work
invoice
Avatar
Avatar
Avatar
3
dub 25
3936
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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