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.
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)
Skapa ett konto idag för att ta del av exklusiva funktioner och engagera dig i vår fantastiska community!
Registrera dig| Relaterade inlägg | Svar | Vyer | Verksamhet | |
|---|---|---|---|---|
|
1
maj 26
|
1369 | |||
|
1
okt. 25
|
1713 | |||
|
1
sep. 24
|
4611 | |||
|
1
aug. 24
|
4186 | |||
|
1
jan. 23
|
5046 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.