Try below one:
<field name="field_2" attrs="{'required':[('stage','=','two')]}"/>
If stage is in second, field_2(second field) must be in required. Otherwise should be in un-required state.
I have done the below code depends on state:
<page string="First Stage" attrs="{'invisible':[('state','=','draft')]}">
<group>
<field name="offer_letter" attrs="{'required':[('state','=','draft')]}"/>
</group>
</page>
<page string="Second Stage" attrs="{'invisible':[('state','in',('draft','pending'))]}">
<group>
<field name="passport" attrs="{'required':[('state','=','pending')]}"/>
</group>
</page>
In draft state: "offer_letter" field is required
In pending state: "passport" field is required
In pyhton:
_columns = {
'stage': fields.selection([
('stage_1', 'Start Qualification'),
('stage_2', 'First Qualification'),
('stage_3', 'Second qualification'),
('stage_4', 'Before finalisation'),
('stage_5', 'Finalised'),
], 'Stage'
),
'field_1': fields.char('Field_1', size=64),
'field_2': fields.char('Field_2', size=64),
'field_3': fields.char('Field_3', size=64),
'field_4': fields.char('Field_4', size=64),
'field_5': fields.char('Field_5', size=64),
}
_defaults = {
'stage': 'stage_1',
}
In xml:
<page string="First Stage">
<group>
<field name="field_1" attrs="{'required':[('stage','=','stage_1')]}"/>
</group>
</page>
<page string="Second Stage">
<group>
<field name="field_2" attrs="{'required':[('stage','=','stage_2')]}"/>
</group>
</page>
<page string="Third Stage">
<group>
<field name="field_3" attrs="{'required':[('stage','=','stage_3')]}"/>
</group>
</page>
<page string="Fourth Stage">
<group>
<field name="field_4" attrs="{'required':[('stage','=','stage_4')]}"/>
</group>
</page>
<page string="Fifth Stage">
<group>
<field name="field_5" attrs="{'required':[('stage','=','stage_5')]}"/>
</group>
</page>
If you use like this, in your status bar consists 5 stages.
Beginning of the flow stage is stage_1(Start Qualification) in this stage Field_1 is required, then when you click the stage_2(First Qualification) - Field_2 is required..., and the flow goes likewise.