Odoo Help


How to add a button in the seletions "More" [Closed]

on 3/20/13, 12:03 AM 9,511 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 04/18/2013 05:04:21

Hi,It is in the sale module, and I want to add a button "confirm sale" , I find the code in the saly.py :

def action_button_confirm(self, cr, uid, ids, context=None):
    assert len(ids) == 1,

This option should only be used for a single id at a time.'

wf_service = netsvc.LocalService('workflow')
wf_service.trg_validate(uid, 'sale.order', ids[0], 'order_confirm', cr)

# redisplay the record as a sales order
view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
view_id = view_ref and view_ref[1] or False,
return {
    'type': 'ir.actions.act_window',
    'name': _('Sales Order'),
    'res_model': 'sale.order',
    'res_id': ids[0],
    'view_type': 'form',
    'view_mode': 'form',
    'view_id': view_id,
    'target': 'current',
    'nodestroy': True,

and I also find the action button Make invoices in the wizard/sale_make_invoice:

<record id="view_sale_order_make_invoice" model="ir.ui.view">
    <field name="name">Create invoices</field>
    <field name="model">sale.make.invoice</field>
    <field name="arch" type="xml">
        <form string="Create invoices" version="7.0">
                <button name="make_invoices" string="Create Invoices" type="object" class="oe_highlight"  />
                <button string="Cancel" class="oe_link" special="cancel" />
            <separator colspan="4" string="Do you really want to create the invoice(s)?" />
                <field name="grouped"/>
                <field name="invoice_date"/>

I try some methods to add the button , but there are all failure....

the button i want to add like this : postimage.org/image/v6smmnea5/


Will you please specify what you really want to do? Do you want to add button in view or something else?

Sudhir Arya (ERP Harbor Consulting Services)
on 3/20/13, 1:21 AM

I want to add a exist button named "confirm sale" in view, and i have find the code of it ...

on 3/20/13, 1:34 AM

Do you want multiple order confirm from quotation Tree View ????

Parth Gajjar
on 3/20/13, 2:09 AM

i cant upload my image , and i want to add the button like this http://postimage.org/image/v6smmnea5/

on 3/20/13, 2:58 AM

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 3/20/13, 3:05 AM

You need to create a wizard and then create <act_window action.

    name="Confirm Sale"

act_window will add action in "More" as you needed.

actually, i delete the exist <act_window id="action_order_line_product_tree"........> And i find the button "Make invoice" is still in "More"......

on 3/20/13, 5:09 AM

the answer is in: http://help.openerp.com/question/7468/why-cant-i-make-a-button-in-tree/

on 3/26/13, 10:42 PM
Nimesh Contractor
On 3/20/13, 2:11 AM

make a action having <field name="multi">True</field>

On 3/20/13, 4:37 AM

Thanks for answer, but i am not very clearly how to do it . i find a act_window exist in sale_view.xml:

        context="{'search_default_product_id': active_id, 'default_product_id': active_id}"
        name="Sales Order Lines"

i think this is the action "make invoices" in "More", but i dont know why it wirte like this.

And I know the code of button "confirm sale" ,its in sale_view.xml:

        <record id="view_order_form" model="ir.ui.view">
        <field name="name">sale.order.form</field>
        <field name="model">sale.order</field>
        <field name="arch" type="xml">
            <form string="Sales Order" version="7.0">
                    <button name="invoice_recreate" states="invoice_except" string="Recreate Invoice" groups="base.group_user"/>
                    <button name="invoice_corrected" states="invoice_except" string="Ignore Exception" groups="base.group_user"/>
                    <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
                    <button name="action_quotation_send" string="Send by Email" type="object" states="sent" groups="base.group_user"/>
                    <button name="print_quotation" string="Print" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
                    <button name="print_quotation" string="Print" type="object" states="sent" groups="base.group_user"/>
                    <button name="action_button_confirm" states="draft" string="Confirm Sale" type="object" groups="base.group_user"/>
                    <button name="action_button_confirm" states="sent" string="Confirm Sale" class="oe_highlight" type="object" groups="base.group_user"/>…………

Can i use it directly? Thanks.....

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/20/13, 12:03 AM
Seen: 9511 times
Last updated: 3/16/15, 8:10 AM