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

How to add a new field to pos order line table.

By
Daniel
on 4/8/16, 3:20 AM 379 views

Hello Community,

Am building a module to generate a report. Please, how can I extend pos order line table by adding additional field to the table?

Secondly, how can i  export product cost price from product template to the new field in pos order line table base on ordered product?

Thanks in advance

0

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

Odoo
On 4/8/16, 4:32 AM

Below code  will add a field in pos.order.line 


.xml

 <record id="pos_inherited" model="ir.ui.view"> 
               <field name="name">POs view</field>         
       <field name="model">pos.order</field>    
            <field name="type">form</field>     
           <field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>   

             <field name="arch" type="xml">

<xpath expr="//page[@string='Products']/field[@name='lines']/tree[@string='Order lines']/field[@name='price_subtotal_incl']" position="after">      

      <field name="ur_field"/>             

</xpath>         


.py


class pos_order(models.Model):

         _inherit='pos.order'

         ur_field=fields.Char('My New Line field')


if this answer is correct upvote my answer

Odoo
on 4/8/16, 5:55 AM

@ Dep Thanks for your response. Is it to make the code as addon module or to make the changes in original source code? What about my second question on how to export product cost price to the new field created?

Daniel
on 4/8/16, 6:40 AM

Create a custom module...and .If you have any daught u can contact my skype id-libukoshym

Odoo
on 4/8/16, 6:47 AM

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: 4/8/16, 3:20 AM
Seen: 379 times
Last updated: 4/8/16, 6:35 AM