Skip to content

Commit

Permalink
[FIX] website_apps_store: Proper attachment field name
Browse files Browse the repository at this point in the history
Fixes #78
  • Loading branch information
pedrobaeza committed Dec 26, 2020
1 parent 42a3339 commit 48d0855
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion website_apps_store/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Website Apps Store",
"version": "13.0.1.1.1",
"version": "13.0.1.1.2",
"author": "Odoo Community Association (OCA), BizzAppDev",
"website": "https://github.com/OCA/apps-store",
"license": "AGPL-3",
Expand Down
8 changes: 3 additions & 5 deletions website_apps_store/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def download_product_zip(
self.validate_recaptcha(google_captcha)
if not product:
product = product_tmpl.get_version_info()

attachment = (
request.env["ir.attachment"]
.sudo()
Expand All @@ -230,12 +229,11 @@ def download_product_zip(
limit=1,
)
)

if attachment:
filecontent = base64.b64decode(attachment.datas)
disposition = 'attachment; filename="%s"' % attachment.datas_fname
# increasing count for the product download
product.sudo().download_count = product.sudo().download_count + 1
disposition = 'attachment; filename="%s"' % attachment.name
# increasing count for the product downloadg
product.sudo().download_count += 1
return request.make_response(
filecontent,
[
Expand Down

0 comments on commit 48d0855

Please sign in to comment.