Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2627 Представления

Hello 
I have a very basic question 

Is it possible to do custom validation on a field in odoo studio ?
I tried wit an action and python code, but without success ...

I could not find any doc or presentation showing this ... event a basic validation ( > 0, regex, etc ...

Thanks


Аватар
Отменить
Автор Лучший ответ

Answering partially my own question 

MAnaged to do it with this (not sure that thebest way) 
if record.x_studio_capacity <= 0 :
    raise UserError('Capacity should be positive')

What about validate with other records ?
Like to save a reservation, I want to check that another record is not reserved during the same period (start_date / end_date) 
possible  ? 



Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
июл. 25
1439
2
мар. 25
1673
0
февр. 25
1314
0
февр. 25
1541
0
февр. 25
1448