コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2319 ビュー

Hello,


I want to create two field for email adresses for my contacts and I want to erase the mobile field? How can I achieve that? I'm only using the contact app and helpdesk. Odoo 16

Thanks

アバター
破棄
著作者 最善の回答

Hello,


Is there no easier way to do so because I'm not confortable with the XML.

Thanks for your response though

アバター
破棄
最善の回答

Hi,

Try like following code

class ResPartners(models.Model):
_inherit = 'res.partner'
email_test = fields.Char(string='Email Test')

In .xml

<odoo>


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


        <field name="name">res.partner.form</field>


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


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


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


            <xpath expr="//form/sheet/group/group/field[@name='email']" position="after">


                <field name="email_test"/>


            </xpath>


            <xpath expr="//form/sheet/group/group/field[@name='phone']" position="attributes">


            <attribute name="invisible">1</attribute>


        </field>


    </record>


</odoo>


Regards

アバター
破棄
関連投稿 返信 ビュー 活動
0
3月 24
1794
2
7月 25
1269
0
2月 25
1671
0
1月 25
1424
1
12月 24
1844