Skip to Content
Menú
This question has been flagged
4 Respostes
733 Vistes

I want to add a field to products so i can view when was the last date the product was purchased from the vendor. What is the field name if it exist. 

Avatar
Descartar
Best Answer

The last purchase date is exists in Odoo for each vendor under product supplier info so you can add it to the below view:

If you need to add it to product, you need to add a computed field to product model and write your python code to compute the last purchase date (from any supplier) from purchase order model, then you can add it to the product list view.

Avatar
Descartar
Best Answer

Hi,

Please refer to the module:

1. https://odoo-community.org/shop/product-last-price-info-purchase-4054#attr=941939

You can find the latest version from v11 to v18.


Hope it helps.

Avatar
Descartar
Best Answer

It is probably better to create a Menu for Purchase Order Lines.

You can then see not just the last purchase date, but also the quantities, and can see purchase history over time, included any cancelled orders.

Avatar
Descartar
Best Answer

I guess you'll have to create it. And since you're creating it, you can name it anything you like. Suppose you name it last_purchase_date. Then you make it a calculated field and you can get the last purchase order line for that product. There might be some nuiance of checking if the order is confirmed or products are received depending on your own definition of a purchased product.

Avatar
Descartar