Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3733 Vizualizări

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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.

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
iun. 22
23
4
iun. 25
3356
3
sept. 24
1188
0
nov. 23
1094
2
feb. 23
1908