You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Estimados,
Cuando utilizo un valor tagged group, xmi2odoo arrojaba una excepción en la línea tools.py,9 indicando que faltaban parámetros en "%s,%s"%quote. Luego de hacer algunas pruebas encontré varios errores en la función tag_option y modificandola pude generar el código correctamente.
Pongo el código modificado, favor revisar y si es pertinente incorporan la modificación
def tag_option(obj, name, label=None, default=None, check=True, quote=''', negate=False, translate=False):
if isinstance(name, list):
valid = any(n in obj.tag for n in name)
label = label or name[0]
value = valid and ("%s,%s" % (quote, quote)).join(obj.tag[n] for n in name if n in obj.tag)
else:
valid = name in obj.tag
label = label or name
value = valid and obj.tag[name]
pretrans = "_(" if translate else ""
posttrans = ")" if translate else ""
if check and (not valid if negate else valid):
r = "%s=%s%s%s%s%s" % (label, pretrans, quote, value, quote, posttrans)
else:
r = default
return r
The text was updated successfully, but these errors were encountered:
Estimados,
Cuando utilizo un valor tagged group, xmi2odoo arrojaba una excepción en la línea tools.py,9 indicando que faltaban parámetros en "%s,%s"%quote. Luego de hacer algunas pruebas encontré varios errores en la función tag_option y modificandola pude generar el código correctamente.
Pongo el código modificado, favor revisar y si es pertinente incorporan la modificación
def tag_option(obj, name, label=None, default=None, check=True, quote=''', negate=False, translate=False):
if isinstance(name, list):
valid = any(n in obj.tag for n in name)
label = label or name[0]
value = valid and ("%s,%s" % (quote, quote)).join(obj.tag[n] for n in name if n in obj.tag)
else:
valid = name in obj.tag
label = label or name
value = valid and obj.tag[name]
pretrans = "_(" if translate else ""
posttrans = ")" if translate else ""
if check and (not valid if negate else valid):
r = "%s=%s%s%s%s%s" % (label, pretrans, quote, value, quote, posttrans)
else:
r = default
return r
The text was updated successfully, but these errors were encountered: