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 value to an existing one in a column? Openerp 7

By
Giovanny Vizcaya
on 2/9/15, 11:25 AM 370 views

Good day, I am developing a module that registers quarterly earnings in an account of an employee, I have a column that records the accumulated income, for this I must add the new entry to accumulated earnings, how I can do this? I'm working with OpenERP 7

1

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 2/10/15, 1:10 AM

Hi ,

you can add the custom field by using inheritance.B

In the .py file:

class your_first_model(orm.Model):
    _name="first.model"
    _columns={
            'your_field1':fields.char('New Field1')
}

class your_second_model(orm.Model):

    _name="second.model"
    _inherit="first.model"
    _columns={
            'your_field2':fields.char('New Field2')
}

 

in the xml view:

        <record id="your_first_model_form" model="ir.ui.view">
            <field name="name">your.first,model</field>
            <field name="model">first.model</field>
            <form string="sample">
                    <field name="your_field1" />
                </form>
            </field>
        </rec

        <record id="your_second_model_form__inherit" model="ir.ui.view">
            <field name="name">your.second.model_</field>
            <field name="model">second.model</field>
            <field name="inherit_id" ref="your_first_model_form"/>
                <field name="your_field1" position="after">

                     <field name="your_field2" />
                </field>
            </field>
        </record>

0
Giovanny Vizcaya
On 2/10/15, 9:42 AM

Not working

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: 2/9/15, 11:25 AM
Seen: 370 times
Last updated: 3/16/15, 8:10 AM