跳至内容
菜单
此问题已终结
5 回复
6392 查看

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>

形象
丢弃
相关帖文 回复 查看 活动
0
3月 25
1180
0
1月 25
3240
1
8月 23
14522
1
8月 23
13212
1
7月 23
10218