Hi,
I need to migrate module from Odoo 8 to Odoo 11. I have some problem with some model in XML code, in Odoo 8 we can use ir.values and this model have field named "value" which can be filled with some actions (e.g: ir.actions.server + str(ref(action_id_from_ir_actions_server))). But in Odoo 11 I cannot find any similar model with this ir.values, I have try to read documentation but I cannot find what I need. Any idea for this ir.values in Odoo 11?
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ờ
HI,
after few days struggling with ir.values problem (since it not exist in Odoo 11), my friend and I have found some solution.
we can use ir.actions.server model and fill binding_model_id field with your target model where that menu want to be added (e.g if you want to place some action menu in purchase.order model so you just fill binding_model_id with purchase.order model. And for code field which is usually we use it for calling python function we fill with "model.your_python_function()"
for more clear answer to sample code is like this :
================ XML File ================
<record id="action_server_learn_skill" model="ir.actions.server">
<field name="name">Learning</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="your_module_folder_name.model_your_model" />
<field name="binding_model_id" ref="module_folder_name.model_your_target_model" />
<field name="state">code</field>
<field name="code">model.action_learn()</field>
</record>
Hope my solution will give you a little help :)
In Odoo 11.0, ir.values is replace by binding_model_id in ir_actions
in your ir_actions xml file, binding_model_id field like this
<field name="binding_model_id" ref="module_folder_name.model_your_target_model" />
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 | |
---|---|---|---|---|
|
2
thg 9 19
|
5232 | ||
|
4
thg 11 18
|
6077 | ||
|
2
thg 2 24
|
3397 | ||
|
1
thg 8 23
|
4960 | ||
|
2
thg 12 22
|
6452 |
in Odoo v11 , ir.values is replaced by ir.defaults and two extra fields in actions ,
*binding_type
*binding_model_id
Hi Niyas, yes I have try used binding_model_id but I think it used to reference some model and how can I do this ir.actions.server + str(ref(action_id_from_ir_actions_server))? How about ir.actions.todo model? Can I use this model?