Комментарии:
Great explanation. Thank you!
ОтветитьPerfect. Thank you
Ответитьit's not working in odoo 15
ОтветитьThank you. You are doing great work. 👍👍👍
Ответитьafter doing this it's always related by id per default not by the field that i need , why?
Ответить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.
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......')]