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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
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.
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
form view in create button
view.xml file
<record id="teachar_form_view" model="ir.ui.view">
<field name="name">teachar.details.form</field>
<field name="model">teachars.teacher</field>
<field name="type">form</field> <field name="arch" type="xml">
<form string="terchar.details">
<header>
<button name="send_mail_template" string="Send e-mail" type="object" class="oe_highlight"/>
</header>
</form>
</field>
</record>Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
Sep 19
|
2180 | ||
|
0
May 25
|
115 | ||
|
2
Apr 25
|
2380 | ||
|
1
Feb 25
|
732 | ||
|
2
Feb 25
|
1240 |
your url is not visible