[IMP] Allow openerp.tools.convert_file() to optionally take the full path name

bzr revid: fme@openerp.com-20140319084931-1ipjqi2dd3ug7i2t
This commit is contained in:
Fabien Meghazi 2014-03-19 09:49:31 +01:00
parent 8f8ca3bd84
commit 43419ed6e9
1 changed files with 3 additions and 2 deletions

View File

@ -952,8 +952,9 @@ form: module.record_id""" % (xml_id,)
'url': self._tag_url
}
def convert_file(cr, module, filename, idref, mode='update', noupdate=False, kind=None, report=None):
pathname = os.path.join(module, filename)
def convert_file(cr, module, filename, idref, mode='update', noupdate=False, kind=None, report=None, pathname=None):
if pathname is None:
pathname = os.path.join(module, filename)
fp = misc.file_open(pathname)
ext = os.path.splitext(filename)[1].lower()
try: