It is currently Tue May 22, 2012 8:57 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [Oerp 6] Cannot remove product
PostPosted: Fri Sep 23, 2011 4:57 pm 
Offline

Joined: Tue Feb 15, 2011 6:12 pm
Posts: 44
Helllo,

In my product list, i've got the same product up to 5 or 6 times. I'd like to delete them, but i'm unable to do so because of this message :
"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: Stock Move - stock.move]"

The only stock move is an inventory, which appears into the Tracability / Stock moves (a line which begins with INV).
This lines is also impossible to delete.

Except attacking the database, which can corrupt the whole things, does anyone have an idea to help us ?

Thanks


Top
 Profile  
 
 Post subject: Re: [Oerp 6] Cannot remove product
PostPosted: Sun Sep 25, 2011 9:26 pm 
Offline

Joined: Mon Jul 04, 2011 6:23 am
Posts: 372
Location: Auckland, New Zealand
The old fashioned way was to change the description to "zzz do not use", change status to inactive and uncheck the can be sold, can be purchased check boxes. If you still want the descriptions to be meaningful, just do the last two.

_________________
Kevin
Solnet Solutions Limited
Auckland, New Zealand


Top
 Profile  
 
 Post subject: Re: [Oerp 6] Cannot remove product
PostPosted: Mon Oct 10, 2011 5:00 pm 
Offline

Joined: Tue Feb 15, 2011 6:12 pm
Posts: 44
That's too bad that even the administrator cannot remove that..

ANyone tried to remove these points by PostgreSQL (kind of alter table or something else) ?

Thank you


Top
 Profile  
 
 Post subject: Re: [Oerp 6] Cannot remove product
PostPosted: Mon Oct 10, 2011 8:19 pm 
Offline

Joined: Wed Jan 27, 2010 6:21 pm
Posts: 797
Location: Auckland, NZ
No, although I've hacked similar this one is quite tricky.

You will need to delete the stock moves first, although the stock move will have created account moves so you will need to delete those before the stock moves. Also probably the inventory stocktake. Just depends you need to check the openerp objects and see what their delete setting is for related objects, whether it is set null, cascade or the other one.

You should try and delete those in the client first, and definitely the products. The module which allows cancelling journal entries might be handing.

_________________
Graeme


Top
 Profile  
 
 Post subject: Re: [Oerp 6] Cannot remove product
PostPosted: Fri Oct 28, 2011 9:20 pm 
Offline

Joined: Wed Dec 15, 2010 8:14 pm
Posts: 425
Never ever do a physical delete of a record in OpenERP. You will leave the database in an inconsistent state. Just mark the record as inactive, that will do the trick

_________________
Gustavo Orrillo
http://erpmoldeo.wordpress.com/


Top
 Profile  
 
 Post subject: Re: [Oerp 6] Cannot remove product
PostPosted: Sat Oct 29, 2011 9:07 am 
Offline

Joined: Mon Jul 18, 2011 12:02 pm
Posts: 76
First delete that product from stock moves and then try deleting it from product list...
:)

Regards,
Arsalan Ali
OpenERP Developer,
Karachi, Pakistan


Top
 Profile  
 
 Post subject: Re: [Oerp 6] Cannot remove product
PostPosted: Sun Oct 30, 2011 6:19 pm 
Offline

Joined: Wed Jan 27, 2010 6:21 pm
Posts: 797
Location: Auckland, NZ
Morillo what are you on about? I delete products that users have created in error just about every day. The whole point of the ondelete flag is to manage database referential integrity. Otherwise what is the point of the delete button?

_________________
Graeme


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP