diff --git a/company_scrap_management/README.rst b/company_scrap_management/README.rst new file mode 100644 index 000000000..910182e64 --- /dev/null +++ b/company_scrap_management/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Scrap Management +======================== +* Module which helps manage scrap dismantle in company + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +License +------- +Affero General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V16)Ranjith R , Contact : odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* 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 `__ + +Further information +=================== +HTML Description: ``__ diff --git a/company_scrap_management/__init__.py b/company_scrap_management/__init__.py new file mode 100644 index 000000000..531e9e706 --- /dev/null +++ b/company_scrap_management/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from . import models +from . import report +from . import wizard diff --git a/company_scrap_management/__manifest__.py b/company_scrap_management/__manifest__.py new file mode 100644 index 000000000..dd181ee15 --- /dev/null +++ b/company_scrap_management/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +{ + 'name': 'Scrap Management', + 'version': '16.0.1.0.0', + 'category': 'Inventory', + 'summary': 'Manage Scrap in a company', + 'description': """Module helps to dismantle the product having bom and move + the useful parts to the stock""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'mail', 'stock', 'contacts', 'mrp'], + 'data': [ + 'security/ir.model.access.csv', + 'data/ir_sequence_data.xml', + 'views/scrap_management_line_views.xml', + 'views/scrap_management_views.xml', + 'views/stock_scrap_views.xml', + 'report/scrap_management_template.xml', + 'report/scrap_management_state_wise_template.xml', + 'report/scrap_management_reports.xml', + 'report/scrap_management_product_wise_template.xml', + 'wizard/scrap_management_report_views.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/company_scrap_management/data/ir_sequence_data.xml b/company_scrap_management/data/ir_sequence_data.xml new file mode 100644 index 000000000..fcf653426 --- /dev/null +++ b/company_scrap_management/data/ir_sequence_data.xml @@ -0,0 +1,15 @@ + + + + + + Scrap Management + scrap.management + TRUE + SM + 6 + 1 + 1 + + + diff --git a/company_scrap_management/doc/RELEASE_NOTES.md b/company_scrap_management/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..e7d869de6 --- /dev/null +++ b/company_scrap_management/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 06.01.2024 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Scrap Management diff --git a/company_scrap_management/models/__init__.py b/company_scrap_management/models/__init__.py new file mode 100644 index 000000000..bf75ab441 --- /dev/null +++ b/company_scrap_management/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from . import scrap_management +from . import scrap_management_line +from . import stock_scrap diff --git a/company_scrap_management/models/scrap_management.py b/company_scrap_management/models/scrap_management.py new file mode 100644 index 000000000..99f67e4b6 --- /dev/null +++ b/company_scrap_management/models/scrap_management.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from datetime import date +from odoo import api, fields, models + + +class ScrapManagement(models.Model): + """ Used to manage scrap """ + _name = "scrap.management" + _description = "Scrap Management" + _inherit = ['mail.thread', 'mail.activity.mixin'] + _rec_name = 'scrap_management_number' + + scrap_management_number = fields.Char( + string="Scrap Number", readonly=True, required=True, copy=False, + default="New", help="Field to specify sequence number") + scrap_order_id = fields.Many2one( + 'stock.scrap', String="Scrap Order", required=True, + help="Field to choose scrap order", + domain="[('state', '=','done')," + "('typ_of_reuse','=','dismantle')," + "('state_management', '=','none')]") + bill_of_material_id = fields.Many2one( + 'mrp.bom', related="scrap_order_id.bill_of_material_id", + string="Bill of Material", help="Field to choose bill of material") + product_id = fields.Many2one( + 'product.product', + String="Product", related="scrap_order_id.product_id", + help="Field to choose product") + date = fields.Date(string="Date", help="field to give the date") + qty = fields.Float(String="Quantity", related="scrap_order_id.scrap_qty", + help="Field to specify quantity") + scrap_management_line_ids = fields.One2many( + 'scrap.management.line', 'scrap_management_id', + string="Components", help="Field to specify components") + location_id = fields.Many2one( + 'stock.location', String="Transfer location", + domain="[('usage','=','internal')]", required=True, + help="Field to specify location") + state = fields.Selection( + [('draft', 'Draft'), ('confirm', 'Confirm'), ('done', 'Done')], + string="State", default="draft", + help="Field to specify state of Scrap Management") + + @api.model + def create(self, vals): + """ + Summary: + function return sequence number for record + Args: + vals:To store the sequence created + return: + result:return sequence created + """ + if vals.get('scrap_management_number', 'New') == 'New': + vals['scrap_management_number'] = self.env[ + 'ir.sequence'].next_by_code( + 'scrap.management') or 'New' + result = super(ScrapManagement, self).create(vals) + return result + + def action_confirm(self): + """Function to confirm the Scrap Management and add value to one2many""" + for line in self.bill_of_material_id.bom_line_ids: + if line.product_id.detailed_type not in ['consu', 'service']: + self.write({ + 'scrap_management_line_ids': [ + (0, 0, {'product_id': line.product_id.id, + 'dismantle_qty': (self.qty * line.product_qty)})], + }) + self.write({ + 'state': "confirm" + }) + + def action_done(self): + """Function to done the Scrap Management and + add product move and stock quantity""" + self.env['stock.quant'].create({ + 'location_id': self.scrap_order_id.scrap_location_id.id, + 'product_id': self.product_id.id, + 'quantity': 0 - self.qty + }) + for line in self.scrap_management_line_ids: + scrap_qty = line.dismantle_qty - line.useful_qty + if line.useful_qty > 0: + self.env['stock.quant'].create({ + 'location_id': self.location_id.id, + 'product_id': line.product_id.id, + 'quantity': line.useful_qty + }) + self.env['stock.move.line'].create({ + 'reference': self.scrap_management_number, + 'product_id': line.product_id.id, + 'location_dest_id': self.location_id.id, + 'qty_done': line.useful_qty, + 'company_id': self.env.company.id, + 'location_id': self.scrap_order_id.scrap_location_id.id, + 'state': "done" + }) + if scrap_qty > 0: + self.env['stock.quant'].create({ + 'location_id': self.scrap_order_id.scrap_location_id.id, + 'product_id': line.product_id.id, + 'quantity': scrap_qty + }) + self.env['stock.move.line'].create({ + 'reference': self.scrap_management_number, + 'product_id': line.product_id.id, + 'qty_done': scrap_qty, + 'location_id': self.scrap_order_id.scrap_location_id.id, + 'company_id': self.env.company.id, + 'state': "done", + 'location_dest_id': self.scrap_order_id.scrap_location_id.id + }) + self.write({ + 'state': "done" + }) + self.scrap_order_id.write({ + 'state_management': "dismantled" + }) + self.date = date.today() + + def action_product_moves(self): + """Function to return the product moves""" + return { + 'name': "Product Moves", + 'type': 'ir.actions.act_window', + 'view_mode': 'tree,form', + 'res_model': 'stock.move.line', + 'domain': [('reference', '=', self.scrap_management_number)]} diff --git a/company_scrap_management/models/scrap_management_line.py b/company_scrap_management/models/scrap_management_line.py new file mode 100644 index 000000000..93e287561 --- /dev/null +++ b/company_scrap_management/models/scrap_management_line.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from odoo import fields, models + + +class ScrapManagementLine(models.Model): + """ Used to manage scrap components """ + _name = "scrap.management.line" + _description = "Scrap Management Line" + + product_id = fields.Many2one('product.product', + String="Product", readonly=True, + help="Field to specify product") + scrap_management_id = fields.Many2one('scrap.management', + String="Product", readonly=True, + help="Field to specify " + "scrap management order") + dismantle_qty = fields.Integer(String="Available quantity", readonly=True, + help="Field to specify total quantity") + useful_qty = fields.Integer(string="Useful Product Quantity", + help="Field to specify useful quantity") diff --git a/company_scrap_management/models/stock_scrap.py b/company_scrap_management/models/stock_scrap.py new file mode 100644 index 000000000..36e595a7a --- /dev/null +++ b/company_scrap_management/models/stock_scrap.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from odoo import fields, models + + +class StockScrap(models.Model): + """ Used to add fields to stock.scrap """ + _inherit = "stock.scrap" + + product_tmpl_id = fields.Many2one( + 'product.template', + string='Product Template',related='product_id.product_tmpl_id', + help="Corresponding product of the variant") + bill_of_material_id = fields.Many2one( + 'mrp.bom', + domain="[('product_tmpl_id', '=',product_tmpl_id)]", + string="Bill of Material", + help="Field to specify sequence bill of material") + typ_of_reuse = fields.Selection( + [('none', 'None'), ('dismantle', 'Dismantle')], + default="none", help="Field to specify type of scrap", + string="Type of Operation") + state_management = fields.Selection( + [('none', 'None'), ('dismantled', 'Dismantled')], + string="State", default="none", + help="Field to specify type of scrap management") diff --git a/company_scrap_management/report/__init__.py b/company_scrap_management/report/__init__.py new file mode 100644 index 000000000..6fc4a8041 --- /dev/null +++ b/company_scrap_management/report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from . import scrap_management_report diff --git a/company_scrap_management/report/scrap_management_product_wise_template.xml b/company_scrap_management/report/scrap_management_product_wise_template.xml new file mode 100644 index 000000000..df3e0677e --- /dev/null +++ b/company_scrap_management/report/scrap_management_product_wise_template.xml @@ -0,0 +1,56 @@ + + + + + diff --git a/company_scrap_management/report/scrap_management_report.py b/company_scrap_management/report/scrap_management_report.py new file mode 100644 index 000000000..93df09d37 --- /dev/null +++ b/company_scrap_management/report/scrap_management_report.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from odoo import api, models + + +class ScrapManagementPrint(models.AbstractModel): + """ Class to print form view""" + _name = 'report.company_scrap_management.report_scrap_management' + _description = "Scrap Management Report" + + @api.model + def _get_report_values(self, docids, data=None): + """Function to print form view""" + scrap_management = self.env['scrap.management'].browse(docids) + return { + 'scrap_management': scrap_management + } diff --git a/company_scrap_management/report/scrap_management_reports.xml b/company_scrap_management/report/scrap_management_reports.xml new file mode 100644 index 000000000..2d99a2f8f --- /dev/null +++ b/company_scrap_management/report/scrap_management_reports.xml @@ -0,0 +1,34 @@ + + + + + Scrap Management Report + scrap.management.report + qweb-pdf + company_scrap_management.report_scrap_management_product_wise + company_scrap_management.report_scrap_management_product_wise + + report + + + Scrap Management Report + scrap.management.report + qweb-pdf + company_scrap_management.report_scrap_management_state_wise + company_scrap_management.report_scrap_management_state_wise + + report + + + Scrap Management + scrap.management + qweb-pdf + company_scrap_management.report_scrap_management + report.company_scrap_management.report_scrap_management + + report + + diff --git a/company_scrap_management/report/scrap_management_state_wise_template.xml b/company_scrap_management/report/scrap_management_state_wise_template.xml new file mode 100644 index 000000000..61934b35e --- /dev/null +++ b/company_scrap_management/report/scrap_management_state_wise_template.xml @@ -0,0 +1,52 @@ + + + + + diff --git a/company_scrap_management/report/scrap_management_template.xml b/company_scrap_management/report/scrap_management_template.xml new file mode 100644 index 000000000..e94e7fba6 --- /dev/null +++ b/company_scrap_management/report/scrap_management_template.xml @@ -0,0 +1,61 @@ + + + + + diff --git a/company_scrap_management/security/ir.model.access.csv b/company_scrap_management/security/ir.model.access.csv new file mode 100755 index 000000000..053d48b86 --- /dev/null +++ b/company_scrap_management/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_scrap_management,access.scrap.management,model_scrap_management,base.group_user,1,1,1,1 +access_scrap_management_line,access.scrap.management.line,model_scrap_management_line,base.group_user,1,1,1,1 +access_scrap_management_report,access.scrap.management.report,model_scrap_management_report,base.group_user,1,1,1,1 diff --git a/company_scrap_management/static/description/assets/icons/check.png b/company_scrap_management/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/check.png differ diff --git a/company_scrap_management/static/description/assets/icons/chevron.png b/company_scrap_management/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/chevron.png differ diff --git a/company_scrap_management/static/description/assets/icons/cogs.png b/company_scrap_management/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/cogs.png differ diff --git a/company_scrap_management/static/description/assets/icons/consultation.png b/company_scrap_management/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/consultation.png differ diff --git a/company_scrap_management/static/description/assets/icons/ecom-black.png b/company_scrap_management/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/ecom-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/education-black.png b/company_scrap_management/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/education-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/hotel-black.png b/company_scrap_management/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/hotel-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/license.png b/company_scrap_management/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/license.png differ diff --git a/company_scrap_management/static/description/assets/icons/lifebuoy.png b/company_scrap_management/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/lifebuoy.png differ diff --git a/company_scrap_management/static/description/assets/icons/manufacturing-black.png b/company_scrap_management/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/pos-black.png b/company_scrap_management/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/pos-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/puzzle.png b/company_scrap_management/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/puzzle.png differ diff --git a/company_scrap_management/static/description/assets/icons/restaurant-black.png b/company_scrap_management/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/restaurant-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/service-black.png b/company_scrap_management/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/service-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/trading-black.png b/company_scrap_management/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/trading-black.png differ diff --git a/company_scrap_management/static/description/assets/icons/training.png b/company_scrap_management/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/training.png differ diff --git a/company_scrap_management/static/description/assets/icons/update.png b/company_scrap_management/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/update.png differ diff --git a/company_scrap_management/static/description/assets/icons/user.png b/company_scrap_management/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/user.png differ diff --git a/company_scrap_management/static/description/assets/icons/wrench.png b/company_scrap_management/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/company_scrap_management/static/description/assets/icons/wrench.png differ diff --git a/company_scrap_management/static/description/assets/misc/categories.png b/company_scrap_management/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/categories.png differ diff --git a/company_scrap_management/static/description/assets/misc/check-box.png b/company_scrap_management/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/check-box.png differ diff --git a/company_scrap_management/static/description/assets/misc/compass.png b/company_scrap_management/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/compass.png differ diff --git a/company_scrap_management/static/description/assets/misc/corporate.png b/company_scrap_management/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/corporate.png differ diff --git a/company_scrap_management/static/description/assets/misc/customer-support.png b/company_scrap_management/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/customer-support.png differ diff --git a/company_scrap_management/static/description/assets/misc/cybrosys-logo.png b/company_scrap_management/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/cybrosys-logo.png differ diff --git a/company_scrap_management/static/description/assets/misc/features.png b/company_scrap_management/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/features.png differ diff --git a/company_scrap_management/static/description/assets/misc/logo.png b/company_scrap_management/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/logo.png differ diff --git a/company_scrap_management/static/description/assets/misc/pictures.png b/company_scrap_management/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/pictures.png differ diff --git a/company_scrap_management/static/description/assets/misc/pie-chart.png b/company_scrap_management/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/pie-chart.png differ diff --git a/company_scrap_management/static/description/assets/misc/right-arrow.png b/company_scrap_management/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/right-arrow.png differ diff --git a/company_scrap_management/static/description/assets/misc/star.png b/company_scrap_management/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/star.png differ diff --git a/company_scrap_management/static/description/assets/misc/support.png b/company_scrap_management/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/support.png differ diff --git a/company_scrap_management/static/description/assets/misc/whatsapp.png b/company_scrap_management/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/company_scrap_management/static/description/assets/misc/whatsapp.png differ diff --git a/company_scrap_management/static/description/assets/modules/bom_multiple_product.png b/company_scrap_management/static/description/assets/modules/bom_multiple_product.png new file mode 100755 index 000000000..272ec20f9 Binary files /dev/null and b/company_scrap_management/static/description/assets/modules/bom_multiple_product.png differ diff --git a/company_scrap_management/static/description/assets/modules/bom_total_cost.png b/company_scrap_management/static/description/assets/modules/bom_total_cost.png new file mode 100644 index 000000000..4e506f79b Binary files /dev/null and b/company_scrap_management/static/description/assets/modules/bom_total_cost.png differ diff --git a/company_scrap_management/static/description/assets/modules/cw_mrp.png b/company_scrap_management/static/description/assets/modules/cw_mrp.png new file mode 100644 index 000000000..da0495bb6 Binary files /dev/null and b/company_scrap_management/static/description/assets/modules/cw_mrp.png differ diff --git a/company_scrap_management/static/description/assets/modules/duplicate_product_bom.png b/company_scrap_management/static/description/assets/modules/duplicate_product_bom.png new file mode 100644 index 000000000..fcc5dcff1 Binary files /dev/null and b/company_scrap_management/static/description/assets/modules/duplicate_product_bom.png differ diff --git a/company_scrap_management/static/description/assets/modules/manufacturing_timesheet.png b/company_scrap_management/static/description/assets/modules/manufacturing_timesheet.png new file mode 100644 index 000000000..0bfce1e0a Binary files /dev/null and b/company_scrap_management/static/description/assets/modules/manufacturing_timesheet.png differ diff --git a/company_scrap_management/static/description/assets/modules/simple_mrp_order.png b/company_scrap_management/static/description/assets/modules/simple_mrp_order.png new file mode 100644 index 000000000..e78427938 Binary files /dev/null and b/company_scrap_management/static/description/assets/modules/simple_mrp_order.png differ diff --git a/company_scrap_management/static/description/assets/modules/so_bom_selection.png b/company_scrap_management/static/description/assets/modules/so_bom_selection.png new file mode 100644 index 000000000..b94dc8738 Binary files /dev/null and b/company_scrap_management/static/description/assets/modules/so_bom_selection.png differ diff --git a/company_scrap_management/static/description/assets/screenshots/hero.gif b/company_scrap_management/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..9d174290b Binary files /dev/null and b/company_scrap_management/static/description/assets/screenshots/hero.gif differ diff --git a/company_scrap_management/static/description/assets/screenshots/report1.png b/company_scrap_management/static/description/assets/screenshots/report1.png new file mode 100755 index 000000000..778765b22 Binary files /dev/null and b/company_scrap_management/static/description/assets/screenshots/report1.png differ diff --git a/company_scrap_management/static/description/assets/screenshots/report2.png b/company_scrap_management/static/description/assets/screenshots/report2.png new file mode 100755 index 000000000..901a24f8b Binary files /dev/null and b/company_scrap_management/static/description/assets/screenshots/report2.png differ diff --git a/company_scrap_management/static/description/assets/screenshots/scrap_management.png b/company_scrap_management/static/description/assets/screenshots/scrap_management.png new file mode 100755 index 000000000..65365fed8 Binary files /dev/null and b/company_scrap_management/static/description/assets/screenshots/scrap_management.png differ diff --git a/company_scrap_management/static/description/assets/screenshots/stock_scrap.png b/company_scrap_management/static/description/assets/screenshots/stock_scrap.png new file mode 100755 index 000000000..7f279685c Binary files /dev/null and b/company_scrap_management/static/description/assets/screenshots/stock_scrap.png differ diff --git a/company_scrap_management/static/description/banner.jpg b/company_scrap_management/static/description/banner.jpg new file mode 100644 index 000000000..981f92cca Binary files /dev/null and b/company_scrap_management/static/description/banner.jpg differ diff --git a/company_scrap_management/static/description/icon.png b/company_scrap_management/static/description/icon.png new file mode 100755 index 000000000..b51f3fd8e Binary files /dev/null and b/company_scrap_management/static/description/icon.png differ diff --git a/company_scrap_management/static/description/index.html b/company_scrap_management/static/description/index.html new file mode 100644 index 000000000..9b5615fbd --- /dev/null +++ b/company_scrap_management/static/description/index.html @@ -0,0 +1,665 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Scrap Management

+

+ Managing Scrap in a + company and dismantling the product and reuse non defected + component

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps to manage scrap dismantling and reuse non defected + product +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Available in Odoo 16.0 + Community and Enterprise. +
+
+ + Handle Scrap dismantle according to scrap order +
+
+ + Select operation type for + scrap order. +
+
+ + Stock will be updated after dismantle +
+
+
+
+ + Product moves can be viewed +
+ +
+ + Get your scrap management report +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Scrap order operation + selection +

+

+ Operation type for the + scrap can be choosen when the order creation and only dismantle + scrap order can be managed

+ +
+ +
+

+ Scrap Management +

+

+ Scrap Orders can be + chosen, On fetching components will be shown

+ +
+
+

+ PDF Report of scrap + management +

+

+ Scrap management + report

+ +
+

+ On the basis + product

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

+ Related + Products +

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

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/company_scrap_management/views/scrap_management_line_views.xml b/company_scrap_management/views/scrap_management_line_views.xml new file mode 100644 index 000000000..87605c693 --- /dev/null +++ b/company_scrap_management/views/scrap_management_line_views.xml @@ -0,0 +1,20 @@ + + + + + Scrap Management Line + scrap.management.line + tree + + + scrap.management.line.view.tree + scrap.management.line + + + + + + + + + diff --git a/company_scrap_management/views/scrap_management_views.xml b/company_scrap_management/views/scrap_management_views.xml new file mode 100644 index 000000000..2685d1c73 --- /dev/null +++ b/company_scrap_management/views/scrap_management_views.xml @@ -0,0 +1,85 @@ + + + + + Scrap Management + scrap.management + tree,form + + + scrap.management.view.tree + scrap.management + + + + + + + + + + + scrap.management.view.form + scrap.management + +
+
+
+ +
+ +
+
+

+ +

+
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ +
diff --git a/company_scrap_management/views/stock_scrap_views.xml b/company_scrap_management/views/stock_scrap_views.xml new file mode 100644 index 000000000..6b0886453 --- /dev/null +++ b/company_scrap_management/views/stock_scrap_views.xml @@ -0,0 +1,20 @@ + + + + + + stock.scrap.view.form.inherit.company.scrap.management + + stock.scrap + + + + + + + + + + + diff --git a/company_scrap_management/wizard/__init__.py b/company_scrap_management/wizard/__init__.py new file mode 100644 index 000000000..6fc4a8041 --- /dev/null +++ b/company_scrap_management/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from . import scrap_management_report diff --git a/company_scrap_management/wizard/scrap_management_report.py b/company_scrap_management/wizard/scrap_management_report.py new file mode 100644 index 000000000..03eca397c --- /dev/null +++ b/company_scrap_management/wizard/scrap_management_report.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Ranjith R() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +########################################################################### +from odoo import fields, models + + +class ScrapManagementReport(models.TransientModel): + """Get report about contract """ + _name = 'scrap.management.report' + _description = 'Report of Scrap Management' + + filter = fields.Selection( + default="product_wise", selection=[('product_wise', 'Product Wise'), + ('state_wise', 'State Wise')], + help="field to choose filter of report", string="Based On") + product_ids = fields.Many2many('product.product', + string="Product", + help="Field to choose product for report") + state = fields.Selection([('draft', 'Draft'), ('done', 'Done'), + ('confirm', 'Confirm')], + default="done", string="State", + help="Field to specify state of report") + from_date = fields.Date(string="Start date", + help="Field to choose start date of report") + to_date = fields.Date(string="End date", + help="Field to end date filter of report") + + def action_print_pdf(self): + """ + Summary: + function to print pdf + Return: + pdf report + """ + if self.filter == 'product_wise': + query = """SELECT scrap_management.scrap_management_number, + scrap_management.scrap_order_id, + product_template.name->> 'en_US'AS product, + scrap_management.state,stock_scrap.product_id,scrap_management.date, + stock_scrap.name FROM scrap_management + inner join stock_scrap on + scrap_management.scrap_order_id= stock_scrap.id + inner join product_product on + product_product.id=stock_scrap.product_id + inner join product_template on + product_template.id=product_product.product_tmpl_id + """ + lst = [] + for product in self.product_ids: + lst.append(product.id) + if self.product_ids: + lst.append(0) + query += f""" where stock_scrap.product_id in {tuple(lst)}""" + if self.from_date: + query += f""" and scrap_management.date >= '{self.from_date}' """ + if self.from_date: + query += f""" and scrap_management.date <= '{self.to_date}' """ + self.env.cr.execute(query) + datas = self.env.cr.dictfetchall() + data = { + 'form': self.read()[0], + 'datas': datas, + 'from_date': self.from_date, + 'to_date': self.to_date + } + return self.env.ref( + 'company_scrap_management' + '.action_scrap_management_product_wise').report_action( + None, + data=data) + if self.filter == 'state_wise': + query = """SELECT scrap_management.scrap_management_number, + stock_scrap.name,scrap_management.scrap_order_id, + scrap_management.state,stock_scrap.product_id,stock_scrap.name, + scrap_management.date FROM scrap_management + inner join stock_scrap + on scrap_management.scrap_order_id= stock_scrap.id + """ + if self.state: + query += f"""where scrap_management.state = '{self.state}' """ + if self.from_date: + query += f""" and scrap_management.date >= '{self.from_date}' """ + if self.from_date: + query += f""" and scrap_management.date <= '{self.to_date}' """ + self.env.cr.execute(query) + datas = self.env.cr.dictfetchall() + data = { + 'form': self.read()[0], + 'datas': datas, + 'state': self.state, + 'from_date': self.from_date, + 'to_date': self.to_date + } + return self.env.ref( + 'company_scrap_management' + '.action_scrap_management_state_wise').report_action(None, + data=data) diff --git a/company_scrap_management/wizard/scrap_management_report_views.xml b/company_scrap_management/wizard/scrap_management_report_views.xml new file mode 100644 index 000000000..d2dad1270 --- /dev/null +++ b/company_scrap_management/wizard/scrap_management_report_views.xml @@ -0,0 +1,47 @@ + + + + + Scrap Management Report + scrap.management.report + form + new + + + scrap.management.report.view.form + scrap.management.report + +
+ + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +