Browse Source

[ADD] Initial Commit

pull/29/head
SHEREEF PT 8 years ago
parent
commit
236b1d0381
  1. 22
      partner_emails_history/README.rst
  2. 23
      partner_emails_history/__init__.py
  3. 38
      partner_emails_history/__manifest__.py
  4. 23
      partner_emails_history/models/__init__.py
  5. 39
      partner_emails_history/models/partner_emails_history.py
  6. BIN
      partner_emails_history/static/description/banner.jpg
  7. BIN
      partner_emails_history/static/description/customer_form.png
  8. BIN
      partner_emails_history/static/description/cybro_logo.png
  9. BIN
      partner_emails_history/static/description/icon.png
  10. 83
      partner_emails_history/static/description/index.html
  11. BIN
      partner_emails_history/static/description/received_mails.png
  12. BIN
      partner_emails_history/static/description/sent_emails.png
  13. 19
      partner_emails_history/views/partner_emails_history_view.xml
  14. 6
      project_lifeline/__init__.py
  15. 11
      project_lifeline/__manifest__.py
  16. 6
      project_lifeline/models/__init__.py
  17. 6
      project_lifeline/models/progress_bar_color.py
  18. 27
      project_lifeline/models/task_lifeline.py
  19. 3
      project_lifeline/security/ir.model.access.csv
  20. BIN
      project_lifeline/static/description/freeze.png
  21. 32
      project_lifeline/static/description/index.html
  22. 13
      project_lifeline/views/task_lifeline_view.xml

22
partner_emails_history/README.rst

@ -0,0 +1,22 @@
Partner Email History v10
==========================
This module was developed to track sent/received emails from partner form.
Installation
============
Just select it from available modules to install it, there is no need to extra installations.
Configuration
=============
Nothing to configure.
Usage
=====
To use this functionality, you need to:
#.Click on Sent Email button to view all sent emails
#.And click on Received Email button to view all received emails
Credits
=======
Developer: Saritha @ cybrosys

23
partner_emails_history/__init__.py

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

38
partner_emails_history/__manifest__.py

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "Partner Email History",
'version': '10.0.1.0.0',
'summary': """ Send/Received Mails From Partner Form""",
'description': """Send/Received Emails From Partner Form""",
'author': "Cybrosys Techno Solutions",
'website': "https://www.cybrosys.com",
'category': 'Tools',
'depends': ['base', 'mail'],
'data': ['views/partner_emails_history_view.xml'],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

23
partner_emails_history/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
import partner_emails_history

39
partner_emails_history/models/partner_emails_history.py

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<https://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 <https://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models
class PartnerEmailHistory(models.Model):
_inherit = 'res.partner'
def sent_email_history(self):
action = self.env.ref('mail.action_view_mail_mail')
result = action.read()[0]
result['domain'] = [('email_from', '=', self.email)]
return result
def received_email_history(self):
action = self.env.ref('mail.action_view_mail_mail')
result = action.read()[0]
result['domain'] = ['|', ('email_to', '=', self.email), ('recipient_ids', '=', self.email)]
return result

BIN
partner_emails_history/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

BIN
partner_emails_history/static/description/customer_form.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

BIN
partner_emails_history/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
partner_emails_history/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

83
partner_emails_history/static/description/index.html

@ -0,0 +1,83 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Partner Email History</h2>
<h3 class="oe_slogan">Maintains Email History(Sent mail and Received mail) In Partner Form</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_picture">
<h3 class="oe_slogan">Overview</h3>
<p class="oe_mt32">
Partner Email History,Maintains Email History(Sent emails and Received emails) In Partner Form.
</p>
<p>
* We Have Sent Emails Button To View All Sent Emails And Received Emails Button To View All Received Emails.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="customer_form.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_space">
<h3 class="oe_slogan">Sent Emails</h3>
<div class="oe_span6">
<p class='oe_mt32'>
<centre>Here ,we can view all sent emails of partner</centre>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="sent_emails.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan"> Received Emails</h3>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="received_mails.png">
</div>
</div>
<div class="oe_span6">
<p class='oe_mt32'>
Here,We can view all received emails of partner.
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;" 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;"
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;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
</section>

BIN
partner_emails_history/static/description/received_mails.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
partner_emails_history/static/description/sent_emails.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

19
partner_emails_history/views/partner_emails_history_view.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="res_partner_email_view_buttons">
<field name="name">res.partner.view.buttons</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_inline oe_stat_button" type="object" string="Sent Emails" attrs="{'invisible': [('customer', '=', False)]}"
name="sent_email_history" icon="fa-mail-forward"/>
<button class="oe_inline oe_stat_button" type="object" string="Received Emails" attrs="{'invisible': [('customer', '=', False)]}"
name="received_email_history" icon="fa-mail-reply"/>
</xpath>
</field>
</record>
</data>
</odoo>

6
project_lifeline/__init__.py

@ -2,8 +2,8 @@
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# Copyright (C) 2009-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -17,7 +17,7 @@
#
# 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/>.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
import models

11
project_lifeline/__manifest__.py

@ -2,8 +2,8 @@
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -17,7 +17,7 @@
#
# 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/>.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
{
@ -25,12 +25,13 @@
'summary': """Lifeline Progressbar for Tasks (100% -> 0%)""",
'description': """Calculates the time remaining based on live time & deadline.""",
'author': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'category': 'Project',
'version': '10.0.1.0.0',
'version': '10.0.2.0.0',
'depends': ['base', 'project'],
'data': [
'security/ir.model.access.csv',
'views/task_lifeline_view.xml',
'views/progress_bar_view.xml',
'views/progress_bar_settings.xml',

6
project_lifeline/models/__init__.py

@ -2,8 +2,8 @@
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -17,7 +17,7 @@
#
# 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/>.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
import task_lifeline

6
project_lifeline/models/progress_bar_color.py

@ -2,8 +2,8 @@
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -17,7 +17,7 @@
#
# 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/>.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import models, fields, api, exceptions, _

27
project_lifeline/models/task_lifeline.py

@ -2,8 +2,8 @@
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<http://www.cybrosys.com>)
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Nilmar Shereef(<https://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
@ -17,18 +17,25 @@
#
# 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/>.
# If not, see <https://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import fields, models
from dateutil.relativedelta import relativedelta
from odoo import fields, models
class ProjectStages(models.Model):
_inherit = 'project.task.type'
freeze_state = fields.Boolean(string='Is Freeze State',
help="Enable to stop the life line running at this Stages.")
class TaskLifeline(models.Model):
_inherit = 'project.task'
lifeline = fields.Float(string="Life line", default='100', copy=False, readonly=True)
date_deadline = fields.Datetime('Deadline', required=True)
date_deadline_ext = fields.Datetime('Deadline', required=True)
def process_lifeline_scheduler(self):
task_obj = self.env['project.task']
@ -36,11 +43,9 @@ class TaskLifeline(models.Model):
time_now = fields.Datetime.from_string(fields.Datetime.now())
for task in task_ids:
start_date = fields.Datetime.from_string(task.date_assign)
end_date = fields.Datetime.from_string(task.date_deadline)
if task.stage_id and (task.stage_id.name == 'Done' or task.stage_id.name == 'Cancelled'):
task.lifeline = 0
else:
if task.date_deadline and task.date_assign and end_date > start_date:
end_date = fields.Datetime.from_string(task.date_deadline_ext)
if task.stage_id and task.stage_id.freeze_state != True:
if task.date_deadline_ext and task.date_assign and end_date > start_date:
if time_now < end_date:
total_difference_days = relativedelta(end_date, start_date)
difference_minute = total_difference_days.hours * 60 + total_difference_days.minutes
@ -56,4 +61,4 @@ class TaskLifeline(models.Model):
else:
task.lifeline = 0
else:
task.lifeline = 0
task.lifeline = 0

3
project_lifeline/security/ir.model.access.csv

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_set_progressbar_color,access.set.progressbar.color,model_set_progressbar_color,project.group_project_user,1,0,0,0
manager_set_progressbar_color,access.set.progressbar.color.manager,model_set_progressbar_color,project.group_project_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_set_progressbar_color access.set.progressbar.color model_set_progressbar_color project.group_project_user 1 0 0 0
3 manager_set_progressbar_color access.set.progressbar.color.manager model_set_progressbar_color project.group_project_manager 1 1 1 1

BIN
project_lifeline/static/description/freeze.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

32
project_lifeline/static/description/index.html

@ -2,7 +2,7 @@
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">LifeLine ProgressBar for Task</h2>
<h3 class="oe_slogan">LifeLine is calculated based on live time and deadline time.</h3>
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4>
</div>
<div class="row oe_row oe_spaced">
<div class="col-md-6">
@ -20,7 +20,7 @@
</section>
<section class="oe_container">
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<p class='oe_mt32'>
&#x261B; Default Form/Tree view of Task
@ -40,7 +40,7 @@
</div>
</section>
<section class="oe_container oe_dark">
<section class="oe_container ">
<div class="oe_row oe_padded">
<p class='oe_mt32'>
&#x261B;User Can Define the Color of Progressbar for Different Percentage Ranges.
@ -61,6 +61,7 @@
<div class="oe_span6">
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<p class='oe_mt32'>
@ -76,10 +77,10 @@
<img class="oe_picture oe_screenshot" src="set_range_green.png">
</div>
</div>
</div>
</section>
<section class="oe_container ">
<section class="oe_container">
<div class="oe_row oe_padded">
<p class='oe_mt32'>
&#x261B;Color of progressbar based on different ranges
@ -96,6 +97,7 @@
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_padded">
<p class='oe_mt32'>
@ -114,17 +116,31 @@
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_padded">
<p class='oe_mt32'>
&#x261B;Stop the life line running based on Stages.
</p>
<div class="oe_span6">
<p>Project >Settings >Stages >Enable:Is Freeze State</p>
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="freeze.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;" href="http://www.cybrosys.com"><i
style="color: #FFFFFF !important;" href="https://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;"
href="http://www.cybrosys.com/contact/"><i
href="https://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;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">

13
project_lifeline/views/task_lifeline_view.xml

@ -22,13 +22,24 @@
</field>
</record>
<record id="project_stage_freeze_form_view" model="ir.ui.view">
<field name="name">project.stage.freeze.form</field>
<field name="model">project.task.type</field>
<field name="inherit_id" ref="project.task_type_edit"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='fold']" position="after">
<field name="freeze_state"/>
</xpath>
</field>
</record>
<record id="project_lifeline_form_view" model="ir.ui.view">
<field name="name">project.lifeline.form</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='date_deadline']" position="replace">
<field name="date_deadline"/>
<field name="date_deadline_ext"/>
</xpath>
<xpath expr="//field[@name='tag_ids']" position="after">
<field name="lifeline" widget="progressbar"/>

Loading…
Cancel
Save