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 create multiple fields in a existing module???

By
R.sridevi
on 11/25/13, 8:56 AM 734 views

I want to create extra fields in acounting-> customer invoice.....i want to create two fields below fiscal positon field and three fields below Amount field....plese some body help me

0
Mariusz Mizgier
On 11/25/13, 9:08 AM

You should create a new module, which inherits the new fields (account_invoice__new_fields.py):

class account_invoice(osv.osv):
    _columns = {
        'field1': fields.char('Field1', size=128, help='Field 1 test'),
        'field2': fields.char('Field2', size=128, help='Field 2 test'),
    }

And then in view put them in right position(account_invoice_new_fields_view.xml):

<?xml version="1.0"?>
<openerp>
    <data>
    <record model="ir.ui.view" id="account_invoice_new_view"
        <field name="name">account.invoice.new.form</field>
        <field name="model">account.invoice</field>
        <field name="inherit_id" ref="account.invoice_form"/>
        <field name="arch" ref="xml">
            <field name="fiscal_position" position="after">
                <field name="field1"/>
        </field>
    </record>
    </data>
</openerp>

That should work for you (add also some __init__.py and __openerp__.py

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: 11/25/13, 8:56 AM
Seen: 734 times
Last updated: 3/16/15, 8:10 AM