[FIX][report_xls] Protect xlwt import.
Given `xlwt` could happen to not be installed because it is an optional dependency. See https://github.com/odoo/odoo/issues/12897#issuecomment-234928120.pull/62/head
parent
8cc632599d
commit
2bf93a1d49
|
@ -20,8 +20,6 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import xlwt
|
||||
from xlwt.Style import default_style
|
||||
import cStringIO
|
||||
from datetime import datetime
|
||||
from openerp.osv.fields import datetime as datetime_field
|
||||
|
@ -33,6 +31,12 @@ from openerp import pooler
|
|||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
import xlwt
|
||||
from xlwt.Style import default_style
|
||||
except ImportError:
|
||||
_logger.debug("Cannot import xlwt. This module will not be functional.")
|
||||
|
||||
|
||||
class AttrDict(dict):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue