Browse Source

[FIX] Bug Fixed 'website_product_attachments'

pull/165/head
Ajmal JK 5 years ago
parent
commit
7126050b46
  1. 2
      website_product_attachments/__manifest__.py
  2. 7
      website_product_attachments/controllers/website_product_attachment.py
  3. 4
      website_product_attachments/doc/RELEASE_NOTES.md
  4. 16
      website_product_attachments/static/description/index.html

2
website_product_attachments/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Product Attachments on Website',
'version': '13.0.1.0.0',
'version': '13.0.1.0.1',
'summary': """This Module Allows Customer to Download Documents
That Are Attached to the Products From Website""",
'description': 'This Module allows customer to download documents '

7
website_product_attachments/controllers/website_product_attachment.py

@ -60,7 +60,7 @@ class WebsiteSale(WebsiteSale):
product_context['pricelist'] = pricelist.id
product = product.with_context(product_context)
attachments = request.env['ir.attachment'].search(
attachments = request.env['ir.attachment'].sudo().search(
[('res_model', '=', 'product.template'),
('res_id', '=', product.id)], order='id')
@ -95,10 +95,7 @@ class WebsiteSale(WebsiteSale):
@http.route(['/attachment/download',], type='http', auth='public')
def download_attachment(self, attachment_id):
# Check if this is a valid attachment id
attachment = request.env['ir.attachment'].sudo().search_read(
[('id', '=', int(attachment_id))],
["name", "datas", "res_model", "res_id", "type", "url"]
)
attachment = request.env['ir.attachment'].sudo().search([('id', '=', int(attachment_id))])
if attachment:
attachment = attachment[0]

4
website_product_attachments/doc/RELEASE_NOTES.md

@ -4,3 +4,7 @@
#### Version 13.0.1.0.0
#### ADD
Initial Commit for website_product_attachments.
#### 30.07.2020
#### Version 13.0.1.0.1
#### UPDT

16
website_product_attachments/static/description/index.html

@ -7,8 +7,8 @@
</div>
<h2 style="font-weight: 600;font-size: 1.8rem;margin-top: 15px;">Key Highlights</h2>
<ul style=" padding: 0 1px; list-style: none; ">
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i>Allows users to attach documents. </li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i>Download attachments from website. </li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Allows users to attach documents. </li>
<li style="display: flex;align-items: center;padding: 8px 0;font-size: 18px;"><img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Download attachments from website. </li>
</ul>
</div>
<div class="col-md-5 col-sm-12 col-xs-12"> <img src="images/product.png" class="img-responsive" alt=""> </div>
@ -52,7 +52,7 @@
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<ul>
<li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i> No additional configuration required.
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> No additional configuration required.
</li>
</ul>
</div>
@ -63,10 +63,10 @@
<hr style="margin-top: 0px;margin-bottom: 2%;border: 0;text-align: center;border-top: 3px solid #d21c22;width: 5%;">
<ul>
<li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i>Allows users to attach documents.
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Allows users to attach documents.
</li>
<li class="mb8" style="font-family: Roboto;color: #000;list-style-type: square;font-size: 19px;line-height: 50px; background-color: #3a34380d;padding-left: 20px;border-radius: 7px;list-style: none;">
<i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i> Download attachments from website.
<img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check"> Download attachments from website.
</li>
</ul>
</div>
@ -81,21 +81,21 @@
<div class="carousel-inner">
<div class="carousel-item active" style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i>Attach your documents like, product specification on product master. </h3>
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Attach your documents like, product specification on product master. </h3>
<div style=""> <img class="img img-responsive center-block" style="border-top-left-radius: 10px;border-top-right-radius: 10px;" src="images/product form.png"> </div>
</div>
</div>
<div class="carousel-item" style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i>Allow to attach multiple documents for products. </h3>
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Allow to attach multiple documents for products. </h3>
<div style=""> <img class="img img-responsive center-block" style="border-top-left-radius: 10px;border-top-right-radius: 10px;" src="images/attachments.png"> </div>
</div>
</div>
<div class="carousel-item" style="min-height: 0px;">
<div class="col-xs-12 col-sm-12 col-md-12 mb16 mt16" style="float: left;">
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <i class="fa fa-check-circle-o" style="width:40px; color:#07B700"></i>Visitors of your e-commerce portal can download these attachments. </h3>
<h3 class="alert" style="font-weight:400;color: #091E42;background: #fff;text-align: left;border-radius: 0; font-size: 18px;"> <img src="images/checked.png" style=" width: 22px; margin-right: 6px; " alt="check">Visitors of your e-commerce portal can download these attachments. </h3>
<div style=""> <img class="img img-responsive center-block" style="border-top-left-radius: 10px;border-top-right-radius: 10px;" src="images/website.png"> </div>
</div>
</div>

Loading…
Cancel
Save