Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD]python-snippets: import logging and odoo exceptions #39

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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