Skip to content

Commit

Permalink
[ADD]python-snippets: import logging and odoo exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatnm0612 authored and jat-odoo committed Sep 3, 2021
1 parent 5ff49ce commit 3ea8d40
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Prefix | Purpose
------------ | -------------
manifest | Add manifest json
import | Add an import
feimport | Add an import from odoo exceptions
limport | Add an import from logging and create logger
fimport | Add an import from
model | Add model
fchar | Add char field
Expand Down
16 changes: 16 additions & 0 deletions snippets/python-snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@
],
"description": "Add an import"
},
"From exceptions import": {
"prefix": "oofeimport",
"body": [
"from odoo.exceptions import ${100|ValidationError,RedirectWarning,AccessDenied,AccessError,CacheMiss,MissingError,UserError|}",
],
"description" : "Add an import from odoo exceptions"
},
"Import logging": {
"prefix": "oolimport",
"body": [
"import logging",
"\n\n_logger = logging.getLogger(__name__)",
"\n"
],
"description" : "Add an import from logging and create logger"
},
"From import": {
"prefix": "oofimport",
"body": "from . import ${1:names}",
Expand Down

0 comments on commit 3ea8d40

Please sign in to comment.