Em có 1 field 'data_evalute': fields.selection([('python','Mã Python'),('sql_query','SQL query'),('user_enter','Người dùng nhập')], 'Dữ liệu đánh gía'),
ở model "category.contract".
- Em tạo thêm một: class evaluation_orther:
có chứa 2 fields:
- 'name': many2one('category.contract'),
- 'note': fields.char('Ghi chú').
Điều kiện hiển thị của fields 'note' là khi thuộc tính của 'data_evalute' có gía trị khác sql_query.
Vậy trong xml, em viết attrs=" " như thế nào ạ.
Em cảm ơn nhiều ạ.
Welcome!
This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.
Tùy biến thuộc tính readonly cho field với domain??
Câu hỏi này đã bị gắn cờ
2
Trả lời
3330
Xem
Nhưng fields 'data_evalute' là của class "category.contract".
Còn 'note' là của class "evaluation_orther". Nếu viết như vậy làm sao để nó hiểu được. Giữa 2 bảng này có một fields many2one.
Hi Nhat Vy,
Bạn có thể viết code trong xml như sau:
<field name="note" attrs="{'invisible': [('data_evalute', '=', 'sql_query')]}"></field>Hy vọng giúp được bạn!