Hi all,
i'm trying to display one custom field on sale.order view only if customer (partner) country_id is equal to 97.This is the code I used - it's not working. Can someone please help. https://ibb.co/wJqDTj1
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
Hi Matija,
Instead of giving the attr in the xpath tag, give it for the field.
Create a related char field in sale.order. Then give condition for the field based on that.
in python,
customer_country_ code= fields.Char(string='Nationality',related='partner_id.country_id.code')
Then in your xml inside the xpath give
Hope this helps
Akshay - this is the method I'm gonna implement - works good. Thank you!
Hello Matija,
You need to give attrs into field.Kindly refer below example.
<field name='amount_untaxed' position='after'>
<field name='custom_untaxed' attrs="{'invisible':[('partner_id.country_id.id','!=','97')]}"
</field>
Thank you - that should do the trick, but there is one more question: How to get partner country id - this is the error I get at the moment
Invalid composed field o.partner_id.country_id.id in attrs.invisible ({'invisible':[('o.partner_id.country_id.id','!=','97')]})
I tried with o.partner_id.country_id.id but it's not working, do you know how to get it?
are you inheriting report xml file of sale order?
Yes, look here https://ibb.co/LSj0tGL
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
0
พ.ย. 17
|
5794 | ||
customer_lead V16
แก้ไขแล้ว
|
|
1
ต.ค. 23
|
1428 | |
|
10
ม.ค. 24
|
17285 | ||
|
1
มี.ค. 15
|
3774 | ||
|
1
มี.ค. 15
|
3564 |