Unable to delete "open" invoice

Bug #697702 reported by swissdotnet
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

Version : OpenERP 6.0 RC2

I'm unable to delete an opened (not paid) invoice.

- I installed the module "account_cancel".
- I set the option "Allow Cancelling Entries" to true on the journal used by the invoice.

But I get the following SQL error

Error message (server side) :

[2011-01-05 16:02:29,347][swissdotnet_prod] ERROR:db.cursor:bad query: delete from account_move where id IN (2)
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 129, in execute
    res = self._obj.execute(query, params)
IntegrityError: update or delete on table "account_move" violates foreign key constraint "account_invoice_move_id_fkey" on table "account_invoice"
DETAIL: Key (id)=(2) is still referenced from table "account_invoice".

Error message (client side) :

Integrity Error

The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set

[object with reference: Invoice - account.invoice]

Could you reproduce it ?

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Revision history for this message
xrg (xrg) wrote : Re: [Bug 697702] Re: Unable to delete "open" invoice

On Wednesday 05 January 2011, you wrote:
> ** Changed in: openobject-addons
> Status: New => Confirmed
>
> ** Changed in: openobject-addons
> Importance: Undecided => Medium
>
> ** Changed in: openobject-addons
> Assignee: (unassigned) => OpenERP R&D Addons Team 3
> (openerp-dev-addons3)

A patch is already provided at my "patch24" branch, pending a merge.

Changed in openobject-addons:
status: Confirmed → In Progress
milestone: none → 6.0
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello swissdotnet,

We have fixed the problem on Addons3 branch.
revision-id: mra@mra-laptop-20110106054309-9hkqjfg9b72oqfym
revno: 4806

xrg i have merged your branch thanks for the patch.

Thank you,
mra

Changed in openobject-addons:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.