mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[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.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user