Friday, April 26, 2024
2 changes · saas-17.2
Resolved issues and error corrections
Fixed an issue where email marketing messages could fail to send when a template contained social media icons or buttons without a web link. This helps users send standard marketing templates reliably without hidden errors blocking delivery.
Original PR description
Currently, an exception is generated when the user sends a template to a mailing that contains icons like Facebook, LinkedIn, etc. Steps to produce an exception: 1. Create a database without demo…
Currently, an exception is generated when the user sends a template to a mailing that contains icons like Facebook, LinkedIn, etc. Steps to produce an exception: 1. Create a database without demo data > install 'Email Marketing'. 2. Go to Email Marketing > Create New > Select the `Welcome Message` template. 3. Click 'Send' >> An error will occur in the log, and there is nothing to send. Error: `AttributeError: 'NoneType' object has no attribute 'startswith'` This is because at [1], we don't have `href` in 'link_node', so we receive `False` in 'original_url', and as a result, it generates an error while accessing 'original_url.startswith'. With the recently refactored code with commit https://github.com/odoo/odoo/commit/6349051e5e4442cfabc899520c5708081dc0be31, line [1] was added. Before this change, Line [2] was filtering out elements from `html` that did not have 'href'. This commit will fix the above issue by not processing to find the absolute URL if we do not have `original_url`. [1]- https://github.com/odoo/odoo/blob/b6629bbdb53d9a4bacee2032190e30a848bb6d6d/addons/link_tracker/tools/html.py#L25 [2]- https://github.com/odoo/odoo/blob/c9644a086b294e69b69e52e8ccfd5292bde815da/addons/link_tracker/models/mail_render_mixin.py#L39 sentry-5140192785
Miscellaneous changes
The recent commit https://github.com/odoo/enterprise/commit/b12fc61af033f8914529d86a3edb464fc951f7dc changed the way a move is created during the import of a new peppol document. Before, we were passing a default value for `extract_can_show_send_button`, but now we try to set this field to `False` directly in create values. However, this field only exists in enterprise and thus things break if a user is only using community. Also, it's a computed readonly field, so it is better to use `is_in_ext
Original PR description
The recent commit https://github.com/odoo/enterprise/commit/b12fc61af033f8914529d86a3edb464fc951f7dc changed the way a move is created during the import of a new peppol document. Before, we were passing a default value for `extract_can_show_send_button`, but now we try to set this field to `False` directly in create values. However, this field only exists in enterprise and thus things break if a user is only using community. Also, it's a computed readonly field, so it is better to use `is_in_extractable_state` for this purpose. no task, fixing the error highlighted by tests --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#163507