Browse Source

[ADD] Initial Commit

pull/30/merge
SHEREEF PT 8 years ago
parent
commit
2fcd69d07e
  1. 31
      inventory_barcode_scanning/README.rst
  2. 2
      inventory_barcode_scanning/__init__.py
  3. 41
      inventory_barcode_scanning/__manifest__.py
  4. 2
      inventory_barcode_scanning/models/__init__.py
  5. 44
      inventory_barcode_scanning/models/stock_picking.py
  6. BIN
      inventory_barcode_scanning/static/description/banner.jpg
  7. BIN
      inventory_barcode_scanning/static/description/cybro_logo.png
  8. BIN
      inventory_barcode_scanning/static/description/icon.png
  9. 77
      inventory_barcode_scanning/static/description/index.html
  10. BIN
      inventory_barcode_scanning/static/description/inventory_barcode.png
  11. 29
      inventory_barcode_scanning/views/stock_picking.xml

31
inventory_barcode_scanning/README.rst

@ -0,0 +1,31 @@
Barcode scanning in inventory v10
=================================
This module will used for barcode scanning in inventory.
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>
* Aswani PC <https://www.cybrosys.com>

2
inventory_barcode_scanning/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
import models

41
inventory_barcode_scanning/__manifest__.py

@ -0,0 +1,41 @@
# -*- 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 in Inventory',
'version': '10.0.1.0.0',
'summary': 'Barcode Support in Stock Picking.',
'author': 'Cybrosys Techno solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['stock'],
'category': 'Inventory',
'demo': [],
'data': ['views/stock_picking.xml'],
'installable': True,
'application': False,
'auto_install': False,
'images': ['static/description/banner.jpg'],
'qweb': [],
'license': 'LGPL-3',
}

2
inventory_barcode_scanning/models/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
import stock_picking

44
inventory_barcode_scanning/models/stock_picking.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api
from odoo.exceptions import Warning
class StockPicking(models.Model):
_inherit = 'stock.picking'
barcode = fields.Char(string='Barcode')
@api.onchange('barcode')
def barcode_scanning(self):
match = False
product_obj = self.env['product.product']
product_id = product_obj.search([('barcode', '=', self.barcode)])
if self.barcode and not product_id:
self.barcode = None
raise Warning('No product is available for this barcode')
if self.barcode and self.pack_operation_product_ids:
for line in self.pack_operation_product_ids:
if line.product_id.barcode == self.barcode:
line.qty_done += 1
self.barcode = None
match = True
if self.barcode and not match:
self.barcode = None
if product_id:
raise Warning('This product is not available in the order.'
'You can add this product by clicking the "Add an item" and scan')
class StockPickingOperation(models.Model):
_inherit = 'stock.pack.operation'
barcode = fields.Char(string='Barcode')
@api.onchange('barcode')
def _onchange_barcode_scan(self):
product_rec = self.env['product.product']
if self.barcode:
product = product_rec.search([('barcode', '=', self.barcode)])
self.product_id = product.id
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
inventory_barcode_scanning/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
inventory_barcode_scanning/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
inventory_barcode_scanning/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

77
inventory_barcode_scanning/static/description/index.html

@ -0,0 +1,77 @@
<section class="oe_container">
<div class="oe_spaced">
<h2 class="oe_slogan">Barcode scanning support for Inventory</h2>
<h3 class="oe_slogan">Use Barcode scanner to add entry in Stock Picking</h3>
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
<div style="padding-left:66px;">
<h4>Features:</h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Avoid manual entry of item count in Stock Picking.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Use barcode to add product. </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 quantity in Stock Picking form. Presently you have to enter the quantity of each product individually. By installing this module you will get an extra field in stock picking form to Scan Barcode and update the quantity of product automatically.
</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'>
&#x261B; Enable editing mode.<br>
&#x261B; Click the field ‘Barcode’ and scan the Product.<br>
&#x261B; You can see the quantity is updating automatically.<br>
&#x261B; If no associated product is found in list then a warning will popup.<br>
<ul><li>
In this case you can add the product to list by clicking <q><strong>Add an Item</strong></q>
</li>
<li>
Here also you will have the option to scan barcode for easy addition.
</li>
</ul>
</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="inventory_barcode.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<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>

BIN
inventory_barcode_scanning/static/description/inventory_barcode.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

29
inventory_barcode_scanning/views/stock_picking.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="barcode_scanning_inventory" model="ir.ui.view">
<field name="name">Barcode Scanning Inventory</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='location_id']" position="after">
<field name="barcode" attrs="{'invisible': [('state', '!=', 'assigned')]}"/>
</xpath>
<xpath expr="//field[@name='pack_operation_product_ids']/tree/field[@name='product_id']" position="before">
<field name="barcode"/>
</xpath>
</field>
</record>
<!--<record id="barcode_scanning_inventory_line" model="ir.ui.view">-->
<!--<field name="name">Barcode Scanning Inventory Line</field>-->
<!--<field name="model">stock.picking</field>-->
<!--<field name="inherit_id" ref="stock.view_picking_form"/>-->
<!--<field name="arch" type="xml">-->
<!--<xpath expr="//field[@name='pack_operation_product_ids']/tree/field[@name='product_id']" position="before">-->
<!--<field name="barcode"/>-->
<!--</xpath>-->
<!--</field>-->
<!--</record>-->
</data>
</odoo>
Loading…
Cancel
Save