Skip to content

Commit

Permalink
8.0 Use try/except when importing external libs (#8)
Browse files Browse the repository at this point in the history
[FIX] LINT

Use try/except when importing external libs
Remove self.ensure_one() that has nothing to do in an api.model method
  • Loading branch information
Alexis de Lattre authored and nguyenminhchien committed Feb 20, 2024
1 parent c5da791 commit 6274925
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
from openerp import models, api, _
from openerp.tools import float_compare
from openerp.exceptions import Warning as UserError
import PyPDF2
from lxml import etree
from StringIO import StringIO
import mimetypes
from urlparse import urlparse
import logging

logger = logging.getLogger(__name__)

try:
import PyPDF2
except ImportError:
logger.debug('Cannot import PyPDF2')


class BusinessDocumentImport(models.AbstractModel):
_name = 'business.document.import'
Expand Down

0 comments on commit 6274925

Please sign in to comment.