Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error al utilizar tagged value 'groups' #24

Open
mhamra opened this issue Aug 31, 2015 · 0 comments
Open

Error al utilizar tagged value 'groups' #24

mhamra opened this issue Aug 31, 2015 · 0 comments

Comments

@mhamra
Copy link

mhamra commented Aug 31, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant