11 changed files with 189 additions and 0 deletions
			
			
		@ -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 <https://www.cybrosys.com> | 
				
			|||
@ -0,0 +1,2 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
from . import models | 
				
			|||
@ -0,0 +1,42 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
############################################################################## | 
				
			|||
# | 
				
			|||
#    Cybrosys Technologies Pvt. Ltd. | 
				
			|||
#    Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). | 
				
			|||
#    Author: Sreejith P(<https://www.cybrosys.com>) | 
				
			|||
#    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 <http://www.gnu.org/licenses/>. | 
				
			|||
# | 
				
			|||
############################################################################## | 
				
			|||
 | 
				
			|||
{ | 
				
			|||
    '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', | 
				
			|||
} | 
				
			|||
@ -0,0 +1,2 @@ | 
				
			|||
# -*- coding: utf-8 -*- | 
				
			|||
from . import stock_scrap | 
				
			|||
@ -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') | 
				
			|||
| 
		 After Width: | Height: | Size: 190 KiB  | 
| 
		 After Width: | Height: | Size: 50 KiB  | 
| 
		 After Width: | Height: | Size: 46 KiB  | 
@ -0,0 +1,67 @@ | 
				
			|||
<section class="oe_container"> | 
				
			|||
    <div class="oe_spaced"> | 
				
			|||
        <h2 class="oe_slogan">Barcode Support for Scrapping</h2> | 
				
			|||
        <h3 class="oe_slogan">Use Barcode scanner to scrap the products</h3> | 
				
			|||
 | 
				
			|||
        <h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4> | 
				
			|||
        <div style="padding-left:66px;"> | 
				
			|||
        <h4>Features:</h4> | 
				
			|||
        <ul> | 
				
			|||
            <li style="list-style:none !important;"><span style="color:green;"> →</span>   Avoid manual entry.</li> | 
				
			|||
            <li style="list-style:none !important;"><span style="color:green;"> →</span>   Use barcode for scrapping. </li> | 
				
			|||
        </ul> | 
				
			|||
        </div> | 
				
			|||
    </div> | 
				
			|||
</section> | 
				
			|||
 | 
				
			|||
<section class="oe_container oe_dark"> | 
				
			|||
    <div class="oe_spaced"> | 
				
			|||
        <div class="oe_picture"> | 
				
			|||
            <h3 class="oe_slogan">Overview</h3> | 
				
			|||
            <p class="oe_mt32"> | 
				
			|||
                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. | 
				
			|||
            </p> | 
				
			|||
        </div> | 
				
			|||
    </div> | 
				
			|||
</section> | 
				
			|||
 | 
				
			|||
<section class="oe_container"> | 
				
			|||
    <div class="oe_row oe_spaced"> | 
				
			|||
        <h4 class="oe_slogan">Stock Picking</h4> | 
				
			|||
        <div class="oe_span12"> | 
				
			|||
            <p class='oe_mt32'> | 
				
			|||
                ☛ Enable editing mode.<br> | 
				
			|||
                ☛ Click the field ‘Barcode’ and scan the Product.<br> | 
				
			|||
                ☛ If no associated product is found in list then a warning will popup.<br> | 
				
			|||
            </p> | 
				
			|||
            <div class="oe_row_img oe_centered"> | 
				
			|||
                <img class="oe_picture oe_screenshot" src="scrap_barcode.png"> | 
				
			|||
            </div> | 
				
			|||
        </div> | 
				
			|||
    </div> | 
				
			|||
</section> | 
				
			|||
<section class="oe_container oe_dark"> | 
				
			|||
    <h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> | 
				
			|||
    <div class="oe_slogan" style="margin-top:10px !important;"> | 
				
			|||
        <div> | 
				
			|||
            <a  class="btn btn-primary btn-lg mt8" | 
				
			|||
            style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i | 
				
			|||
            class="fa fa-envelope"></i> Email </a> <a | 
				
			|||
            class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" | 
				
			|||
            href="https://www.cybrosys.com/contact/"><i | 
				
			|||
            class="fa fa-phone"></i> Contact Us </a> <a | 
				
			|||
            class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" | 
				
			|||
            href="https://www.cybrosys.com/odoo-customization-and-installation/"><i | 
				
			|||
            class="fa fa-check-square"></i> Request Customization </a> | 
				
			|||
        </div> | 
				
			|||
        <br> | 
				
			|||
        <img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> | 
				
			|||
        <div> | 
				
			|||
          <a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> | 
				
			|||
          <a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> | 
				
			|||
          <a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> | 
				
			|||
          <a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> | 
				
			|||
          <a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> | 
				
			|||
        </div> | 
				
			|||
    </div> | 
				
			|||
</section> | 
				
			|||
| 
		 After Width: | Height: | Size: 60 KiB  | 
@ -0,0 +1,13 @@ | 
				
			|||
<?xml version="1.0" encoding="utf-8" ?> | 
				
			|||
<odoo> | 
				
			|||
    <record id="scrap_product_barcode" model="ir.ui.view"> | 
				
			|||
        <field name="name">Barcode Scrap</field> | 
				
			|||
        <field name="model">stock.scrap</field> | 
				
			|||
        <field name="inherit_id" ref="stock.stock_scrap_form_view"/> | 
				
			|||
        <field name="arch" type="xml"> | 
				
			|||
            <xpath expr="//field[@name='product_id']" position="before"> | 
				
			|||
                <field name="barcode"/> | 
				
			|||
            </xpath> | 
				
			|||
        </field> | 
				
			|||
    </record> | 
				
			|||
</odoo> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue