Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
7327 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả

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.

Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 11 23
2930
3
thg 12 21
8965
0
thg 11 19
37
3
thg 10 19
4433
1
thg 8 19
6206