mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-23 06:12:01 +02:00
19.0 vanilla
This commit is contained in:
parent
0a7ae8db93
commit
991d2234ca
416 changed files with 646602 additions and 300844 deletions
20
odoo-bringout-oca-ocb-base/odoo/_monkeypatches/xlrd.py
Normal file
20
odoo-bringout-oca-ocb-base/odoo/_monkeypatches/xlrd.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
def patch_module():
|
||||
try:
|
||||
from xlrd import xlsx # noqa: PLC0415
|
||||
except ImportError:
|
||||
xlsx = None
|
||||
else:
|
||||
from lxml import etree # noqa: PLC0415
|
||||
# xlrd.xlsx supports defusedxml, defusedxml's etree interface is broken
|
||||
# (missing ElementTree and thus ElementTree.iter) which causes a fallback to
|
||||
# Element.getiterator(), triggering a warning before 3.9 and an error from 3.9.
|
||||
#
|
||||
# Historically we had defusedxml installed because zeep had a hard dep on
|
||||
# it. They have dropped it as of 4.1.0 which we now require (since 18.0),
|
||||
# but keep this patch for now as Odoo might get updated in a legacy env
|
||||
# which still has defused.
|
||||
#
|
||||
# Directly instruct xlsx to use lxml as we have a hard dependency on that.
|
||||
xlsx.ET = etree
|
||||
xlsx.ET_has_iterparse = True
|
||||
xlsx.Element_has_iter = True
|
||||
Loading…
Add table
Add a link
Reference in a new issue