Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3753 Weergaven

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
Annuleer
Auteur Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
jun. 22
23
4
jun. 25
3358
3
sep. 24
1191
0
nov. 23
1104
2
feb. 23
1908