diff --git a/mrp_work_order_print/README.rst b/mrp_work_order_print/README.rst new file mode 100644 index 000000000..28f08bc42 --- /dev/null +++ b/mrp_work_order_print/README.rst @@ -0,0 +1,32 @@ +Print Work Order Details v12 +============================ +Generate PDF Report of Work Order + +Depends +======= +[mrp] addon Odoo + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + +License +======= +GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Authors +------- +* Faslu + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/mrp_work_order_print/__init__.py b/mrp_work_order_print/__init__.py new file mode 100644 index 000000000..633f86615 --- /dev/null +++ b/mrp_work_order_print/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/mrp_work_order_print/__manifest__.py b/mrp_work_order_print/__manifest__.py new file mode 100644 index 000000000..bf87ae848 --- /dev/null +++ b/mrp_work_order_print/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: faslu() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': 'Print Work Order Details', + 'summary': """Generate PDF Report of Work Order""", + 'version': '12.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com/", + 'category': 'Manufacturing', + 'depends': ['mrp'], + 'license': 'AGPL-3', + 'data': [ + 'views/report_work_order.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, +} diff --git a/mrp_work_order_print/static/description/banner.jpg b/mrp_work_order_print/static/description/banner.jpg new file mode 100644 index 000000000..012febffb Binary files /dev/null and b/mrp_work_order_print/static/description/banner.jpg differ diff --git a/mrp_work_order_print/static/description/cybro_logo.png b/mrp_work_order_print/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/mrp_work_order_print/static/description/cybro_logo.png differ diff --git a/mrp_work_order_print/static/description/icon.png b/mrp_work_order_print/static/description/icon.png new file mode 100644 index 000000000..d9905bbcb Binary files /dev/null and b/mrp_work_order_print/static/description/icon.png differ diff --git a/mrp_work_order_print/static/description/index.html b/mrp_work_order_print/static/description/index.html new file mode 100644 index 000000000..6f928af3c --- /dev/null +++ b/mrp_work_order_print/static/description/index.html @@ -0,0 +1,62 @@ +
+
+

Print Work Order Details

+

Cybrosys Technologies

+
+
+ +
+
+

+ Generate PDF Report of Work Order +

+
+
+ +
+
+
+

Overview

+

+ Generate a PDF report with all necessary details of a Work Order. It can be used for the internal purposes of the plant/work center +

+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
+ diff --git a/mrp_work_order_print/static/description/wo_pdf.png b/mrp_work_order_print/static/description/wo_pdf.png new file mode 100644 index 000000000..0fd244064 Binary files /dev/null and b/mrp_work_order_print/static/description/wo_pdf.png differ diff --git a/mrp_work_order_print/views/report_work_order.xml b/mrp_work_order_print/views/report_work_order.xml new file mode 100644 index 000000000..92ee7e76d --- /dev/null +++ b/mrp_work_order_print/views/report_work_order.xml @@ -0,0 +1,100 @@ + + + + + + + + diff --git a/pos_traceability_validation/README.rst b/pos_traceability_validation/README.rst new file mode 100644 index 000000000..20f5553ea --- /dev/null +++ b/pos_traceability_validation/README.rst @@ -0,0 +1,12 @@ +POS Serial Number Validator v12 +=============================== + +Validate Serial number of a product by checking availability in stock + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Akhilesh N S diff --git a/pos_traceability_validation/__init__.py b/pos_traceability_validation/__init__.py new file mode 100644 index 000000000..e6ceb6eb9 --- /dev/null +++ b/pos_traceability_validation/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Akhilesh N S() +# 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 . +# +############################################################################## +from . import models diff --git a/pos_traceability_validation/__manifest__.py b/pos_traceability_validation/__manifest__.py new file mode 100644 index 000000000..e3c034fc7 --- /dev/null +++ b/pos_traceability_validation/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Akhilesh N S() +# 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': 'POS Serial Number Validator', + 'version': '12.0.1.0', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Point of Sale', + 'summary': """Validate Serial number of a product by checking availability in stock""", + 'description': """Validate Serial number of a product by checking availability in stock""", + 'depends': ['point_of_sale'], + 'data': [ + 'static/src/xml/pos_templates.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, +} + diff --git a/pos_traceability_validation/models/__init__.py b/pos_traceability_validation/models/__init__.py new file mode 100644 index 000000000..1b8acdb97 --- /dev/null +++ b/pos_traceability_validation/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Akhilesh N S() +# 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 . +# +############################################################################## + +from . import traceability_validation diff --git a/pos_traceability_validation/models/traceability_validation.py b/pos_traceability_validation/models/traceability_validation.py new file mode 100644 index 000000000..f92a0fb8f --- /dev/null +++ b/pos_traceability_validation/models/traceability_validation.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies(). +# Author: Akhilesh N S() +# 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 . +# +############################################################################## +from odoo import models, api + + +class ValidateLotNumber(models.Model): + _name = 'serial_no.validation' + + @api.model + def validate_lots(self, lots): + processed = [] + LotObj = self.env['stock.production.lot'] + print("ddd",LotObj) + for lot in lots: + lot_id = LotObj.search([('name', '=', lot)], limit=1) + try: + if lot_id.product_qty > 0 and lot not in processed: + processed.append(lot) + continue + else: + if lot in processed: + return ['duplicate', lot] + else: + return ['no_stock', lot] + except Exception: + return ['except', lot] + return True + diff --git a/pos_traceability_validation/static/description/banner.jpg b/pos_traceability_validation/static/description/banner.jpg new file mode 100644 index 000000000..31659f185 Binary files /dev/null and b/pos_traceability_validation/static/description/banner.jpg differ diff --git a/pos_traceability_validation/static/description/cybro_logo.png b/pos_traceability_validation/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_traceability_validation/static/description/cybro_logo.png differ diff --git a/pos_traceability_validation/static/description/duplicate_entry.png b/pos_traceability_validation/static/description/duplicate_entry.png new file mode 100644 index 000000000..814de84db Binary files /dev/null and b/pos_traceability_validation/static/description/duplicate_entry.png differ diff --git a/pos_traceability_validation/static/description/icon.png b/pos_traceability_validation/static/description/icon.png new file mode 100644 index 000000000..74a174c7a Binary files /dev/null and b/pos_traceability_validation/static/description/icon.png differ diff --git a/pos_traceability_validation/static/description/index.html b/pos_traceability_validation/static/description/index.html new file mode 100644 index 000000000..6768b75e4 --- /dev/null +++ b/pos_traceability_validation/static/description/index.html @@ -0,0 +1,332 @@ + +
+
+

+ POS Serial Number Validator +

+

+ Validate the given Serial number of a product from stock +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Currently in Odoo, Serial number validation at POS not available. This module validates given serial number is available in stock and prevent + duplicated entry for more than one quantity. +

+
+
+ +
+
+

+ Features +

+

+ + Validates given serial number is available in stock +

+

+ + Prevents duplicated entry for more than one quantity +

+
+
+ +
+
+

+ Screenshots +

+

+ + Warnings +

+
+ +
+
+
+ +
+
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
diff --git a/pos_traceability_validation/static/description/invalid_serial_number.png b/pos_traceability_validation/static/description/invalid_serial_number.png new file mode 100644 index 000000000..8f89b3735 Binary files /dev/null and b/pos_traceability_validation/static/description/invalid_serial_number.png differ diff --git a/pos_traceability_validation/static/description/pos-treacibility-cybrosys-1.png b/pos_traceability_validation/static/description/pos-treacibility-cybrosys-1.png new file mode 100644 index 000000000..d6a7abba6 Binary files /dev/null and b/pos_traceability_validation/static/description/pos-treacibility-cybrosys-1.png differ diff --git a/pos_traceability_validation/static/description/pos-treacibility-cybrosys-2.png b/pos_traceability_validation/static/description/pos-treacibility-cybrosys-2.png new file mode 100644 index 000000000..2cc5d4f0c Binary files /dev/null and b/pos_traceability_validation/static/description/pos-treacibility-cybrosys-2.png differ diff --git a/pos_traceability_validation/static/src/js/pos_models.js b/pos_traceability_validation/static/src/js/pos_models.js new file mode 100644 index 000000000..3d597d774 --- /dev/null +++ b/pos_traceability_validation/static/src/js/pos_models.js @@ -0,0 +1,75 @@ +odoo.define('pos_traceability_validation.models', function (require) { +"use strict"; + + + var PosModel = require('point_of_sale.models'); + var PosPopups = require('point_of_sale.popups'); + var gui = require('point_of_sale.gui'); + var rpc = require('web.rpc'); + var PackLotLinePopupWidget = PosPopups.extend({ + template: 'PackLotLinePopupWidget', + + /*making sure we didn't used same key already in the order*/ + duplicate_lot_name: function(id, lot_name, lot_lines){ + for(var i=0; i< lot_lines.length; i++){ + if(lot_lines[i].attributes && + lot_lines[i].attributes.lot_name != null + && lot_lines[i].attributes.lot_name == lot_name && + id != lot_lines[i].cid){ + return true; + } + } + return false; + }, + + click_confirm: function(){ + var self = this; + var lot_names = []; + var lot_cid = {}; + var pack_lot_lines = this.options.pack_lot_lines; + + this.$('.packlot-line-input').each(function(index, el){ + var cid = $(el).attr('cid'), + lot_name = $(el).val(); + var pack_line = pack_lot_lines.get({cid: cid}); + pack_line.set_lot_name(lot_name); + lot_names.push(lot_name); + lot_cid[lot_name] = cid; + }); + + rpc.query({ + model: 'serial_no.validation', + method: 'validate_lots', + args: [lot_names] + }).done(function(result){ + + if(result != true){ + var current_id = lot_cid[result[1]]; + var pack_line = pack_lot_lines.get({cid: current_id}); + pack_line.set_lot_name(null); + if(result[0] == 'no_stock'){ + alert("Insufficient stock for " + result[1]) + } + else if(result[0] == 'duplicate'){ + alert("Duplicate entry for " + result[1]) + } + else if(result[0] == 'except'){ + alert("Exception occured with " + result[1]) + } + } + else{ + pack_lot_lines.remove_empty_model(); + pack_lot_lines.set_quantity_by_lot(); + self.options.order.save_to_db(); + self.options.order_line.trigger( + 'change', + self.options.order_line + ); + self.gui.close_popup(); + } + }); + } + }); + gui.define_popup({name:'packlotline', widget: PackLotLinePopupWidget}); + +}); diff --git a/pos_traceability_validation/static/src/xml/pos_templates.xml b/pos_traceability_validation/static/src/xml/pos_templates.xml new file mode 100644 index 000000000..7bb0e5534 --- /dev/null +++ b/pos_traceability_validation/static/src/xml/pos_templates.xml @@ -0,0 +1,9 @@ + + +