48.Model Constraints || Python Constrains in Odoo || Constrains Decorator In Odoo || api.constrains
HTML-код
- Опубликовано: 1 авг 2024
- Constrains decorator in Odoo can be used to force some criteria's to satisfy before creating and editing the record. Ensure data before saving the record. Working of api.constrains in Odoo. Working of constrains decorator in Odoo. Odoo ORM. Odoo 14 development videos. Odoo 14 development tutorials.
Odoo 14 Playlist: • 2. How To Create Modul...
Module: apps.odoo.com/apps/modules/14...
Website: www.odoomates.tech/
Github: github.com/odoomates
Email : odoomates@gmail.com
Facebook: / odoomate
Twitter: / odoomates
Support Us in Ko Fi : ko-fi.com/odoomates Наука
.. my encouragements for u..keep going ..
❤️❤️❤️
Thanks champ..
welcome bro
Can i use something similar to pre process my data? like, changing the name, like windows when you try to save a file with the same name for example: filename, if you write "filename" then windows is gonna save "filename(1)"
Hi, I don't understand about the part that function check_name() that search([('name','=',rec.name),('id','!=',rec.id)])
Should it be enough with ('name','=',rec.name)? When i check with actual code, search([('name','=',rec.name),('id','!=',rec.id)]) work, but ('name','=',rec.name) didn't.
Can you explain this part please? Thanks you sir.
Oh i get it, it's because when in constrain, we have to ignore the current record, or else, it will always return the record.
This only happen in constrain.
@@futhedude4848 yes you got it
i have 2 modules that are connected in many2many. One is inventory, the other is employees. How do I make it that 1 employee can have many items from inventory, but 1 item can only be used by 1 person at a time. Thanks
by using this contrains itself, you can achieve this, add constrains for the field, then using search orm, check record is having another relation, then show message
Can I apply to Odoo v12, v13?
yes possible
Hi sir, i've a problem that i made a field called "doctor_id" and many2one to res.users. Then use constrain on that field to check if doctor_id is already exists.
But now, the constrain trigger every action i do in doctor model, such as go back to doctors list. How to ignore that, and only trigger the constrain in "save" action?
Thanks.
can i see the added code
@@OdooMates for some reason, my github link are removed automatic, even when i post it without the link format. Do you have any idea on how i can post my code here?
Sir, please check facebook, i've send you the github link through it.
@@futhedude4848 can you drop a email to odoomates@gmail.com
@@OdooMates yes sir, i'll do that as soon as posible
Hi sir thx for your videos
i'm trying to add sql_constraints on res_partner model without any result
i ll be glad if you could help me
thx you
if there is already some data that violates the constrains in the db, it will not work
@@OdooMatesyes i have 6 users in res_partner model
Error while installing pos v14
line 315, in _handle_exception raise exception.with_traceback(None) from new_cause odoo.tools.convert.ParseError: while parsing /home/kamal/odoo/odoo14/odoo14/addons/point_of_sale/data/point_of_sale_data.xml:49, near
Can you try with the latest odoo source code
@@OdooMates Hi I hope you are doing well I want to Upload I module to Odoo app store that module depend on multiple modules how i Can manage All module in one app thanks in advance