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

[16.0][FIX] l10n_nl_xaf_auditfile_export: parse EntityRef error #398

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion l10n_nl_xaf_auditfile_export/models/ir_qweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class IrQwebAuditfileStringWidget999(models.AbstractModel):
@api.model
def value_to_html(self, value, options):
value = value[: self._max_length] if value else ""
return super().value_to_html(value, options)
res = super().value_to_html(value, options)
return str(res) # From markup to string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some tests with the help of #399, and indeed I'm running into the xmlParseEntityRef: no name error in cases where a field contains an ampersand.

However your fix only addresses cases where the widget is used. I found that changing xml.unescape() to str(xml) over here addresses the issue for all fields, regardless of the widget used (mine was here)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your approach, I think is the correct way. Is it ok for you to fix it directly in your PR, so that we can close this one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep both things separated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now done in #410



class IrQwebAuditfileStringWidget9(models.AbstractModel):
Expand Down
Loading