Hi, new odoo ce user, trying to sort my issues. image below pretty much shows context precisely, i wanted to access linked Work Orders . Any ideas, huge thanks in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi, new odoo ce user, trying to sort my issues. image below pretty much shows context precisely, i wanted to access linked Work Orders . Any ideas, huge thanks in advance.
The better way to go about this would be to use self.env to perform the search. The code you have executes an XMLRPC event. Using self.env, your code would look like
result = self.env['mrp.workorder'].search([('production_id', '=', '3')])
not sure, this is best answer, but atlease i managed to solve this, by adding line below in python function :)
result = models.execute_kw(db, uid, password, 'mrp.workorder', 'search', [[['production_id
...: ', '=', 3]]])
relWorkOrders = self.env['mrp.workorder'].search([('production_id','=',self.id)])
mo = self.env['mrp.workorder']
wo_fields = ['name','state','workcenter_id']
relWorkOrdersData = mo.search_read([('production_id','=',self.id)],wo_fields)
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Sep 24
|
367 | ||
|
1
Aug 24
|
522 | ||
|
1
Jan 23
|
1616 | ||
|
3
Jan 23
|
9267 | ||
|
1
Oct 22
|
1466 |