Help

0

Odoo[12]: How to call the Wizard When I Change the kanban view's Stage.

Avatar
Kiran

Hi All,

In my case kanban view's having default four stage. i made extra custom column(stage) name is Estimation when i drag & drop the record from default column into the Estimation Column so that time i need to show the Wizard. how to do this. if you know this please let me know. 

See the below Code

.xml file

<record model="crm.stage" id="stage_lead5">
    <field name="name">Estimation</field>
    <field name="probability">15</field>
    <field name="on_change">1</field>
    <field name="sequence">2</field>
</record>

Thanks in Advanced

Avatar
Discard
2 Answers
0
Avatar
Haresh Kansara
Best Answer

Hi Kiran,

I assume that you are saying about CRM record stage change,

So there is a model (crm.stage) which contains different stages for lead/opportunity and this model is linked with lead/opportunity (crm.lead) as Many2one field (stage_id field).

So when you change the stage, actually it will change the many2one record. So for that you can write onchange method of stage_id and check that if stage is "Estimation" and if true then return wizard.

Let's  see how it will look like:

@api.onchange('stage_id')
def _onchange_stage_id(self):
    if self.stage_id and self.stage_id.name == 'Estimation':
        # do your code            

Hope it will work for you.

Thanks and regards

Haresh Kansara


2 Comments
Avatar
Discard
Avatar
Kiran
-

Hello @Haresh

i was try your code but i can't understand where and how return the wizard. if you know this then please explain me how to return the wizard code.

Thanks

Avatar
Kiran
-

Harsh, Actually what i'm trying to do, i need to call form of particular kanban at the time of moving from stage one to another stage.

0
Avatar
Ravi Gadhia
Best Answer

Hi​

It's not possible :(

above example will not work because  client will not handle action return by onchange.(client silently skip it and nothing happen)

as far as I remember onchange only return `domain` and `warning


1 Comment
Avatar
Discard