This question has been flagged
1564 Views

Good morning,

I'm on v9 and I'm a beginner with related fields, maybe you could solve my issue !

Here's the context :

Our company use the MRP module to craft a product X with products A, B, C, etc. I would like to display in the serial number of my product X : the sum of products consumed standard prices (can be A + B + C, A + C, or A + B + D ! That's why two products X can have a different cost, and I need to display it in the serial number).

I succeed to add a field x_standard_price (with related field "product_id.standard_price") in the tree field "move_lines2" (correspond to the table "Products consumed" in the MO") so the total cost of A + B + C is displayed on the MO ! Great ! :)

But I'm blocked to the final step : create a new field in the form view of serial numbers, which display what we have in "x_standard_price". But I don't know how to relate the field, how should I write it ? I don't know how it works so I tried random things like "move_id.x_standard_price", "move_lines2.x_standard_price", "product_id.x_standard_price", well I don't know what to write before "x_standard_price" ! :) Moreover, I can't deal with the code, I'm using the interface to create and edit my fields !

What's the key relation between stock.moves and stock.production.lots ? Or how could I know this ?

If this issue seems obvious to solve to you, I would be very grateful for your help !

Regards,Fabien :)


Avatar
Discard