Skip to content
Snippets Groups Projects
Commit 06139a5c authored by Florent Aide's avatar Florent Aide
Browse files

Merged in z_makrelouf/py3o.template (pull request #47)


[REF]main.py: fix generated VALUE formula in `__prepare_calc_formulas` function

Approved-by: default avatarstephane_bidoul <stephane.bidoul@acsone.eu>
parents 43ec3656 99d4b88d
No related branches found
No related tags found
No related merge requests found
...@@ -993,7 +993,8 @@ ...@@ -993,7 +993,8 @@
value = userfield.attrib[formula_attr] value = userfield.attrib[formula_attr]
userfield.attrib[formula_attr] = re.sub( userfield.attrib[formula_attr] = re.sub(
r'\"?\${([\w.]*?)(?<!odf_value)}\"?', r'\"?\${([\w.]*?)(?<!odf_value)}\"?',
r'VALUE(${getattr(\1, "odf_value", "\"{}\"".format(\1))})', r'VALUE(${\1 if isinstance(\1, (int, float)) '
r'else getattr(\1, "odf_value", "\"{}\"".format(\1))})',
value value
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment