diff --git a/barcode_scrap/README.rst b/barcode_scrap/README.rst new file mode 100644 index 000000000..fc7a673e8 --- /dev/null +++ b/barcode_scrap/README.rst @@ -0,0 +1,30 @@ +Barcode scanning support for Scrapping v10 +========================================== + +This module will used for barcode scanning in product scrapping. +Depends +======= +[stock] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/10.0/setup/install.html +- Install our custom addon + +License +======= +GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Credits +======= +Cybrosys Techno Solutions + +Authors +------- +* Sreejith P diff --git a/barcode_scrap/__init__.py b/barcode_scrap/__init__.py new file mode 100644 index 000000000..a0fdc10fe --- /dev/null +++ b/barcode_scrap/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/barcode_scrap/__manifest__.py b/barcode_scrap/__manifest__.py new file mode 100644 index 000000000..31010f929 --- /dev/null +++ b/barcode_scrap/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Sreejith P() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': 'Barcode scanning support for Scrapping', + 'version': '10.0.1.0.0', + 'summary': 'Use Barcode Scanner in Scrapping.', + 'category': 'Inventory', + 'author': 'Cybrosys Techno solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['stock'], + 'data': [ + 'views/scrap_view.xml', + ], + 'installable': True, + 'application': False, + 'auto_install': False, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', +} diff --git a/barcode_scrap/models/__init__.py b/barcode_scrap/models/__init__.py new file mode 100644 index 000000000..e4876ecf7 --- /dev/null +++ b/barcode_scrap/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import stock_scrap diff --git a/barcode_scrap/models/stock_scrap.py b/barcode_scrap/models/stock_scrap.py new file mode 100644 index 000000000..6ec08f6e8 --- /dev/null +++ b/barcode_scrap/models/stock_scrap.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api +from odoo.exceptions import Warning + + +class StockScrap(models.Model): + _inherit = 'stock.scrap' + + barcode = fields.Char(string='Barcode') + + @api.onchange('barcode') + def barcode_scrap(self): + if self.barcode: + if not self.product_id: + product = self.env['product.product'].search([('barcode', '=', self.barcode)]) + if product: + if self.barcode == product.barcode: + self.product_id = product.id + if not self.scrap_qty == 1: + self.scrap_qty += 1 + self.barcode = None + else: + self.barcode = None + raise Warning('There is no product available for this barcode.' + 'Please check you scanned the correct one') + else: + if self.barcode == self.product_id.barcode: + self.scrap_qty += 1 + self.barcode = None + else: + self.barcode = None + raise Warning('You sure about the product.!' + 'Please check you scanned the correct one') diff --git a/barcode_scrap/static/description/banner.jpg b/barcode_scrap/static/description/banner.jpg new file mode 100644 index 000000000..0926d6087 Binary files /dev/null and b/barcode_scrap/static/description/banner.jpg differ diff --git a/barcode_scrap/static/description/cybro_logo.png b/barcode_scrap/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/barcode_scrap/static/description/cybro_logo.png differ diff --git a/barcode_scrap/static/description/icon.png b/barcode_scrap/static/description/icon.png new file mode 100644 index 000000000..53e3934d0 Binary files /dev/null and b/barcode_scrap/static/description/icon.png differ diff --git a/barcode_scrap/static/description/index.html b/barcode_scrap/static/description/index.html new file mode 100644 index 000000000..d50bbc397 --- /dev/null +++ b/barcode_scrap/static/description/index.html @@ -0,0 +1,67 @@ +
+
+

Barcode Support for Scrapping

+

Use Barcode scanner to scrap the products

+ +

Cybrosys Technologies

+
+

Features:

+
    +
  •    Avoid manual entry.
  • +
  •    Use barcode for scrapping.
  • +
+
+
+
+ +
+
+
+

Overview

+

+ With this module you can avoid manual entry of product in scrapping. Presently you have to select the product from the list and enter the quantity. +

+
+
+
+ +
+
+

Stock Picking

+
+

+ ☛ Enable editing mode.
+ ☛ Click the field ‘Barcode’ and scan the Product.
+ ☛ If no associated product is found in list then a warning will popup.
+

+
+ +
+
+
+
+
+

Need Any Help?

+ +
diff --git a/barcode_scrap/static/description/scrap_barcode.png b/barcode_scrap/static/description/scrap_barcode.png new file mode 100644 index 000000000..c48453585 Binary files /dev/null and b/barcode_scrap/static/description/scrap_barcode.png differ diff --git a/barcode_scrap/views/scrap_view.xml b/barcode_scrap/views/scrap_view.xml new file mode 100644 index 000000000..be5621aa2 --- /dev/null +++ b/barcode_scrap/views/scrap_view.xml @@ -0,0 +1,13 @@ + + + + Barcode Scrap + stock.scrap + + + + + + + +