I have a scenario where I need to check a field whether it has exactly 10 numbers not more than 10 neither less than 10.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Use on_change. Create an on_change function that get the some field where is applicated. The function control the field value lenght and validate it.
def YOUR_onchange(self, cr, uid, ids, your_field):
res = {'value':{}}
if not your_field:
return res
if len(your_field) != 10:
res['value']['your_field'] = ''
res['warning'] = {'title':'Error', 'messagge':'Insert 10 chars!'}
return res
Thank you Francesco Apruzzese it was very much usefull...
Can you give an example for this, I used this code but I get attribute error. Please help me through.
Please, open another ask for another problem! This is solved, yet.
Hi, Thanks for your informations. But my requirement is i need to validate fields using java script in openerp 7. Ex : In purchase order line form view i have 2 fields po_qty and pi_qty. If user enter po_qty is greater than pi_qty system should alert using Java script instead of python.
Kindly help me how to achieve this..Thanks in advance
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký