-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bfa7bb
commit c1ffc99
Showing
5 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import res_partner | ||
from . import fetchmail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from odoo import models, tools, _ | ||
from odoo.tools import misc | ||
from odoo.tools.misc import find_in_path | ||
from odoo.tools import config, consteq, file_path | ||
from odoo.tools.misc import lazy | ||
from odoo.tools import config, consteq, file_path | ||
from ssl import SSLError | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class FetchMailServer(models.Model): | ||
_inherit = "fetchmail.server" | ||
|
||
def example_method_use_ustr(self): | ||
try: | ||
server_name = self.name | ||
description = self._description | ||
connection = self.connect(allow_archived=True) | ||
except SSLError as e: | ||
raise UserError(_(e)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import res_partner | ||
from . import fetchmail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from odoo import models, tools, _ | ||
from odoo.tools import misc | ||
from odoo.tools import ustr | ||
from odoo.tools.misc import ustr | ||
from odoo.tools.misc import ustr, find_in_path | ||
from odoo.tools import ustr, config, consteq, file_path | ||
from odoo.tools.misc import lazy, ustr | ||
from odoo.tools import config, consteq, ustr, file_path | ||
from ssl import SSLError | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class FetchMailServer(models.Model): | ||
_inherit = "fetchmail.server" | ||
|
||
def example_method_use_ustr(self): | ||
try: | ||
server_name = ustr(self.name) | ||
description = misc.ustr(self._description) | ||
connection = self.connect(allow_archived=True) | ||
except SSLError as e: | ||
raise UserError(_(tools.ustr(e))) |