Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1954 Widoki

Hello, I'm using Odoo 17.2e Odoo Studio access (no direct coding)

I want to create an automation that is triggered every time I add a new line on my Sale quotations.

The automation needs to populate some extra fields that I have already created in the SO Line view.

The Question:

How can I trigger the action to run as soon as I select the product on my quotation line? 

What it works for me is triggering "On Save" on my sale.order.line model, all works fine but I always need to SAVE the whole quotation before the action is triggered. Is there a better way that triggers the new line only, before saving the whole quotation?


Thanks !!
Luca


Awatar
Odrzuć
Autor Najlepsza odpowiedź

Solved:

"On UI Change" -> Field to look : product_id

That works. I was using product_template_id which was not triggering my automation.

Awatar
Odrzuć

Hi Luca

Could you please share the Execution Code that you used to achieve this?

Autor

@Rickard for that case, I built the automation on the sale.order.line model (not on the sale.order), and I'm triggering the product_id field On UI Change. The code I'm running is something like this:

# Fetch the related product
product = record.product_template_id

if product and product.x_studio_este_custom == False:
# Copy the parameters from the Product.template to the sale.order.line model
record['x_studio_material'] = product.x_studio_print_material
record['x_studio_finisaje'] = product.x_studio_finisaje_1
record['x_studio_material_filter_cat_id'] = product.x_studio_material_category.id
record['x_studio_finisaje_filter_cat_id'] = product.x_studio_finisaje_category.id
elif product and product.x_studio_este_custom == True:
# Reset Custom Values
record['x_studio_este_custom'] = True
record['x_studio_material_filter_cat_id'] = product.x_studio_material_category.id
record['x_studio_finisaje_filter_cat_id'] = product.x_studio_finisaje_category.id

Powiązane posty Odpowiedzi Widoki Czynność
0
lis 23
1321
2
mar 25
1477
1
cze 24
1572
0
maj 22
3269
2
maj 25
1887