跳至內容
選單
此問題已被標幟
3517 瀏覽次數

Hello All,

I have two fields in odoo10 and after selected one 'service' from first field('selection' type field) then other field visible on form. And i want when other field visible on form view, it visible with the highlight or cursor(action) attraction on that field for focusing on that field. Second visible field visible in notebook/page. So, anyone can help for this type of action.

My python and XML code is here:

Python Code:

service_rental = fields.Selection([
('rental', 'Rental Management'),
('consultant', 'Cunsultant Name'),
('booking', 'Booking'),
], string='Services', copy=False, store=True)

pet_rental_service = fields.Many2one('rental.pet', string="Rental Management")

Xml Code:

<xpath expr="//notebook/page/group/group/field[@name='type']" position="after">
<field name="service_rental" attrs="{'invisible': [('type', '!=', 'service')]}"/>
</xpath>
<xpath expr="//notebook/page[1]" position="before">
<page string="Rental Management" attrs="{'invisible': [('service_rental', '!=', 'rental')]}">
<field name="pet_rental_service"/>
</page>
</xpath>
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
7月 22
8080
2
11月 18
5709
0
2月 25
1194
2
12月 24
1503
0
7月 24
1212