Skip to content

Commit 6c40fad

Browse files
committed
Merge branch 'temp' into develop
2 parents 53206d6 + e03ef19 commit 6c40fad

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

snippets/python.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,17 @@
214214
],
215215
"description": "Add a method compute"
216216
},
217+
"odoo_method_constrains": {
218+
"prefix": "omconst",
219+
"body": [
220+
"@api.constrains('${1:field_name}')",
221+
"def _check_${1:field_name}(self):",
222+
"\tif 1==1:",
223+
"\t\traise ValidationError()",
224+
"$0"
225+
],
226+
"description": "Add a constraint method"
227+
},
217228
"odoo_method_onchange": {
218229
"prefix": "omchange",
219230
"body": [

0 commit comments

Comments
 (0)