Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1632 มุมมอง

Hi all

in learning purposes I inherited the contact view , and I have weird behavior when I try to replace the phone field, but with other fields, website for example it's work 

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_form" model="ir.ui.view" >
<field name="model">res.partner</field>
<field name="priority">98</field>
<field name="inherit_id" ref="base.view_partner_form"/>

<field name="arch" type="xml">
<field name="website" position="replace">
</field>

</field>
</record>
</odoo>

Code above  work the field website is deleted from  the form but when i try with phone like he code 

<field name="phone" position="replace">
</field>

i get the error below

<form string="Partners" __validate__="1">
<div class="alert alert-warning oe_edit_only" role="alert" name="warning_tax" invisible="not same_vat_partner_id">
A partner with the same <span><span class="o_vat_label">Tax ID</span></span> already exists (<field name="same_vat_partner_id" context="{'show_address': False, 'show_vat': False}"/>

Name or id 'phone' in <label for="..."> must be present in view but is missing.

any idea where the problem could come from




อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

The error you are getting indicates that the `phone` field you are trying to replace is not present in the legacy view.  (`base.view_partner_form`) at the time your custom view is applied. This is often because the `phone` field can only be displayed under certain conditions, such as when a specific module is installed or when certain configurations are enabled. 

Sources: https://planet-clicker.com/

อวตาร
ละทิ้ง
ผู้เขียน

by the way I followed a tutorial, the trainer was able to hide the phone field, I will check it, may be that my odoo version is more recent

Related Posts ตอบกลับ มุมมอง กิจกรรม
Change the Position of field in Xpath แก้ไขแล้ว
5
ก.ค. 24
92891
1
ธ.ค. 23
3045
1
พ.ค. 22
3639
0
ม.ค. 20
2891
1
ส.ค. 19
3143