Skip to Content
Menu
This question has been flagged
3 Replies
2250 Views

Is there a way to delete archived pricelist entries in Odoo Online v15? 

I am asking because I have reason to believe that some prices that have been archived are still linked to products in our website, which is bad because it suggests prices that are outdated. 
I can not find where I could delete these entries.

Any help is greatly appreciated - thanks        

Avatar
Discard
Author Best Answer

Thanks for the elaborate answer, but it's not what I was looking for. 
I need to delete archived pricelist ENTRIES (ITEMS) not the archived priceslist themselves. 

On our website, there are prices showing up that are not in the pricelist (there is a discount that is not existing in my pricelist). I think it's an old pricelist entry that I have archived before, and it's still linked to the product for some reason. This is really annoying because our website is showing wrong price and I can not do anything against it.

If anyone knows how to solve this problem, I would be extremely thankful.

Avatar
Discard
Best Answer

Hello Tom,
Odoo will not allow to delete any pricelist entries linked with other models. You can only archive pricelist entries.

If you want to delete pricelist forcefully then you can override the unlink method of "product.pricelist" model as follow.

Please find code in comment. 

I Hope this will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

Code:

def unlink(self):
# search and unlink peicelist_id from all products
self.env["product.template"].search([("pricelist_id", "=", self.ids)]).pricelist_id = False
return super(ProductTemplate, self).unlink()

Best Answer

Hi Tom,

You can find the archived price list by selecting the archived filter in the list view of the price lists as shown in the image.


From there you can select the price lists using the checkboxes near them, after selecting those you click on the 'action -> Delete' to delete those price lists. And please note that there are some restrictions for some price lists which are used as default, that you cannot be deleted from the database.


If those price lists are custom-made (made by users) most of them can be able to delete in this way.

Regards

Avatar
Discard
Related Posts Replies Views Activity
3
Apr 24
738
1
Nov 19
5675
1
May 16
4914
0
Mar 15
2623
1
Jun 23
2172