How to pass value from xml file to .py file by using context tag. please explain with an example
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
hi shameem,
you can pass the context values by the xml by following ways:
1. For the window action,
<record id="product_normal_action_tree" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,kanban</field>
<field name="context">{'categ_id':active_id, 'search_default_categ_id':active_id}</field>
</record>
2. foe a particular field
<field name="name" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"/>
3. for a filter.
<filter string="Pending Tasks" domain="[('state','=','pending')]" context="{'show_delegated':False}"/>
Hello shameem,
follow this link hope may be help full
https://www.odoo.com/forum/help-1/question/what-is-context-58824
if you find this answer helpful, please give me a thumbs up vote
Thanks & Regards,
Ankit H Gandhi
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
5
ก.ย. 20
|
7737 | ||
|
1
ต.ค. 19
|
5822 | ||
|
0
ก.พ. 19
|
5545 | ||
|
2
พ.ย. 18
|
6519 | ||
|
0
พ.ค. 18
|
2602 |