diff --git a/mrp_progressbar/__init__.py b/mrp_progressbar/__init__.py new file mode 100644 index 000000000..159e5a92a --- /dev/null +++ b/mrp_progressbar/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## +import models diff --git a/mrp_progressbar/__openerp__.py b/mrp_progressbar/__openerp__.py new file mode 100644 index 000000000..e7285ec24 --- /dev/null +++ b/mrp_progressbar/__openerp__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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': 'MRP Progress Bar', + 'summary': """Work Order Progressbar In form view & Tree View""", + 'version': '9.0.1.0.0', + 'author': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + "category": "MRP", + 'depends': ['mrp_operations'], + 'data': ['views/mrp_progressbar.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False, +} diff --git a/mrp_progressbar/models/__init__.py b/mrp_progressbar/models/__init__.py new file mode 100644 index 000000000..95ff18f0e --- /dev/null +++ b/mrp_progressbar/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 . +# +############################################################################## +import mrp_progressbar diff --git a/mrp_progressbar/models/mrp_progressbar.py b/mrp_progressbar/models/mrp_progressbar.py new file mode 100644 index 000000000..cdd0dd176 --- /dev/null +++ b/mrp_progressbar/models/mrp_progressbar.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2015-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 datetime import datetime +import time +from openerp import models, fields + + +class MrpProgressBar(models.Model): + + _inherit = 'mrp.production.workcenter.line' + + def time_progress(self): + for records in self: + if records.state == 'startworking': + if records.date_planned and records.date_planned_end: + start_date = datetime.strptime(records.date_planned, "%Y-%m-%d %H:%M:%S") + end_date = datetime.strptime(records.date_planned_end, "%Y-%m-%d %H:%M:%S") + # convert to unix timestamp + start_date_seconds = time.mktime(start_date.timetuple()) + end_date_seconds = time.mktime(end_date.timetuple()) + today_seconds = time.mktime(datetime.today().timetuple()) + total_diff = end_date_seconds - start_date_seconds + current_diff = today_seconds - start_date_seconds + percentage = ((current_diff / total_diff) * 100) + if percentage > 100: + percentage = 100 + if percentage < 0.0: + percentage = 0 + records.write({'progress_bar': percentage}) + + progress_bar = fields.Float(string="Progress", readonly=True) + progress_bar_compute = fields.Float(string="Progress compute", compute="time_progress") diff --git a/mrp_progressbar/static/description/banner.jpg b/mrp_progressbar/static/description/banner.jpg new file mode 100644 index 000000000..241a0456c Binary files /dev/null and b/mrp_progressbar/static/description/banner.jpg differ diff --git a/mrp_progressbar/static/description/cybro_logo.png b/mrp_progressbar/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/mrp_progressbar/static/description/cybro_logo.png differ diff --git a/mrp_progressbar/static/description/icon.png b/mrp_progressbar/static/description/icon.png new file mode 100644 index 000000000..eae8f79cc Binary files /dev/null and b/mrp_progressbar/static/description/icon.png differ diff --git a/mrp_progressbar/static/description/index.html b/mrp_progressbar/static/description/index.html new file mode 100644 index 000000000..80d68857f --- /dev/null +++ b/mrp_progressbar/static/description/index.html @@ -0,0 +1,67 @@ +
+
+

MRP Progress Bar

+

This is a module which shows a Progress Bar in the Form and Tree view of + the Work orders in Manufacturing.

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+
+ +
+
+

Overview

+

+ MRP Progress Bar module is a sub module of manufacturing operations in odoo. + MRP Progress Bar is completely dependent on the Manufacturing Operations Module in odoo. + MRP Progress Bar creates a new progress bar in Tree and Form View of work orders in Manufacturing. + MRP Progress Bar helps you to easily understand the progress of work orders. +

+
+
+ +
+
+

Tree view

+
+
+ +
+
+
+
+
+
+

Form view

+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
\ No newline at end of file diff --git a/mrp_progressbar/static/description/screenshot_progressbar1.png b/mrp_progressbar/static/description/screenshot_progressbar1.png new file mode 100644 index 000000000..393843e4c Binary files /dev/null and b/mrp_progressbar/static/description/screenshot_progressbar1.png differ diff --git a/mrp_progressbar/static/description/screenshot_progressbar2.png b/mrp_progressbar/static/description/screenshot_progressbar2.png new file mode 100644 index 000000000..1cfcc1c88 Binary files /dev/null and b/mrp_progressbar/static/description/screenshot_progressbar2.png differ diff --git a/mrp_progressbar/views/mrp_progressbar.xml b/mrp_progressbar/views/mrp_progressbar.xml new file mode 100644 index 000000000..73759178b --- /dev/null +++ b/mrp_progressbar/views/mrp_progressbar.xml @@ -0,0 +1,27 @@ + + + + + mrp_progressbar_form.view + mrp.production.workcenter.line + + + + + + + + + + mrp_progressbar_tree.view + mrp.production.workcenter.line + + + + + + + + + + \ No newline at end of file