跳至内容
菜单
此问题已终结

Hello there, 

I'm working on a mutli company environnement  , and want to be able to get a custom field from purchase order line being duplicated in the automatically generated sale order line. 

From what I can understand, I can inherit the method which is used to prepare the data, and add my custom field, but  it seems that I'm not good enough to do that.

What I have done so far is create a automatic action based upon sale order model with the following code : 


@api.model
def _prepare_sale_order_line_data(self, line, company, sale_id):
res = super(purchase_order, self)._prepare_sale_order_line_data(line, company, sale_id)
for po_line in self.order_line:
res.update({'x_studio_surcotes': po_line.x_studio_surcotes})
return res


But I've got an error when I confirm the purchase order which is supposed to generate the sale order

Am I doing it completely wrong here ? 


Thanks for your help !








形象
丢弃
相关帖文 回复 查看 活动
2
7月 25
2417
3
7月 25
2824
1
7月 25
2025
3
11月 24
361
4
9月 24
3488