Odoo Help

Welcome!

This community 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.

0

Add button to form view

By
mohamed
on 5/13/15, 9:59 AM 927 views

Hello

i want to add button to form view (ir.ui.view model) like "create" button 

please see the picture in this link :http://i58.tinypic.com/v8k9xx.png

your url is not visible

Gavin Yap
on 8/5/15, 2:42 AM
1

Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
896
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.

https://www.linkedin.com/profile/public-profile-settings?trk=prof-edit-edit-public_profile

tibrahim@2p.com.sa

Tarek Mohamed Ibrahim
On 8/5/15, 3:13 AM

check for example, openerp\addons\sale\sale_view.xml. . Search for the <button> tag.

If the button's response is a method in the related class of the view then it should has the type type="object"

if the button's response is an action then there must be an action defined in the module that the button will refer to and type="action"

If the button is a workflow button then type="workflow", and there should be a workflow action the button refers to


1

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 8/5/15, 6:02 AM


There are three kinds of types for button: object, action & workflow. workflow is the default.

Now let's understand the meaning of these three types:

1.object is used if you want to call a method which is written in .py file.

2.action is used if you want to call any action which is written in .xml file. Let say if you want to open a wizard from button click then you can use type="action".

3.workflow (the default) is used if you want to call workflow.

<button name="%(action_view_sale_advance_payment_inv)d"  string="Create Invoice"  type="action">

when Create Invoice button is clicked, you will see a wizard.

<button name="278" string="Create Invoice" type="action">

Here 278 is an ID in postgresql database of action_view_sale_advance_payment_inv action.

Here some useful links as a beginner in this field:

https://www.odoo.com/fr_FR/forum/help-1/question/opening-new-window-with-button-in-openerp-23833

https://answers.launchpad.net/openobject-client-web/+question/112492

Regards.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/13/15, 9:59 AM
Seen: 927 times
Last updated: 8/5/15, 6:02 AM