Wednesday 27 July 2016

How to add or Ihherit Action on Odoo ?



https://dedyyuristiawan.blogspot.com
Action Odoo


Hello world. Today i've new knowledge about develop Odoo. do you ever see action in odoo, some thing like picture on top, beside print? its action, and now i will share how to inherit or add action on odoo. let's do this.

Actually its very simple, like you inherit field or another view. in this case, i just add xml file that inherit to parent. This is my xml file.

<record model="ir.values" id="set_efaktur">
    <field name="name">My Action</field>
    <field name="value" 
    eval="'ir.actions.act_window,' + str(ref('wizard_action'))" />
    <field name="key">action</field>
    <field name="model">dedy.yuristiawan</field>
</record>

You can read this description :

1. As you can see i set record in the ir.values. and then i put name My Action.
2. And then in the value i just set value, and eval ("'ir.actions.act_window,' + str(ref('wizard_action'))") it will be show my wizard. wizard_action is name of wizard template.
3. Next line i just declaration key with action.
4. And the last, this is really important, i put my action in the my custom model dedy.yuristiawan.
5. Just it

Huya, simple right? so this is post about inherit or add new action in Odoo, if you still confuse about my code you can fill comment bellow. I hope this is can help you. See yaa
Share:
Lokasi: Semarang, Semarang City, Central Java, Indonesia

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. mas dedy, wizard_action template is it from odoo or we create ourself? i try it on my own model x_septimaulina, but still error

    ReplyDelete
    Replies
    1. hallo septi, sorry now i not really focus on my blog, and Odoo environment, but wizard_action is calling the wizard, so you do not need to create it. what you error? i think now, you already solve your problem right? i guess.

      Delete
  3. Odoo partner
    Thanks for sharing this informative article. This content is very useful.
    Odoo Partners

    ReplyDelete


<br>


Advice for contacting me at dedyy54@gmail.com