Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4135 Visualizzazioni

Hello All,

I have two types of fields in odoo10. One is 'Many2one' type field and other is 'One2many' type field. In 'Many2one' field we selected type of "Workflow". Recently i have three type of workflows(full-flow, semi-flow and simplified-flow). And in One2many type field, i have two field 'stage' and 'status'. And, when i select "full-flow" from workflow field then in another field "stage" and "status" automatically selected. Now i require that when i select any workflow from workflow field then related "stage" visible in button and "status" appear in statusbar. So, anyone can help me for this problem.

My Python and XML code is below:

Python code:

work_flow_stage = fields.Many2one('stage.workflow', column='workflow', string="Type of Workflow")
work_stage = fields.One2many(related="work_flow_stage.stages_workflow_flow", string="Work Stage")
body_pro_stage = fields.Many2one('partner.state', string="Stages")
body_pro_status = fields.Char(related='body_pro_stage.status', string="Status")

@api.multi
def case_start(self, uid, context=None):
workflow_obj = self.env['body.processing'].default_get(['work_flow_stage'])
print "workflow_obj: ", workflow_obj
stage_obj = self.env['stages.workflow'].default_get(['work_stage'])
workflow_ids = []
stage_workflow_ids = workflow_obj.search(cr, uid, [('workflow_ids', '=', 'work_stage')])
if workflow_ids:
stages = stage_obj.browse(cr, uid)
return stages

XML code:

<header>
<button name="case_start" string="Start" type="object" class="btn-primary"/>
<field name="body_pro_stage" nolabel="1" widget="statusbar" statusbar_visible="body_pro_status"/>
 </header>
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
feb 25
1027
2
dic 24
1382
0
lug 24
1135
0
ago 23
1598
0
mag 23
2927