Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
11263 มุมมอง

I have a button in a wizard, and what I need when I click it, keep the wizard opened. (Odoo 13)

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I resolved it in an easy way, just returned the same wizard in a new action like this:

## here I change what I need example:

self.my_field_ids = [(6, 0, my_values_ids)]
return {
'name': 'Same title',
'view_mode': 'form',
'view_id': False,
'res_model': self._name,
'domain': [],
'context': dict(self._context, active_ids=self.ids),
'type': 'ir.actions.act_window',
'target': 'new',
'res_id': self.id,
}
อวตาร
ละทิ้ง

Nice!

คำตอบที่ดีที่สุด

More appropriate way to make this happen is this and it will not close the wizard

return { 
'type' : 'ir.actions.do_nothing'
}
อวตาร
ละทิ้ง

It works in back dates

คำตอบที่ดีที่สุด
It works for me:

action = self.env["ir.actions.actions"]._for_xml_id("current_model.current_action")
action['res_id'] = self.id
return action


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

If I'm not mistaken previously it was possible with the attribute special='string', e.g.:

<button name="do_stuff" type="object" string="Do Stuff" class="oe_highlight" special="string"/>

Be cautious: (even if it helped) the object would not be saved before the button is triggered. For example, some of compute, inverse, create/write method would not have take a place. Thus, the behavior would be different in comparison to normal button, some figures might be not yet calculated.

Alternatively, it should be done by adding JavaScript event handlers.

อวตาร
ละทิ้ง
ผู้เขียน

thank you for your answer.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 24
2181
0
พ.ย. 23
1144
Blank White Page After log in to Odoo13 แก้ไขแล้ว
1
ก.ย. 23
1156
2
ส.ค. 23
3259
2
เม.ย. 23
31053