Odoo Help

0

Where can fiend mother file of res.company??

By
Drees Far
on 7/24/15, 5:19 AM 916 views

Good Morning ;)

Friends, i have tried to add some fields in the company menu.

I thought that the original file was under /base/view_company_form so i have tried this:

Python :

class seetek_invoice(osv.osv):

_description = "Company Payroll"

_inherit = 'res.company'

_columns = {

'a':fields.many2one('account.analytic.account', 'Analytic Account'),

'j': fields.many2one('account.journal', 'Salary Journal'),

}

XML:

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

<field name="name">res.company.form.inherit</field>

<field name="model">res.company</field>

<field name="inherit_id" ref="base.view_company_form"/>

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

<xpath expr="//page[@string='Report Configuration']" position="after">

<notebook position="inside">

<page string="Payroll">

<group name="payroll_grp" position="inside" string="Information Paie">

<field name="a"/>

<field name="j"/> 

</page>

</notebook>

</xpath>

</field>

</record>

But, nothing happened :/

So, who can help please ?!

What do you mean with nothing happened? Did you update your module? By the way give your variables good names! Don't use one character field names.. Sooner or later that will get you in to trouble!

Yenthe
on 7/24/15, 5:38 AM
3
chirag jogi
On 7/24/15, 8:29 AM

Hello,

you can try like this,

it will get solve your problem,

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

<field name="name">view.company.and.other.details</field>

<field name="model">res.company</field>

    <field name="type">form</field>

        <field name="inherit_id" ref="base.view_company_form" />

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

           <notebook colspan="4" position="inside">

               <page string="Extra Details">

                  <group>

                        <field name="a" />

                        <field name="j" />

                  </group>

              </page>

           </notebook>

    </field>

</record>

-->upvote answer if you get solved your issue

Thanks for the answer but i have resolved my problem. what if you upvote my answer please:)

Drees Far
on 7/24/15, 8:44 AM

Thanks for the answer but i have resolved my problem. what if you upvote my answer please:)

Drees Far
on 7/24/15, 8:44 AM
2

Hello,

As you have done inheritance of view need to write only one line either """<xpath expr="//page[@string='Report Configuration']" position="after">""" or """<notebook position="inside">""". Please write your view as like below. It will working good. 

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

<field name="name">res.company.form.inherit</field>

<field name="model">res.company</field>

<field name="inherit_id" ref="base.view_company_form"/>

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

<notebook position="inside">

<page string="Payroll">

<group name="payroll_grp" position="inside" string="Information Paie">

<field name="a"/>

<field name="j"/>

</page>

</notebook>

</field>

</record>

I am sure that it will help you.

Thanks.

Thanks a lot empiro ;) But you have lost to close the group :/

Drees Far
on 7/24/15, 6:39 AM
0
Drees Far
On 7/24/15, 6:38 AM

Here is the answer and it works perfectly :)

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

<field name="name">res.company.form.inherit</field>

<field name="model">res.company</field>

<field name="inherit_id" ref="base.view_company_form"/>

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

<notebook position="inside">

<page string="Payroll">

<group name="payroll_grp" position="inside" string="Information Paie">

<field name="a"/>

<ield name="j"/>

</group>

</page>

</notebook>

</field>

</record>

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: 7/24/15, 5:19 AM
Seen: 916 times
Last updated: 7/28/15, 9:42 AM