Skip to Content
Menú
This question has been flagged
3 Respostes
3651 Vistes

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
Descartar
Autor 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
Descartar
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
Descartar

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
Descartar
Related Posts Respostes Vistes Activitat
3
d’abr. 24
2402
1
de nov. 19
6924
1
de maig 16
5817
0
de març 15
3461
1
de juny 23
3341