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

[15.0] [FIX] Prevent error when the result is empty #1392

Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion mail_activity_board/models/mail_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ def _search(
count=count,
access_rights_uid=access_rights_uid,
)
if limit is not None:
if limit is not None and result:
result = result[:limit]
return result
2 changes: 1 addition & 1 deletion mail_preview_base/static/src/js/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ odoo.define("mail_preview_base.preview", function (require) {
}),
init: function () {
this._super.apply(this, arguments);
this.mimetype_value = this.recordData.mimetype;
this.mimetype_value = this.recordData[this.attrs.mimetype];
},
_previewFile: function (event) {
event.stopPropagation();
Expand Down
1 change: 1 addition & 0 deletions mail_preview_base/views/ir_attachment_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='datas']" position="attributes">
<attribute name="widget">preview_binary</attribute>
<attribute name="mimetype">mimetype</attribute>
</xpath>
</field>
</record>
Expand Down
Loading