Skip to Content
Menu
This question has been flagged
2 Replies
3855 Views

Hi

I have created a selection field in studio, "_studio_revision" on my product.template. Then i have also created a relation field to that on the Purchase Order Line. When adding a new product on Purchase Order Line, the product revision is automatically fetched from Product. However, I do not want the Purchase Order Line to be updated with latest product revision if the product is revised, i.e. the product revision on Purchase Order shall be static for traceability.


Does anyone know how to turn up updates of my related field on Purchase Order Line, preferably using studio since Im a newbie and do not have access to database?


All help appreciated,
Rickard

Avatar
Discard
Author Best Answer

After some investigation I managed to solve this myself.

Instead of creating a relation field, I created an independent field for product revision on purchase order line, x_studio_purchase_order_line_revision. Then I created an automated action on purchase order line creation that execute python code:

for rec in records:
record['x_studio_purchase_order_line_revision'] = record.x_studio_revision

By doing this I can keep record of which product revision that was specified on historic purchases.

Avatar
Discard
Best Answer

Hi, i have the same problem,i try your solution but in my case the orifinal field is in purchase.lines and i want to copy it to a field in stock.moves, but it did not works if i try to use this solution in the same Module it works. I try product_id.purchase_order_line_ids.x_studio_custom_field, but show me an error

Avatar
Discard
Related Posts Replies Views Activity
0
Jun 22
23
4
Jun 25
3420
3
Sep 24
1231
0
Nov 23
1153
2
Feb 23
1947