Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5662 Lượt xem

Hello All,

I have some fields with widget parameter in xml. And these fields are readonly, when no value inserted in these fields these always show false. So, how to remove false from these fields. I sharing my code as well as screenshot for this problem.

<group>
<field name="partner_id" required="1"
string="Customer"
domain="[('customer', '=', True),('internal_user', '=', False)]"
context="{'search_default_customer': 1,
'default_name': partner_name, 'default_street': street,
'default_street2': street2, 'default_city': city,
'default_state_id': state_id, 'default_zip': zip,
'default_country_id': country_id, 'default_function': function,
'default_phone': phone, 'default_mobile': mobile,
'default_email': email_from,
'default_user_id': user_id, 'default_team_id': team_id, 'default_website': website}"
/>

<field name="email_from" string="Email" widget="email" readonly="1"/>
<field name="phone" widget="phone" readonly="1"/>
<field name="website" widget="url" placeholder="e.g. www.sunarctechnologies.com"
readonly="1"/>
</group>


Thanks in Advance

Ảnh đại diện
Huỷ bỏ

try this one: value=""

Câu trả lời hay nhất

Hello, it shows false beceause of your field is null, you can correct this by setting the default value in your field like the following exemeple :

status_ouverage = fields.Selection([('demande', 'Demandé'), ('approuve', 'Acceptée')], readonly=False, ='demande' )
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello,

Can you please tell of which "type" the fields are you have created?

In the model you can define the field type, make sure this is set correctly for the fields you created:

https://doc.odoo.com/6.0/developer/2_5_Objects_Fields_Methods/field_type/

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
9
thg 9 20
44712
1
thg 10 24
1469
1
thg 3 25
6181
0
thg 1 24
4512
1
thg 5 16
3317