İçereği Atla
Menü
Bu soru işaretlendi

when a sales.order is confirmed (state = 'sale'), each sale.order.line, on that sale.order, creates a hr.job

I have an automatic action that executes python code when updating sale.order.

but im not sure how can i do it

Avatar
Vazgeç
Üretici

Im trying this

def function(self):
sales_line_obj = self.pool.get('sales.order.line')

for sale_line_id in record.sale_order_line_ids:
line = sales_line_obj.browse(cr, uid,order_id ,context=context)
#print line.name
job = client.model('hr.job').create({'name': name,
'x_campaign_id': x_campaign_id,
'x_product_id': x_product_id,
'x_product_qty': x_product_qty,
'department_id': department_id,
'address_id': address_id,
'no_of_recruitment': no_of_recruitment,
'survey_id': survey_id,
'user_id': user_id})

But it doesnt work, any help?

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Oca 24
5601
0
Haz 23
2133
1
Ara 22
3518
0
Nis 22
2695
2
Ağu 20
3012