[Trunk] - If you delete an invoice entry, invoice still exists

Bug #675494 reported by Frederic Clementi - Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

Create an invoice
deleted entry generated
go back to invoice list
The invoices is still existing refering to a draft entry (*XX) which does not exist anymore.
See attached screenshot

Could we prevent this kind of error from users ?

Related branches

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :
summary: - [Truk] - If you delete an invoice entriy, invoice still exist
+ [Trunk] - If you delete an invoice entry, invoice still exists
Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Frederic, this is something what openerp must includes in relations as RESTRICT ondelete, by now i dont believe a big patch fixing this for account and stock modules what i am consider high priority will be accepted.

Regards,

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

So, I guess it is the same thing for currencies...some of our customers have deleted currency rates to correct them...now t is a mess in the accounts to be fixed.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

I wonder how it allowed you to remove move lines ?
Tell me how you removed.
Thanks.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Cristian Salamea (ovnicraft) wrote :

@Jay its about account.move entry not move lines

Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Cristian,

I do not think the removal of entries is a good approach.
You can cancel the invoice instead. Removal of moves should never remove the invoice.

Shifting the bug to concerned addons team to decide the actual behavior on this.
Thanks.

Changed in openobject-addons:
status: Incomplete → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
status: Confirmed → Triaged
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

current behavior is like that:
If you create the invoice and validate it. now you remove its account.move (journal entry) but invoice is not referring to entry (which is deleted) and journal entry is empty in invoice.

But problem is currently the invoice is in open state, i think it should be in draft state (Because you have already removed its entry).

We can not remove invoice in this case we can just change the state to draft.

thanks
mustufa

Changed in openobject-addons:
milestone: none → 6.0-rc2
Changed in openobject-addons:
status: Triaged → In Progress
Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

@mra.

Remember "Invoice" in almost all countries is a "legal document" and it shouldn't in _any_ way change its properties at least it would do "explicity".

I mean.

change to "draft" is an elegant solution, but IMHO, it should be done in a VERY clear and informative way, because accountant people make several change in accounting and the document INVOICE itself shouldn't change by any reason after open without an explicit message at least!..

my 2 cents ;-)

Revision history for this message
qdp (OpenERP) (qdp) wrote :

sorry but i disagree: we should just put a ondelete=restrict ont the field move_id of account.invoice object. This will disallow to remove entry directly, if someone want to do that, he should cancell the invoice.

Thanks,
Quentin

Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello Frederic Clementi,

I have fixed the problem in lp:~openerp-dev/openobject-addons/trunk-dev-addons3-ara branch, It will be merged soon with trunk-dev-addons3.

Revision No: 4612
Revision ID: <email address hidden>

Thank you,
ara

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

I like this solution. I will test it asap
thanks guys!

Revision history for this message
xrg (xrg) wrote : Re: [Bug 675494] Re: [Trunk] - If you delete an invoice entry, invoice still exists

On Monday 03 January 2011, you wrote:
> I like this solution. I will test it asap
> thanks guys!

Well, it seems it has created a side effect: now, invoices cannot be cancelled!
Fix can be found in commit a448cd8c8f673f

Revision history for this message
Frederic Clementi - Camptocamp (frederic-clementi) wrote :

problem is still the same today...so, not fix has been merged yet right?

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.