Skip to content

Commit

Permalink
Jun 12: [ADD] Initial Commit 'barcode_for_work_centers'
Browse files Browse the repository at this point in the history
  • Loading branch information
RisvanaCybrosys committed Jun 12, 2024
1 parent b0c7cd8 commit 7882f41
Show file tree
Hide file tree
Showing 65 changed files with 1,357 additions and 0 deletions.
48 changes: 48 additions & 0 deletions barcode_for_work_centers/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. image:: https://img.shields.io/badge/licence-OPL--1-red.svg
:target: https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps
:alt: License: OPL-1

Barcode for work centers
========================
Enable the ability to start and stop the work order using barcode scanning.

Configuration
=============
* No additional configurations needed
* Barcode modules are only available in enterprise edition

Company
=======
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__

License
=======
Odoo Proprietary License v1.0 (OPL-1)
(https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps)

Credits
=======
Developer: (V16) Jaseem Sadiq K, Contact: [email protected]

Contacts
========
* Mail Contact : [email protected]
* Website : https://cybrosys.com

Bug Tracker
===========
Bugs are tracked on GitHub Issues. In case of trouble, please check there if
your issue has already been reported.

Maintainer
==========
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com

This module is maintained by Cybrosys Technologies.

For support and more information, please visit `Our Website <https://cybrosys.com/>`__

Further information
===================
HTML Description: `<static/description/index.html>`__
22 changes: 22 additions & 0 deletions barcode_for_work_centers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jaseem ([email protected])
#
# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
from . import models
54 changes: 54 additions & 0 deletions barcode_for_work_centers/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jaseem ([email protected])
#
# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
{
'name': "Barcode for work centers",
'version': '16.0.1.0.0',
'category': 'Manufacturing',
'summary': 'Start and stop the work ordr using barcode',
'description': """This module enables the functionality to initiate and
halt work orders using barcode scanning. It allows users to commence work
orders by scanning barcodes and provides buttons to pause and resume work
order activities.""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ["stock_barcode", "stock", "mrp"],
'data': [
"data/barcode_for_work_centers.xml",
"views/mrp_routing_workcenter_views.xml",
],
'assets': {
'web.assets_backend': [
'/barcode_for_work_centers/static/src/js/barcode_template.js',
'/barcode_for_work_centers/static/src/xml/manufacture_button_templates.xml',
'/barcode_for_work_centers/static/src/xml/barcode_scan_templates.xml',
'/barcode_for_work_centers/static/src/css/barcode_for_work_centers.scss',
],
},
'images': ['static/description/banner.jpg'],
'license': 'OPL-1',
'installable': True,
'application': False,
'auto_install': False,
}

10 changes: 10 additions & 0 deletions barcode_for_work_centers/data/barcode_for_work_centers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- This record is created a client action for creating client action for opening barcode scanning template -->
<record id="barcode_for_work_centers.barcode_for_work_centers_scanning_template"
model="ir.actions.client">
<field name="name">Barcode scanning view</field>
<field name="tag">barcode_for_work_centers_scanning_template</field>
<field name="target">current</field>
</record>
</odoo>
6 changes: 6 additions & 0 deletions barcode_for_work_centers/doc/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Module <barcode_for_work_centers>

##### 07.02.2024
##### Version 16.0.1.0.0
##### ADD
- Initial commit for Barcode for work centers
23 changes: 23 additions & 0 deletions barcode_for_work_centers/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jaseem ([email protected])
#
# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
from . import mrp_routing_workcenter
from . import mrp_workorder
37 changes: 37 additions & 0 deletions barcode_for_work_centers/models/mrp_routing_workcenter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jaseem ([email protected])
#
# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
from odoo import models


class MrpRoutingWorkCenter(models.Model):
"""This class represents an extension of 'mrp.routing.workcenter' to add a
function called 'action_barcode_scanner_template'. This function allows the
user to click on the records of all kanban views of operations in a work
order."""
_inherit = "mrp.routing.workcenter"

def action_barcode_scanner_template(self):
"""This function is used to invoke a client action that calls the
barcode template."""
return {'type': 'ir.actions.client',
'tag': 'barcode_for_work_centers_scanning_template',
'params': {'name': self.name, 'id': self.id}}
94 changes: 94 additions & 0 deletions barcode_for_work_centers/models/mrp_workorder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Jaseem ([email protected])
#
# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1)
# It is forbidden to publish, distribute, sublicense, or sell copies of the
# Software or modified copies of the Software.
#
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
###############################################################################
from odoo import models


class MrpWorkOrder(models.Model):
"""This class represents the inheriting add the all rpc function for js
such as action_work_order_start_stop,action_puase,action_continue and
action_done"""
_inherit = "mrp.workorder"

def action_work_order_start_stop(self, clicked_record, man_order):
"""This function is used to start and stop the work order after scanning
barcode in barcode template , it returns the message that 'start' or '
stop'."""
record = self.env["mrp.routing.workcenter"].browse(int(clicked_record))
mrp_order = self.env["mrp.production"].search(
[("name", "=", man_order)])
params_for_template = {}
if record.workorder_ids and mrp_order:
for wo in record.workorder_ids:
if wo.production_id.id == mrp_order.id:
if wo.production_state not in ['draft', 'done',
'cancel', ] and \
wo.working_state != "blocked" and wo.state not in \
["done", "cancel", "progress"]:
wo.button_start()
params_for_template.update(
{"pop_up": "start", "duration": wo.duration})
elif wo.state != "done":
wo.button_finish()
params_for_template.update({"pop_up": "end"})
elif wo.state == "done":
params_for_template.update({"pop_up": "already done"})
else:
params_for_template.update({"pop_up": "not match"})
else:
params_for_template.update({"pop_up": "not match"})
return params_for_template

def action_pause(self, clicked_record, man_order):
"""This function is used to perform action pause while clicking the
pause button from barcode scanning template """
record = self.env["mrp.routing.workcenter"].browse(int(clicked_record))
mrp_order = self.env["mrp.production"].search(
[("name", "=", man_order)])
if record.workorder_ids and mrp_order:
for wo in record.workorder_ids:
if wo.production_id.id == mrp_order.id:
wo.button_pending()
return "paused"

def action_continue(self, clicked_record, man_order):
"""This function is used to continue the work order after clicking the
continue button"""
record = self.env["mrp.routing.workcenter"].browse(int(clicked_record))
mrp_order = self.env["mrp.production"].search(
[("name", "=", man_order)])
if record.workorder_ids and mrp_order:
for wo in record.workorder_ids:
if wo.production_id.id == mrp_order.id:
wo.button_start()
return "continue"

def action_done(self, clicked_record, man_order):
"""This function is used to stop the work order after clicking the
done button"""
record = self.env["mrp.routing.workcenter"].browse(int(clicked_record))
mrp_order = self.env["mrp.production"].search(
[("name", "=", man_order)])
if record.workorder_ids and mrp_order:
for wo in record.workorder_ids:
if wo.production_id.id == mrp_order.id:
wo.button_finish()
return "done"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7882f41

Please sign in to comment.