diff --git a/product_detail_search/doc/RELEASE_NOTES.md b/product_detail_search/doc/RELEASE_NOTES.md index 4f4f20432..40e3f32f2 100755 --- a/product_detail_search/doc/RELEASE_NOTES.md +++ b/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 \ No newline at end of file diff --git a/product_detail_search/models/product_template.py b/product_detail_search/models/product_template.py index bad198f63..a8f0dc354 100755 --- a/product_detail_search/models/product_template.py +++ b/product_detail_search/models/product_template.py @@ -19,7 +19,7 @@ # If not, see . # ############################################################################# -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 diff --git a/product_detail_search/static/description/assets/screenshots/2.png b/product_detail_search/static/description/assets/screenshots/2.png index 81729e682..cb853341b 100644 Binary files a/product_detail_search/static/description/assets/screenshots/2.png and b/product_detail_search/static/description/assets/screenshots/2.png differ diff --git a/product_detail_search/static/description/assets/screenshots/5.png b/product_detail_search/static/description/assets/screenshots/5.png index f87ac7598..fe93f67eb 100644 Binary files a/product_detail_search/static/description/assets/screenshots/5.png and b/product_detail_search/static/description/assets/screenshots/5.png differ