跳至内容
Odoo 菜单
  • 登录
  • 免费试用
  • 应用程序
    财务
    • 会计
    • 发票
    • 费用
    • 电子表格 (BI)
    • 文档
    • 电子签名
    销售
    • 客户关系管理
    • 销售
    • POS 销售点管理-零售
    • POS 销售点管理 - 餐厅
    • 订阅
    • 租赁
    网站
    • 网站设计
    • 电子商务
    • 博客
    • 论坛
    • 在线客服
    • 在线学习
    供应链
    • 库存
    • 制造
    • 产品生命周期
    • 采购
    • 维护保养
    • 品控
    人力资源
    • 员工
    • 招聘
    • 休假
    • 评价
    • 内部推荐
    • 车队
    营销
    • 社媒营销
    • 电邮营销
    • 短信营销
    • 近期活动
    • 营销自动化
    • 网上调查
    服务
    • 项目管理
    • 工时单
    • 现场服务
    • 服务台
    • 排期
    • 预约
    生产力
    • 讨论
    • 批核
    • IoT物联网
    • VoIP
    • 知识库
    • WhatsApp
    第三方应用软件 Odoo 定制 Odoo云端平台
  • 行业
    零售
    • 书店
    • 服装店
    • 家具店
    • 食品杂货店
    • 五金店
    • 玩具店
    餐饮与酒店服务
    • 酒吧及酒馆
    • 餐厅
    • 快餐
    • 民宿
    • 饮品分销商
    • 酒店
    房地产
    • 房地产代理
    • 建筑师事务所
    • 建造业
    • 地产管理
    • 园艺
    • 业主协会
    咨询
    • 会计师事务所
    • Odoo合作伙伴
    • 市场推广公司
    • 律师事务所
    • 人才招聘
    • 审核 & 认证
    制造
    • 纺织
    • 金属
    • 家具
    • 食品
    • 啤酒厂
    • 企业礼品
    保健与健身
    • 体育俱乐部
    • 眼镜店
    • 健身中心
    • 健康从业者
    • 药房
    • 发型屋
    商贸服务
    • 维修人员
    • IT 硬件及支持
    • 太阳能系统
    • 鞋匠
    • 清洁服务
    • 暖通空调服务
    其他
    • 非营利组织
    • 环境机构
    • 广告牌租赁
    • 摄影服务
    • 自行车租赁
    • 软件经销商
    浏览所有行业
  • 社区
    学习
    • 教学视频
    • 文档
    • 认证
    • 培训
    • 博客
    • 播客
    赋能教育
    • 教育计划
    • Scale Up! 商业游戏
    • 参观Odoo
    获取软件
    • 下载
    • 版本对比
    • 发布
    合作
    • Github
    • 论坛
    • 近期活动
    • 翻译
    • 成为合作伙伴
    • 合作伙伴服务
    • 注册您的会计事务所
    获取服务
    • 寻找合作伙伴
    • 查找会计服务
    • 预约顾问咨询
    • 安装及推行服务
    • 客户参考
    • 支持
    • 升级
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    获取演示
  • 定价
  • 技术支持

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

  • 客户关系管理
  • e-Commerce
  • 会计
  • 库存
  • PoS
  • 项目
  • MRP
All apps
只限注册用戶才可与社群互动。
所有帖文 人 徽章
标签 (查看所有)
odoo accounting v14 pos v15
关于此论坛区
只限注册用戶才可与社群互动。
所有帖文 人 徽章
标签 (查看所有)
odoo accounting v14 pos v15
关于此论坛区
帮助

How to delete an invoice after validation?

订阅

此帖文有活动时,接收通知

此问题已终结
invoice
23 回复
73298 查看
形象
s.salahcharki

How to delete an invoice after validation?

1
形象
丢弃
Odoo Mates

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

形象
ClueLogics Technologies Pvt. Ltd.
最佳答案

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
形象
丢弃
形象
ravi
最佳答案

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
形象
丢弃
形象
Ray Carnes
最佳答案

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
形象
丢弃
s.salahcharki
编写者

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

形象
Jose Carlos Ramos Carmenates
最佳答案

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
形象
丢弃
Hamza rana

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

Really appreciated.

形象
Cyril Gaspard (GEM)
最佳答案

Hi,

use a refund for that.

bye

1
形象
丢弃
形象
vim24
最佳答案

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
形象
丢弃
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.

形象
Piotr Kaczmarski
最佳答案

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
形象
丢弃
ravi

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

形象
Greater Global - HK
最佳答案

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
形象
丢弃
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?

形象
Peter Pisarcik
最佳答案

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
形象
丢弃
形象
Agustin Ruiz Nattero
最佳答案

 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
形象
丢弃
喜欢讨论吗?不要只阅读,加入进来!

立即创建账户,享受专属功能,与我们的精彩社区互动!

注册
相关帖文 回复 查看 活动
change between 2 Invoice formats 已解决
invoice
形象
形象
1
7月 25
1766
Hello, how can I change the size of the logo and the invoice? 已解决
invoice
形象
形象
形象
2
7月 25
2142
Validation Error. You will need to clear the Journal Entry's Number to proceed
invoice
形象
形象
1
7月 25
3082
Restricting Salesperson Access to Customer Invoice Details
invoice
形象
形象
形象
3
4月 25
2946
Odoo 16 - Download invoice preview doesn't work
invoice
形象
形象
形象
3
4月 25
3936
社区
  • 教学视频
  • 文档
  • 论坛
开源
  • 下载
  • Github
  • Runbot
  • 翻译
服务
  • Odoo.sh 托管
  • 支持
  • 升级
  • 自定义开发服务
  • 教育
  • 查找会计服务
  • 寻找合作伙伴
  • 成为合作伙伴
关于我们
  • 我们的公司
  • 品牌资产
  • 联系我们
  • 招聘
  • 近期活动
  • 播客
  • 博客
  • 客户
  • 法律 • 隐私
  • 安全
الْعَرَبيّة 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致力于为企业管理提供高效智能的开源解决方案,是全球业内高速成长的软件服务商之一,逾七百五十万用户选择Odoo进行数字化升级。通过一系列全业务链覆盖、高度集成、简单易用的商业应用,助力企业实现信息化改革、降本增效并释放公司增长潜力。

Odoo独特的价值在于是一款非常容易使用又完全集成的应用。

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