Need to find purchases by products

We’re missing a feature in Tryton which we heavily used in Openerp, namely the means to be able to navigate to related purchases from the product [variant] form or even directly filter from the tree of purchases.

Has anybody already taken the time to patch this functionality into Tryton?
Invoices lines also have product relations, for that matter…

On this same note, there is a ‘product cost history’ function on products, it might be nice to tag onto that in order to get to the purchase and/or invoice.

IIRC we have added this functionality as a customization for customers a couple of times. But I’m not sure this should be part of standard modules.

I’m not sure to understand you here. Could you clarify what are you missing here? Probably it’s worth to start a new topic as it seems related to the product cost history but not to purchases and products

Here’s a custom module which add a relate on product variant to get purchase_lines:

Once in product cost history, it should be possible to navigate to each purchase or invoice… it appears now that only a cost price history graph is displayed if I click on a single dated entry in the list.
Totally non-intuitive… I would expect to open the purchase (or eventually invoice) at that date.

Merci Maxime… I’ll take a look.

But product_cost_history module does not depend on the purchase nor on the invoice modules.

BTW probably it’s better to add the missing information on the product_cost_history list. What invoice/purchase information are you missing?

?? Where does the cost price come from in this case?
The only pertinent value could be from the purchase and/or invoice!

Perhaps, but it would be best to at least add the relates in order to be able to navigate quickly to the relevant purchase order or invoice.

To me, it’d make a lot of sense if both sale and purchase modules added a relate button from product.product and product.template to sale.line and purchase.line.

It’s a frequently asked feature.

1 Like

Thes shown are the history of change of the product. Normally this is updated when receiving the stock moves but if a user manually changes the product cost price this changes will also be in the history and does not come from a invoice nor a purchase.

Could you elaborate which is the rational? Why are users asking this feature?

I’m not sure if this will solve the problem. For example, if the idea is to know on which supplier are we purchasing a specific product the information should be on the purchase.product_supplier table and not on the purchase lines.

If the data is not on the product supplier probably we are missing some automation to add this supplier to the product after some purchases.

It seems difficult to justify any cost price history that is not invoiced, or minimally a confirmed purchase order. All others more or less detract from the real economic measure, read even be wrong!

I see, for example, in the cost price history of products imported at the last date for migration (18/01/19) that some (not having been purchased yet) have a price of 1€ (!), then for example, 3 prices for today even though the purchase/effective stock move/and invoice date are different for these.
Luckily there wasn’t any special reduction or the prices would probably have been wrong for the latter as well.