Browse Source

Sep 24: [FIX] Bug Fixed 'ecommerce_barcode_search'

18.0
Risvana Cybro 2 days ago
parent
commit
5d9c59b533
  1. 3
      ecommerce_barcode_search/__init__.py
  2. 7
      ecommerce_barcode_search/__manifest__.py
  3. 15
      ecommerce_barcode_search/controllers/web_product_qr_scan.py
  4. 5
      ecommerce_barcode_search/doc/RELEASE_NOTES.md
  5. 9
      ecommerce_barcode_search/views/templates.xml

3
ecommerce_barcode_search/__init__.py

@ -20,5 +20,6 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import controllers
from . import models
from . import controllers

7
ecommerce_barcode_search/__manifest__.py

@ -22,7 +22,7 @@
###################################################################################
{
'name': 'Ecommerce Barcode Search',
'version': '18.0.1.1.0',
'version': '18.0.1.2.0',
'category': 'Website',
'summary': 'Ecommerce Barcode Search',
'description': 'This module enables users to search for products on the website using barcodes.'
@ -39,7 +39,10 @@
'images': ['static/description/banner.jpg'],
'website': 'https://www.cybrosys.com',
'depends': ['website_sale'],
'data': ['views/website_sale_template.xml'],
'data': [
'views/website_sale_template.xml',
'views/templates.xml',
],
'assets': {
'web.assets_frontend': [
'ecommerce_barcode_search/static/src/js/WebsiteSaleBarcode.js',

15
ecommerce_barcode_search/controllers/web_product_qr_scan.py

@ -33,6 +33,7 @@ class WebsiteProductBarcode(WebsiteSale):
def product_barcode(self,**kwargs):
"""get the last code from barcode detection and pass the url of that product"""
input_data = kwargs.get('last_code')
print('XXXXXXXXXXXXXXX', input_data)
slug = request.env['ir.http']._slug
barcode_product = request.env['product.product'].search([('barcode', '=', input_data)])
request.session['barcode'] = input_data
@ -45,4 +46,18 @@ class WebsiteProductBarcode(WebsiteSale):
else:
return False
@http.route()
def product(self, product, category='', search='', **kwargs):
print("mmmmmmmmmmmmmmmmm")
is_barcode_scanned = kwargs.get('extra_param', 'false')
is_barcode_scanned = is_barcode_scanned.lower() == 'true'
res = super().product(product=product, category=category, search=search)
res.qcontext.update({
'is_barcode_scanned': is_barcode_scanned,
})
print("res.qcontext", res.qcontext)
return res

5
ecommerce_barcode_search/doc/RELEASE_NOTES.md

@ -9,3 +9,8 @@
#### Version 18.0.1.1.0
#### BUG_FIX
- Enabled variant selection on the product page via barcode scanning
#### 23.09.2025
#### Version 18.0.1.2.0
#### BUG_FIX
- Enabled multiple variant selection on the product page via barcode scanning

9
ecommerce_barcode_search/views/templates.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="product_inherit" inherit_id="website_sale.product">
<xpath expr="//t[@t-set='combination_info']" position="replace">
<t t-set="combination_info"
t-value="product._get_combination_info(is_barcode=is_barcode_scanned)"/>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save