Hello,
I have code that I'm running in automated actions on the sales order.order lines that loops through the records and finds a product and updates the line-item to a new value.
This code was working until ODOO 12, now I'm in 13 and its stalling the interface with a wait symbol.
Code Below:
for line in record.order_line:
if (line.product_id.categ_id.parent_id.name=="SLA"):
if(line.product_id.categ_id.name == "Gold"):
calcAmount = (record.amount_total - line.price_total) * 0.12
line.update({"price_unit": calcAmount})
if(line.product_id.categ_id.name == "Silver"):
calcAmount = (record.amount_total - line.price_total) * 0.08
line.update({"price_unit": calcAmount})
if(line.product_id.categ_id.name == "Platinum"):
calcAmount = (record.amount_total - line.price_total) * 0.15
line.update({"price_unit": calcAmount})
Can you give any pointers on this?
Thank you in advance