Odoo Help

0

how to add a new column in view (invoice)

By
medmars
on 4/26/16, 6:58 AM 643 views

hello everyone, please i have to add a static element named unity with type char like this : 

http://imgur.com/iy1AiRt

 
just help me of what should i do first and i will continue the rest thanks.
best regards 

2

Jignesh Mehta

--Jignesh Mehta--
3110
| 6 5 8
Surat, India
--Jignesh Mehta--

- I have 3+ years of Industry Experience, specializing Odoo Development, Analysis, Customization, Implementation, Integration.
- I have done many Customization modules in Sale, Purchase, Point of Sale, Inventory, CRM and much more. Also Worked in the Odoo Themes like Business Theme or E-Commerce Theme.
- Develop Jewelery Manufacturing process from Scratch. It have more than 10 Department. Develop PDF and Excel reports for this project around 150 per format.

Jignesh Mehta
On 4/26/16, 8:19 AM

Hello Medmars,


In py

class AccountInvoiceLine(models.Model):

     _inherit = 'account.invoice.line'

     unity = fields.Char('Unity')

In Xml

<record id="account_invoice_line_tree_view_inherit" model="ir.ui.view">

    <field name="name">account.invoice.line.view.inherit</field>

    <field name="model">account.invoice</field>

    <field name="inherit_id" ref="account.invoice_form"/>

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

        <xpath expr="/form/sheet/notebook/page[1]/field[@name='invoice_line_ids']/tree/field[@name='quantity']" position="after">

            <field name="unity"/>

        </xpath>

    </field>

</record>

Hope it will works for you.

Thanks,

is there any method to do it from the developer mode ( odoo 9 )

medmars
on 4/26/16, 9:13 AM

Nope. This is only the possible way to add fields.

Jignesh Mehta
on 4/26/16, 9:16 AM

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.

Register

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

1 follower(s)

Stats

Asked: 4/26/16, 6:58 AM
Seen: 643 times
Last updated: 4/26/16, 10:15 AM