Ir al contenido
Menú
Se marcó esta pregunta

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
Descartar
Autor

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?

Publicaciones relacionadas Respuestas Vistas Actividad
2
ene 24
5439
0
jun 23
2036
1
dic 22
3349
0
abr 22
2567
2
ago 20
2881