Odoo Help


1 Answer
Bernat Llibre Spain
12/28/15, 8:04 AM

Here is an example:

I had to add a button in the orders view next to Reprint button.


         <record model="ir.ui.view" id="tpv_order_mail">
             <field name="name">pos.order.mail</field>
             <field name="model">pos.order</field>
             <field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>
             <field name="arch" type="xml">
                  <xpath expr="//field[@name='state']" position="before">
                         <button name="send_invoice" string="Send to..." type="object"/>


The xpath is to select where the new element will be placed, so we tell the view to place the new button before the field named 'state'.


We used an example to call the function of the new button:
def send_invoice(self, context=None):
     return {
         'warning': {
            'title': "Toy op",

            'message': "Sepin el mandarin",

Hope this is useful.

1 Comment
E.M. Spain
1/5/16, 9:26 PM

Thanks this is really useful. However, I am trying to fully understand this part: pos.order.mail pos.order Could you please clarify what is used in each "id=" / name="name" and name="model" respectively? I feel like I do not fully understand what represents each field.

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.

Odoo Training Center

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

Test it now