Odoo Ayuda

0

0
2 Answers
1
Avatar

Mitul Shingala

--Mitul Shingala--
--Mitul Shingala--

Odoo Developer

Mitul Shingala
14/6/19 2:58

hello

 please check the sms and mail module, into that the field phone and email is inherited and replace. so if you want to hide that field you have inherit the sms  and mail module.

Hope this will helps you.

Thank you.

2 Comments
Antonio Condez
14/6/19 3:44

Thanks man.. You are right.. I was able to hide the fields by inheriting the view in mail (for email).. And still have to work with the other fields. But your answer really helps me a lot..

Antonio Condez
14/6/19 3:52

For someone's reference here's what I did:

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

<field name="name">res.partner.view.form.inherit.mail2</field>

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

<field name="inherit_id" ref="mail.res_partner_view_form_inherit_mail"/>

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

<xpath expr="//label[@for='email']" position="attributes">

<attribute name="groups">my_module.group_admin,my_module.group_read_only</attribute>

</xpath>

<xpath expr="//field[@name='email']" position="attributes">

<attribute name="groups">my_module.group_admin,my_module.group_read_only</attribute>

</xpath>

</field>

</record>

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

<field name="name">partner_form_send_sms_form_view2</field>

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

<field name="inherit_id" ref="sms.partner_form_send_sms_form_view"/>

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

<xpath expr="//label[@for='phone']" position="attributes">

<attribute name="groups">my_module.group_admin,my_module.group_read_only</attribute>

</xpath>

<xpath expr="//label[@for='mobile']" position="attributes">

<attribute name="groups">my_module.group_admin,my_module.group_read_only</attribute>

</xpath>

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

<attribute name="groups">my_module.group_admin,my_module.group_read_only</attribute>

</xpath>

<xpath expr="//field[@name='mobile']" position="attributes">

<attribute name="groups">my_module.group_admin,my_module.group_read_only</attribute>

</xpath>

</field>

</record>

1
Avatar

Anu

--Anu--

1819
| 5 2 5
Malappuram, India
--Anu--

Odoo developer

Anu
14/6/19 2:42

Hi,

   In order to hide a field use

<record id="contacts_custom_fields" model="ir.ui.view">
    <field name="name">contacts.custom.fields</field>        
    <field name="model">res.partner</field>        
    <field name="type">form</field>        
    <field name="inherit_id" ref="base.view_partner_form"/>        
    <field name="arch" type="xml">
<xpath expr="//field[@name='field_name']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>

</field>

</record>

           

1 Comentario
Antonio Condez
14/6/19 3:42

Thanks for your response. In this case, Mitul Shingala is right.. The answer you provided did hide but only the input field..

Realizar una pregunta
Etiquetas
Keep Informed
1 seguidor(es)
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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now