Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
5 Відповіді
6197 Переглядів

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!

Найкраща відповідь

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:)

Автор

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

Найкраща відповідь

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 :/

Автор Найкраща відповідь

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>

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
бер. 25
656
0
січ. 25
2812
1
серп. 23
13784
change password Вирішено
1
серп. 23
12589
1
лип. 23
9720