Help

2

ir.values in odoo 11

Avatar
Satrio Wahyu

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?

2 Comments
Avatar
Discard
Avatar
Niyas Raphy
-

in Odoo v11 , ir.values is replaced by ir.defaults and two extra fields in actions ,

*binding_type

*binding_model_id

Avatar
Satrio Wahyu
-

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?

4 Answers
10
Avatar
Satrio Wahyu
Best Answer

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 :)    

Avatar
Discard
0
Best Answer


Avatar
Discard
0
Best Answer

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" />
Avatar
Discard
0
Avatar
Waleed Mohsen
Best Answer


Avatar
Discard