Browse Source

[ADD] Initial Commit

pull/81/head
SHEREEF PT 8 years ago
parent
commit
c1f84652b5
  1. 23
      mrp_progressbar/__init__.py
  2. 37
      mrp_progressbar/__openerp__.py
  3. 23
      mrp_progressbar/models/__init__.py
  4. 52
      mrp_progressbar/models/mrp_progressbar.py
  5. BIN
      mrp_progressbar/static/description/banner.jpg
  6. BIN
      mrp_progressbar/static/description/cybro_logo.png
  7. BIN
      mrp_progressbar/static/description/icon.png
  8. 67
      mrp_progressbar/static/description/index.html
  9. BIN
      mrp_progressbar/static/description/screenshot_progressbar1.png
  10. BIN
      mrp_progressbar/static/description/screenshot_progressbar2.png
  11. 27
      mrp_progressbar/views/mrp_progressbar.xml

23
mrp_progressbar/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<http://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/>.
#
##############################################################################
import models

37
mrp_progressbar/__openerp__.py

@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<http://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': '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,
}

23
mrp_progressbar/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<http://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/>.
#
##############################################################################
import mrp_progressbar

52
mrp_progressbar/models/mrp_progressbar.py

@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2015-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<http://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/>.
#
##############################################################################
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")

BIN
mrp_progressbar/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
mrp_progressbar/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
mrp_progressbar/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

67
mrp_progressbar/static/description/index.html

@ -0,0 +1,67 @@
<section class="oe_container">
<div class="oe_spaced">
<h2 class="oe_slogan">MRP Progress Bar</h2>
<h3 class="oe_slogan">This is a module which shows a Progress Bar in the Form and Tree view of
the Work orders in Manufacturing.</h3>
<h4 class="oe_slogan" style="font-size: 23px;">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_spaced">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32" style="text-align: center">
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.
</p>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_spaced">
<h3 class="oe_slogan">Tree view</h3>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="screenshot_progressbar1.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_spaced">
<h3 class="oe_slogan">Form view</h3>
<div class="" style="text-align: center">
<div class="oe_demo oe_picture oe_screenshot">
<img style="border:10px solid white;height: 400px;" src="screenshot_progressbar2.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="http://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="http://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="http://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
mrp_progressbar/static/description/screenshot_progressbar1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
mrp_progressbar/static/description/screenshot_progressbar2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

27
mrp_progressbar/views/mrp_progressbar.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="mrp_progressbar_form_view" model="ir.ui.view">
<field name="name">mrp_progressbar_form.view</field>
<field name="model">mrp.production.workcenter.line</field>
<field name="inherit_id" ref="mrp_operations.mrp_production_workcenter_form_view_inherit"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='sequence']" position="after">
<field name="progress_bar" widget="progressbar"/>
<field name="progress_bar_compute" invisible="1"/>
</xpath>
</field>
</record>
<record id="mrp_progressbar_tree_view" model="ir.ui.view">
<field name="name">mrp_progressbar_tree.view</field>
<field name="model">mrp.production.workcenter.line</field>
<field name="inherit_id" ref="mrp_operations.mrp_production_workcenter_tree_view_inherit"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="before">
<field name="progress_bar" widget="progressbar"/>
<field name="progress_bar_compute" invisible="1"/>
</xpath>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save