Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3969 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
čvn 22
23
4
čvn 25
3575
3
zář 24
1343
0
lis 23
1254
2
úno 23
2042