Browse Source

July 02: [FIX] Bug Fixed 'product_detail_search'

pull/331/head
RisvanaCybro 10 months ago
parent
commit
adae580885
  1. 6
      product_detail_search/doc/RELEASE_NOTES.md
  2. 12
      product_detail_search/models/product_template.py
  3. BIN
      product_detail_search/static/description/assets/screenshots/2.png
  4. BIN
      product_detail_search/static/description/assets/screenshots/5.png

6
product_detail_search/doc/RELEASE_NOTES.md

@ -5,3 +5,9 @@
#### ADD
- Initial commit for Find Products in Pos and Stock using Barcode
#### 01.07.2024
#### Version 17.0.1.0.0
##### FIX
- Product Type Bug Fix

12
product_detail_search/models/product_template.py

@ -19,7 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import models
from odoo import models,_
class ProductTemplate(models.Model):
@ -27,12 +27,18 @@ class ProductTemplate(models.Model):
method"""
_inherit = 'product.template'
def get_selection_label(self, object, field_name, field_value):
return _(dict(
self.env[object].fields_get(allfields=[field_name])[field_name][
'selection'])[field_value])
def product_detail_search(self, barcode):
"""Find the details for the product When the barcode Scan is
Detected"""
product = self.env['product.product'].search(
[('barcode', '=', barcode)])
if product:
product_type = self.get_selection_label('product.product','detailed_type',product.detailed_type)
product_details = [
{'id': product.id,
'display_name': product.display_name, 'name': product.name,
@ -57,6 +63,10 @@ class ProductTemplate(models.Model):
else:
extra_details.update({'tax_amount': 'No tax',
'specification': specification})
if product_type:
extra_details.update({'detailed_type': product_type})
else:
extra_details.update({'detailed_type': False})
product_details[0].update(extra_details)
else:
product_details = False

BIN
product_detail_search/static/description/assets/screenshots/2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

After

Width:  |  Height:  |  Size: 98 KiB

BIN
product_detail_search/static/description/assets/screenshots/5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 517 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Loading…
Cancel
Save