I have a button in a wizard, and what I need when I click it, keep the wizard opened. (Odoo 13)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 4 24
|
2181 | ||
|
0
thg 11 23
|
1144 | ||
|
1
thg 9 23
|
1156 | ||
|
2
thg 8 23
|
3260 | ||
|
2
thg 4 23
|
31053 |