跳至内容
菜单
此问题已终结
1 回复
2615 查看

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  ? 



形象
丢弃
相关帖文 回复 查看 活动
1
7月 25
1420
2
3月 25
1662
0
2月 25
1301
0
2月 25
1526
0
2月 25
1431