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

I would like to add prefilled country code to mobile numbers field in POS for example (Mobile: +61)


I have tried adding (value = "+61") but there was an error: ValueError: Invalid field '' on model 'res.partner'.


t-att-value="prop.mobile || ''" placeholder="" />

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

i think you are talking about default phone number while creating customer on pos interface.

please note that it is phone field it is not mobile field.

t-att-value="prop.phone || ''" placeholder="" />

if you would like to add mobile field then you have to load mobile field first and add extra input on that xml after phone.

Tác giả

Even if it's prop.phone how would a user add a default value to the field?

Tác giả Câu trả lời hay nhất

previously the mistake was that I have added value="61" after the placeholder, t-att-value="prop.mobile || ''" placeholder="" value="61" /> which did not work and gives an error.

now that I have added the value just near the t-att-value it works, t-att-value="prop.mobile  value="61" || ''" placeholder="" />

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 25
1877
1
thg 7 25
2522
2
thg 7 25
7972
2
thg 7 25
4408
2
thg 7 25
4128