82. Sql Constraints In Odoo || Constrains In Odoo || Odoo 15 Field Validations

82. Sql Constraints In Odoo || Constrains In Odoo || Odoo 15 Field Validations

Odoo Mates

2 года назад

5,940 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Олексій Степанюк
Олексій Степанюк - 26.06.2023 10:41

Great explanation. Thank you!

Ответить
ايجى فيرست
ايجى فيرست - 22.02.2023 19:44

Perfect. Thank you

Ответить
EVENTDZ
EVENTDZ - 18.10.2022 20:19

it's not working in odoo 15

Ответить
wild beauty
wild beauty - 22.09.2022 09:26

Thank you. You are doing great work. 👍👍👍

Ответить
Kenza Souabni
Kenza Souabni - 22.07.2022 13:26

after doing this it's always related by id per default not by the field that i need , why?

Ответить
fu the dude
fu the dude - 26.05.2022 07:10

this _sql_constraints have a huge weakness that if there's already some records which have values violates the rules, then that rule is not affected.
in that case, we should use @api.constrains instead.
in fact, this is not good to use, i recommend to use @api.constrains instead of _sql_constraints in every posible way.

Ответить
Muthaiyan Selvam
Muthaiyan Selvam - 13.05.2022 09:20

Hiiiiiii....Odoomates.... i'm regularly following your videos...thanks for your past & future videos........ currently i'm using the odoo14 version..... i tried this sql_constraints............not working in my system............
please advice me



class HospitalToggles(models.Model):
_name = "patient.toggle"
_description = 'Hospital Appointment'
name = fields.Char(string='Name')

_sql_constraints = [('unique_toggle_name', 'unique(name)', 'name is unique......')]

Ответить