Odoo Help

0

0
1 Answer
1
La Jayuhni Yarsyah
2/1/19, 8:24 AM

Hi,,

Its clearly described in the repository that "This repository contains the code of the hello world view that was presented at the Odoo Experience 2018 during the talk entitled "Visualizing Data in Odoo: How to Create a New View" , you can clearly read at  https://github.com/Polymorphe57/hello_world_view_code/blob/master/README.md

It create new type of view!

But based on your syntax,, you try to use in "FORM" view,, it wouldn't be executed!

4 Comments
kylesentient@gmail.com
2/1/19, 12:22 PM

Then my wording must have been unclear, and I apologize for that. What I meant to say was that I used some of the references from that video to create an extension of the form view, similarly to the HelloWorldEvolution extension that the developper in the video created for the HelloWorld View. I did not create a helloworld view, I extended the Form View to add a couple buttons to it.

La Jayuhni Yarsyah
2/1/19, 10:35 PM

I think it can do by add button on form header in xml (for simple ways)

Ex:

<xpath expr="//form/header">

<button name="ex_btn_action" type="object" string="EXAMPLE BUTTON" />

</xpath>

and if you wanna to no action when clicked,, you just only need to define method in python that only just return False/None Value

Ex:

def ex_btn_action(self):

return None

But if you wanna advanced way to add button at the toolbar and wanna to apply to all form view ,, you must inherit odoo web js class "web.FormRenderer"

How to inheriting js class, you can read here as reference:

https://www.odoo.com/documentation/11.0/reference/javascript_cheatsheet.html#modifying-a-main-widget-from-the-interface

https://odoo-development.readthedocs.io/en/latest/dev/pos/gui.html

Regards

La Jayuhni Yarsyah
2/1/19, 10:37 PM

sorry miss for the example

<xpath expr="//form/header" position="inside">

<button name="ex_btn_action" type="object" string="EXAMPLE BUTTON" />

</xpath>

kylesentient@gmail.com
2/2/19, 3:40 AM

Thank you, Yarsyah. I'll be sure to try all of these things and see which one fits my needs best :)

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register