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:

Sunday, 17 July 2016

How to Call Wizard from XML Button Odoo

Hello world. Wizard is important if you want to develop odoo, wizard is something like pop up will show when you have action. With wizard you can make form or just information that you want to show. Okay, at first i wanna show you how to call wizard form xml button. And the next i will show you how to make wizard in odoo. Lets make it happen.

This is my code for call wizard from button.

<button
       type="action"
       name="%(split_wo.action_view_wizard)d"
       string="Finished"
       class="oe_highlight"
       help="Finish Order"/>

in this code the important is name, as you can se split_wo.action_view_wizard, so split_wo is module where is the wizard, and action_view_wizard is name of the wizard. Simple right? that's it. So if you have question, you can write comment bellow, don't worry i will help you if i can. I hope this is can help you for little bit. lol
Share:


<br>


Advice for contacting me at dedyy54@gmail.com