Hello, this is my first post in the forum :)
I'm trying to automate the analytic distribution in purchase order because, some orders may have tens of lines and I want to avoid errors while copying the distribution. Mass modification is not available for the lines in Studio so I try to make an atumated action with code :
Model id purchase.order, trigger is update and I have a ManyToOne field related to analytic accounts called x_studio_compte_analytique. Here is my code.
I tried to check if record.x_studio_compte_analytique.id is ok => yes, it displays the good ID
Any idea ?
for record in records:
tag_ids = [record.x_studio_compte_analytique.id]
#tag_ids = [6,7] doesn't work either
for line in record.order_line:
line['analytic_distribution']=[(6, 0, tag_ids)]