Skip to content

Commit

Permalink
[FIX] website_sale_digital: search domain for attachment count
Browse files Browse the repository at this point in the history
Before this commit, the search domain returns no results.

Fine-tuning of 62c9ded

opw-2172563
  • Loading branch information
jpp-odoo committed Jan 16, 2020
1 parent 68302c6 commit f3d178c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/website_sale_digital/models/product.py
Expand Up @@ -44,8 +44,8 @@ def _compute_attachment_count(self):
for product in self:
product.attachment_count = self.env['ir.attachment'].search_count([
'|',
('res_model', '=', 'product.template'), ('res_id', '=', product.product_tmpl_id.id), ('product_downloadable', '=', True),
('res_model', '=', 'product.product'), ('res_id', '=', product.id), ('product_downloadable', '=', True)])
'&', '&', ('res_model', '=', 'product.template'), ('res_id', '=', product.product_tmpl_id.id), ('product_downloadable', '=', True),
'&', '&', ('res_model', '=', 'product.product'), ('res_id', '=', product.id), ('product_downloadable', '=', True)])

@api.multi
def action_open_attachments(self):
Expand Down

0 comments on commit f3d178c

Please sign in to comment.