Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3140 มุมมอง

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 !








อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 25
2397
3
ก.ค. 25
2808
1
ก.ค. 25
2017
3
พ.ย. 24
361
4
ก.ย. 24
3473