Browse Source

Internal Purpose

pull/29/head
cybroodoo 8 years ago
commit
91c3f62ca0
  1. 23
      account_pdc/__init__.py
  2. 41
      account_pdc/__manifest__.py
  3. 19
      account_pdc/data/account_pdc_data.xml
  4. 25
      account_pdc/models/__init__.py
  5. 49
      account_pdc/models/account_journal.py
  6. 110
      account_pdc/models/account_payment.py
  7. BIN
      account_pdc/static/description/banner.jpg
  8. BIN
      account_pdc/static/description/cybro_logo.png
  9. BIN
      account_pdc/static/description/icon.png
  10. 92
      account_pdc/static/description/index.html
  11. BIN
      account_pdc/static/description/pdc_config.png
  12. BIN
      account_pdc/static/description/pdc_payment.png
  13. BIN
      account_pdc/static/description/pdc_payment_eff.png
  14. BIN
      account_pdc/static/description/pdc_report.png
  15. 77
      account_pdc/views/account_payment_view.xml
  16. 24
      account_pdc_payment_report/__init__.py
  17. 43
      account_pdc_payment_report/__manifest__.py
  18. 3
      account_pdc_payment_report/report/__init__.py
  19. 60
      account_pdc_payment_report/report/report_payment.py
  20. BIN
      account_pdc_payment_report/static/description/banner.jpg
  21. BIN
      account_pdc_payment_report/static/description/cybro_logo.png
  22. BIN
      account_pdc_payment_report/static/description/icon.png
  23. 53
      account_pdc_payment_report/static/description/index.html
  24. BIN
      account_pdc_payment_report/static/description/pdc_report.png
  25. 76
      account_pdc_payment_report/views/report_payment.xml
  26. 23
      account_pdc_payment_report/wizard/__init__.py
  27. 77
      account_pdc_payment_report/wizard/account_report_payment.py
  28. 61
      account_pdc_payment_report/wizard/account_report_payment_view.xml
  29. 34
      cab_booking_management/README.rst
  30. 24
      cab_booking_management/__init__.py
  31. 47
      cab_booking_management/__manifest__.py
  32. 32
      cab_booking_management/models/__init__.py
  33. 52
      cab_booking_management/models/cab_booking.py
  34. 31
      cab_booking_management/models/cab_conf.py
  35. 92
      cab_booking_management/models/cab_creation.py
  36. 14
      cab_booking_management/models/cab_location.py
  37. 163
      cab_booking_management/models/cab_log.py
  38. 55
      cab_booking_management/models/cab_maintanence.py
  39. 56
      cab_booking_management/models/cab_timing.py
  40. 16
      cab_booking_management/security/ir.model.access.csv
  41. BIN
      cab_booking_management/static/description/banner.jpg
  42. BIN
      cab_booking_management/static/description/booking.png
  43. BIN
      cab_booking_management/static/description/cab_activity.png
  44. BIN
      cab_booking_management/static/description/cab_booking.png
  45. BIN
      cab_booking_management/static/description/cab_cancel.png
  46. BIN
      cab_booking_management/static/description/cab_conf.png
  47. BIN
      cab_booking_management/static/description/cab_creation.png
  48. BIN
      cab_booking_management/static/description/cab_details.png
  49. BIN
      cab_booking_management/static/description/cab_maintain.png
  50. BIN
      cab_booking_management/static/description/cybro_logo.png
  51. BIN
      cab_booking_management/static/description/icon.png
  52. 177
      cab_booking_management/static/description/index.html
  53. BIN
      cab_booking_management/static/description/log_details.png
  54. BIN
      cab_booking_management/static/description/mail.png
  55. 71
      cab_booking_management/views/cab_booking_view.xml
  56. 55
      cab_booking_management/views/cab_conf_view.xml
  57. 147
      cab_booking_management/views/cab_creation_view.xml
  58. 57
      cab_booking_management/views/cab_location_view.xml
  59. 109
      cab_booking_management/views/cab_log_view.xml
  60. 68
      cab_booking_management/views/cab_maintanence_view.xml
  61. 63
      cab_booking_management/views/cab_timing_view.xml
  62. 23
      cab_booking_management/views/templates.xml
  63. 23
      crm_drag_back_permission/__init__.py
  64. 43
      crm_drag_back_permission/__manifest__.py
  65. 25
      crm_drag_back_permission/models/__init__.py
  66. 141
      crm_drag_back_permission/models/update_kanban_record.py
  67. 4
      crm_drag_back_permission/security/ir.model.access.csv
  68. BIN
      crm_drag_back_permission/static/description/banner.jpg
  69. BIN
      crm_drag_back_permission/static/description/icon.png
  70. BIN
      crm_drag_back_permission/static/description/image1.png
  71. BIN
      crm_drag_back_permission/static/description/image2.png
  72. BIN
      crm_drag_back_permission/static/description/image3.png
  73. BIN
      crm_drag_back_permission/static/description/image4.png
  74. BIN
      crm_drag_back_permission/static/description/image5.png
  75. 96
      crm_drag_back_permission/static/description/index.html
  76. 19
      crm_drag_back_permission/static/src/js/hide_stage.js
  77. 116
      crm_drag_back_permission/views/crm_lead_update.xml
  78. 21
      crm_drag_back_permission/views/crm_sales_team.xml
  79. 12
      crm_drag_back_permission/views/templates.xml
  80. 36
      cron_failure_notification/README.rst
  81. 22
      cron_failure_notification/__init__.py
  82. 50
      cron_failure_notification/__manifest__.py
  83. 50
      cron_failure_notification/__manifest__.py~
  84. 21
      cron_failure_notification/demo/ir_cron_demo.xml
  85. 23
      cron_failure_notification/models/__init__.py
  86. 113
      cron_failure_notification/models/logs_scheduled_actions.py
  87. BIN
      cron_failure_notification/static/description/banner.jpg
  88. BIN
      cron_failure_notification/static/description/cybro_logo.png
  89. BIN
      cron_failure_notification/static/description/icon.png
  90. 85
      cron_failure_notification/static/description/index.html
  91. BIN
      cron_failure_notification/static/description/logs_form_view.png
  92. BIN
      cron_failure_notification/static/description/logs_mail_template.png
  93. BIN
      cron_failure_notification/static/description/logs_pdf_report.png
  94. 55
      cron_failure_notification/views/error_log_report_template.xml
  95. 25
      cron_failure_notification/views/error_mail_template.xml
  96. 77
      cron_failure_notification/views/logs_scheduled_actions_view.xml
  97. 12
      cron_failure_notification/views/report.xml
  98. 21
      developer_mode/README.rst
  99. 23
      developer_mode/__init__.py
  100. 43
      developer_mode/__manifest__.py

23
account_pdc/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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

41
account_pdc/__manifest__.py

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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': 'PDC Management',
'version': '10.0.1.0',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'category': 'Accounting',
'summary': 'Extension on Cheques to handle Post Dated Cheques',
'description': """ Extension on Cheques to handle Post Dated Cheques """,
'depends': ['account_check_printing'],
'data': [
'data/account_pdc_data.xml',
'views/account_payment_view.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
}

19
account_pdc/data/account_pdc_data.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="account_payment_method_pdc_in" model="account.payment.method">
<field name="name">PDC</field>
<field name="code">pdc</field>
<field name="payment_type">inbound</field>
</record>
<record id="account_payment_method_pdc_out" model="account.payment.method">
<field name="name">PDC</field>
<field name="code">pdc</field>
<field name="payment_type">outbound</field>
</record>
<!--<function model="account.journal" name="_enable_check_printing_on_bank_journals"/>-->
</data>
</odoo>

25
account_pdc/models/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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 account_journal
import account_payment

49
account_pdc/models/account_journal.py

@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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 odoo import models, api, _
class AccountJournal(models.Model):
_inherit = "account.journal"
@api.one
@api.depends('outbound_payment_method_ids')
def _compute_check_printing_payment_method_selected(self):
self.check_printing_payment_method_selected = any(
pm.code in ['check_printing', 'pdc'] for pm in self.outbound_payment_method_ids)
@api.model
def _enable_pdc_on_bank_journals(self):
""" Enables check printing payment method and add a check sequence on bank journals.
Called upon module installation via data file.
"""
pdcin = self.env.ref('account_pdc.account_payment_method_pdc_in')
pdcout = self.env.ref('account_pdc.account_payment_method_pdc_out')
bank_journals = self.search([('type', '=', 'bank')])
for bank_journal in bank_journals:
# bank_journal._create_check_sequence()
bank_journal.write({
'inbound_payment_method_ids': [(4, pdcin.id, None)],
'outbound_payment_method_ids': [(4, pdcout.id, None)],
})

110
account_pdc/models/account_payment.py

@ -0,0 +1,110 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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 odoo import models, fields, api, _
from odoo.exceptions import UserError
class AccountRegisterPayments(models.TransientModel):
_inherit = "account.register.payments"
bank_reference = fields.Char(copy=False)
cheque_reference = fields.Char(copy=False)
effective_date = fields.Date('Effective Date', help='Effective date of PDC', copy=False, default=False)
def get_payment_vals(self):
res = super(AccountRegisterPayments, self).get_payment_vals()
if self.payment_method_id == self.env.ref('account_check_printing.account_payment_method_check'):
res.update({
'check_amount_in_words': self.check_amount_in_words,
'check_manual_sequencing': self.check_manual_sequencing,
'effective_date': self.effective_date,
})
return res
class AccountPayment(models.Model):
_inherit = "account.payment"
bank_reference = fields.Char(copy=False)
cheque_reference = fields.Char(copy=False)
effective_date = fields.Date('Effective Date', help='Effective date of PDC', copy=False, default=False)
@api.multi
def print_checks(self):
""" Check that the recordset is valid, set the payments state to sent and call print_checks() """
# Since this method can be called via a client_action_multi, we need to make sure the received records are what we expect
self = self.filtered(lambda r: r.payment_method_id.code in ['check_printing', 'pdc'] and r.state != 'reconciled')
if len(self) == 0:
raise UserError(_("Payments to print as a checks must have 'Check' or 'PDC' selected as payment method and "
"not have already been reconciled"))
if any(payment.journal_id != self[0].journal_id for payment in self):
raise UserError(_("In order to print multiple checks at once, they must belong to the same bank journal."))
if not self[0].journal_id.check_manual_sequencing:
# The wizard asks for the number printed on the first pre-printed check
# so payments are attributed the number of the check the'll be printed on.
last_printed_check = self.search([
('journal_id', '=', self[0].journal_id.id),
('check_number', '!=', 0)], order="check_number desc", limit=1)
next_check_number = last_printed_check and last_printed_check.check_number + 1 or 1
return {
'name': _('Print Pre-numbered Checks'),
'type': 'ir.actions.act_window',
'res_model': 'print.prenumbered.checks',
'view_type': 'form',
'view_mode': 'form',
'target': 'new',
'context': {
'payment_ids': self.ids,
'default_next_check_number': next_check_number,
}
}
else:
self.filtered(lambda r: r.state == 'draft').post()
self.write({'state': 'sent'})
return self.do_print_checks()
def _get_move_vals(self, journal=None):
""" Return dict to create the payment move
"""
journal = journal or self.journal_id
if not journal.sequence_id:
raise UserError(_('Configuration Error !'),
_('The journal %s does not have a sequence, please specify one.') % journal.name)
if not journal.sequence_id.active:
raise UserError(_('Configuration Error !'), _('The sequence of journal %s is deactivated.') % journal.name)
name = self.move_name or journal.with_context(ir_sequence_date=self.payment_date).sequence_id.next_by_id()
if self.payment_method_code =='pdc':
date = self.effective_date
else:
date = self.payment_date
return {
'name': name,
'date': date,
'ref': self.communication or '',
'company_id': self.company_id.id,
'journal_id': journal.id,
}

BIN
account_pdc/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
account_pdc/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
account_pdc/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

92
account_pdc/static/description/index.html

@ -0,0 +1,92 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">PDC Management</h2>
<h3 class="oe_slogan">...A simple way to handle Post Dated Checks...</h3>
<h4 class="oe_slogan">Cybrosys Techno Solutions, www.cybrosys.com</h4>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h3 class="oe_slogan">Configuration</h3>
</div>
<div class="oe_span8">
<div class="oe_demo oe_picture oe_screenshot">
<img src="pdc_config.png">
</div>
</div>
<div class="oe_span4">
<p class="oe_mt32">
<p><b>Select PDC:</b></p>
<p>As shown here, You have to select PDC to enable the PDC payment.This is only available with Journal of type 'Bank'</p>
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h3 class="oe_slogan">At The Time of Payment You Will Have</h3>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="pdc_payment.png">
</div>
</div>
<div class="oe_span4">
<p class="oe_mt32">
<p>Payment form have two extra fields to put Bank and Check Detail.</p>
</p>
</div>
</div>
<div class="oe_row oe_spaced">
<div class="oe_span4">
<p class="oe_mt32">
<p>When you select PDC, You have to put 'effective date' of PDC.</p>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="pdc_payment_eff.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
account_pdc/static/description/pdc_config.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
account_pdc/static/description/pdc_payment.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
account_pdc/static/description/pdc_payment_eff.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
account_pdc/static/description/pdc_report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

77
account_pdc/views/account_payment_view.xml

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_check_printing.view_account_payment_form_inherited" model="ir.ui.view">
<field name="name">account.payment.form.inherited</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='post']" position="before">
<button name="print_checks" class="oe_highlight" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('state', '!=', 'posted')]}" string="Print Check" type="object"/>
<button name="unmark_sent" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('state', '!=', 'sent')]}" string="Unmark Sent" type="object"/>
</xpath>
<xpath expr="//div[@name='amount_div']" position="after">
<field name="check_amount_in_words" attrs="{'invisible': [('payment_method_code', 'not in', ['check_printing','pdc'])], 'readonly': [('state', '!=', 'draft')]}" groups="base.group_no_one"/>
</xpath>
<xpath expr="//field[@name='communication']" position="after">
<field name="check_manual_sequencing" invisible="1"/>
<field name="check_number" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('check_number', '=', 0)]}"/>
</xpath>
<xpath expr="//field[@name='payment_date']" position="after">
<field name="effective_date" attrs="{'invisible': [('payment_method_code', '!=', 'pdc')],'required': [('payment_method_code', '=', 'pdc')]}"/>
<field name="bank_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="cheque_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</xpath>
</field>
</record>
<record id="account_check_printing.view_account_payment_invoice_form_inherited" model="ir.ui.view">
<field name="name">account.payment.invoice.form.inherited</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_invoice_form" />
<field name="arch" type="xml">
<xpath expr="//div[@name='amount_div']" position="after">
<field name="check_amount_in_words" attrs="{'invisible': [('payment_method_code', 'not in', ['check_printing','pdc'])]}" groups="base.group_no_one"/>
</xpath>
<xpath expr="//field[@name='communication']" position="after">
<field name="check_manual_sequencing" invisible="1"/>
<field name="check_number" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('check_manual_sequencing', '=', False)]}"/>
</xpath>
<xpath expr="//field[@name='payment_date']" position="after">
<field name="effective_date" attrs="{'invisible': [('payment_method_code', '!=', 'pdc')],'required': [('payment_method_code', '=', 'pdc')]}"/>
<field name="bank_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="cheque_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</xpath>
</field>
</record>
<record id="account_check_printing.view_account_payment_from_invoices_inherited" model="ir.ui.view">
<field name="name">account.register.payments.wizard.inherited</field>
<field name="model">account.register.payments</field>
<field name="inherit_id" ref="account.view_account_payment_from_invoices" />
<field name="arch" type="xml">
<xpath expr="//field[@name='amount']" position="after">
<field name="check_amount_in_words" attrs="{'invisible': [('payment_method_code', 'not in', ['check_printing','pdc'])]}" groups="base.group_no_one"/>
</xpath>
<xpath expr="//field[@name='communication']" position="after">
<field name="check_manual_sequencing" invisible="1"/>
<field name="check_number" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('check_manual_sequencing', '=', False)]}"/>
</xpath>
<xpath expr="//field[@name='payment_date']" position="after">
<field name="effective_date" attrs="{'invisible': [('payment_method_code', '!=', 'pdc')],'required': [('payment_method_code', '=', 'pdc')]}"/>
<field name="bank_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="cheque_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</xpath>
</field>
</record>
<record id="account_check_printing.view_payment_check_printing_search" model="ir.ui.view">
<field name="name">account.payment.check.printing.search</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_search"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='state_sent']" position="before">
<filter string="Checks To Print" domain="[('payment_method_id.code', 'in', ['check_printing','pdc']), ('state','=','posted')]" name="checks_to_send"/>
</xpath>
</field>
</record>
</odoo>

24
account_pdc_payment_report/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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 wizard
import report

43
account_pdc_payment_report/__manifest__.py

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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': 'Payments Report',
'version': '10.0.1.0',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'category': 'Accounting',
'summary': 'Report of Payments with filter for PDC type',
'description': """ Report of Payments with filter for PDC type """,
'depends': ['account_check_printing', 'account_pdc'],
'data': [
'data/account_pdc_data.xml',
'views/account_payment_view.xml',
'views/report_payment.xml',
'wizard/account_report_payment_view.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
}

3
account_pdc_payment_report/report/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import report_payment

60
account_pdc_payment_report/report/report_payment.py

@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
import time
from odoo import api, models
import logging
_logger = logging.getLogger(__name__)
class ReportPayment(models.AbstractModel):
_name = 'report.account_pdc.report_payment_template'
def lines(self, payment_type, journal_ids, pdc_only, data):
domain = []
if isinstance(journal_ids, int):
journal_ids = [journal_ids]
domain.append(('journal_id', 'in', journal_ids))
if payment_type == 'inbound':
domain.append(('payment_type', '=', 'inbound'))
elif payment_type == 'outbound':
domain.append(('payment_type', '=', 'outbound'))
if data['form']['date_from']:
domain.append(('payment_date', '>=', data['form']['date_from']))
if data['form']['date_to']:
domain.append(('payment_date', '<=', data['form']['date_to']))
if data['form']['company_id']:
domain.append(('company_id', '=', data['form']['company_id'][0]))
if pdc_only:
domain.append(('payment_method_id.code', '=', 'pdc'))
if data['form']['effective_date_from']:
domain.append(('effective_date_from', '>=', data['form']['effective_date_from']))
if data['form']['effective_date_to']:
domain.append(('effective_date_to', '<=', data['form']['effective_date_to']))
return self.env['account.payment'].search(domain)
@api.model
def render_html(self, docids, data=None):
_logger.info("................................1..............................")
# target_move = data['form'].get('target_move', 'all')
# sort_selection = data['form'].get('sort_selection', 'date')
payment_type = data['form']['payment_type']
pdc_only = data['form']['pdc_only']
# effective_date_from = data['form']['effective_date_from']
# effective_date_to = data['form']['effective_date_to']
res = {}
for journal in data['form']['journal_ids']:
res[journal] = self.with_context(data['form'].get('used_context', {})).lines(payment_type, journal, pdc_only, data)
docargs = {
'doc_ids': data['form']['journal_ids'],
'doc_model': self.env['account.journal'],
'data': data,
'docs': self.env['account.journal'].browse(data['form']['journal_ids']),
'time': time,
'lines': res,
}
return self.env['report'].render('account_pdc.report_payment_template', docargs)

BIN
account_pdc_payment_report/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
account_pdc_payment_report/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
account_pdc_payment_report/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

53
account_pdc_payment_report/static/description/index.html

@ -0,0 +1,53 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Payments Report</h2>
<h3 class="oe_slogan">...A report of Payments with a filter for PDC...</h3>
<h4 class="oe_slogan">Cybrosys Techno Solutions, www.cybrosys.com</h4>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="pdc_report.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
account_pdc_payment_report/static/description/pdc_report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

76
account_pdc_payment_report/views/report_payment.xml

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_payment_template">
<t t-call="report.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-call="report.internal_layout">
<div class="page">
<h2>Payments Report</h2>
<div class="row mt32">
<div class="col-xs-3">
<strong>Company:</strong>
<p t-esc="res_company.name"/>
</div>
<div class="col-xs-3">
<strong>Journal:</strong>
<t t-foreach="docs" t-as="o"><span t-esc="o.name"/>,</t>
</div>
<div class="col-xs-3">
<strong>Payment Types</strong>
<p t-if="data['form']['payment_type'] == 'inbound'">Customer</p>
<p t-if="data['form']['payment_type'] == 'outbound'">Supplier</p>
<p t-if="data['form']['pdc_only'] == 1"> PDC only</p>
<p t-if="data['form']['payment_type'] == '' and data['form']['pdc_only'] == 0">ALL</p>
</div>
</div>
<t t-foreach="docs" t-as="o">
<t t-if="lines[o.id]">
<h4><t t-esc="o.name"/> Journal</h4>
<table class="table table-condensed">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Partner</th>
<th>Bank Ref.</th>
<th>Cheque Ref.</th>
<th>Amount</th>
<th>Effc. Date</th>
<th>State</th>
</tr>
</thead>
<tbody>
<tr t-foreach="lines[o.id]" t-as="ap">
<td><span t-esc="ap.name"/></td>
<td><span t-field="ap.payment_date"/></td>
<td><span t-esc="ap.sudo().partner_id and ap.sudo().partner_id.name[:23] or ''"/></td>
<td><span t-field="ap.bank_reference"/></td>
<td><span t-field="ap.cheque_reference"/></td>
<td><span t-esc="ap.amount" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></td>
<td><span t-field="ap.effective_date"/></td>
<td><span t-field="ap.state"/></td>
</tr>
</tbody>
</table>
</t>
</t>
</div>
</t>
</t>
</template>
<data>
<report
id="action_report_payment"
model="account.payment"
string="Payments Report"
report_type="qweb-pdf"
name="account_pdc.report_payment_template"
file="account_pdc.report_payment_template"
/>
</data>
</odoo>

23
account_pdc_payment_report/wizard/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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 account_report_payment

77
account_pdc_payment_report/wizard/account_report_payment.py

@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-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 odoo import fields, models, api
class AccountReportPayment(models.TransientModel):
_name = "account.report.payment"
_description = "Account Payment Report"
company_id = fields.Many2one('res.company', string='Company', readonly=True, default=lambda self: self.env.user.company_id)
date_from = fields.Date(string='Start Date')
date_to = fields.Date(string='End Date')
journal_ids = fields.Many2many('account.journal', string='Journals', required=True,
default=lambda self: self.env['account.journal'].search(
[('type', 'in', ['cash', 'bank'])]))
payment_type = fields.Selection([('inbound', 'Customer'), ('outbound', 'Supplier')], 'Payment Type')
pdc_only = fields.Boolean('PDC only')
effective_date_from = fields.Date('Effective Date From')
effective_date_to = fields.Date('Effective Date Upto')
def _build_contexts(self, data):
result = {}
result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
result['date_from'] = data['form']['date_from'] or False
result['date_to'] = data['form']['date_to'] or False
result['payment_type'] = data['form']['payment_type'] or False
result['pdc_only'] = data['form']['pdc_only']
if result['pdc_only']:
result['effective_date_from'] = data['form']['effective_date_from'] or False
result['effective_date_to'] = data['form']['effective_date_to'] or False
result['strict_range'] = True if result['date_from'] else False
return result
@api.multi
def check_report(self):
self.ensure_one()
data = {}
data['ids'] = self.env.context.get('active_ids', [])
data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'payment_type', 'pdc_only', 'effective_date_from', 'effective_date_to', 'company_id'])[0]
used_context = self._build_contexts(data)
data['form']['used_context'] = dict(used_context, lang=self.env.context.get('lang', 'en_US'))
return self._print_report(data)
def _print_report(self, data):
return self.env['report'].with_context(landscape=True).get_action(self, 'account_pdc.report_payment_template', data=data)

61
account_pdc_payment_report/wizard/account_report_payment_view.xml

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_report_payment_view" model="ir.ui.view">
<field name="name">Payments Report</field>
<field name="model">account.report.payment</field>
<field name="arch" type="xml">
<form string="Report Options">
<group>
<group>
<field name="company_id" invisible="1"/>
<field name="payment_type"/>
</group>
<group>
<field name="date_from"/>
<field name="date_to"/>
</group>
</group>
<group>
<group>
<field name="pdc_only"/>
</group>
<group>
<field name="effective_date_from" attrs="{'invisible':[('pdc_only','!=',True)]}"/>
<field name="effective_date_to" attrs="{'invisible': [('pdc_only', '!=', True)]}"/>
</group>
</group>
<group>
</group>
<group>
<field name="journal_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('type', 'in', ('cash', 'bank'))]"/>
</group>
<footer>
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_account_report_payment_menu" model="ir.actions.act_window">
<field name="name">Payments Report</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.report.payment</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account_report_payment_view"/>
<field name="target">new</field>
</record>
<menuitem
id="menu_print_payment"
name="Payments Report"
parent="account.menu_finance_legal_statement"
action="action_account_report_payment_menu"
groups="account.group_account_manager,account.group_account_user"
/>
</odoo>

34
cab_booking_management/README.rst

@ -0,0 +1,34 @@
Cab Booking Management System v10
=================================
This module was developed to manage the cab system.It helps booking the cab, maintains logs
and record every activity related to the cab management.
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:
#.First create cabs(Cab Management > Cabs)
#.Then,you need to set timing for each cabs( Cab management > Timing)
#.On clicking Booking menu( Cab management > Booking) ,you have option to select cabs based on your time and location
#. Email is sent,once your booking is confirmed
#.To get total expense,first you need to set maintenance form ( Cab management > Maintenance).In this form ,you can
select cab and date, and all total activity of that cab on that day is fetched here.
#.To get data's on maintenance form ,first you must book one cab
Credits
=======
Developer: Saritha @ cybrosys
Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in

24
cab_booking_management/__init__.py

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

47
cab_booking_management/__manifest__.py

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY 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': "Cab Booking Management System",
'summary': """Complete Cab Booking Management and its Related Records""",
'author': "Cybrosys Techno Solutions",
'website': "http://www.cybrosys.com",
'category': 'Industries',
'version': '10.0.1.0.0',
'depends': ['base', 'mail'],
'data': [
'views/templates.xml',
'views/cab_log_view.xml',
'views/cab_conf_view.xml',
'views/cab_location_view.xml',
'views/cab_timing_view.xml',
'views/cab_booking_view.xml',
'views/cab_creation_view.xml',
'views/cab_maintanence_view.xml',
'security/ir.model.access.csv'
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': True,
}

32
cab_booking_management/models/__init__.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<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 . import cab_creation
from . import cab_log
from . import cab_conf
from . import cab_booking
from . import cab_location
from . import cab_timing
from. import cab_maintanence

52
cab_booking_management/models/cab_booking.py

@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY 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 odoo import models, fields, api
from datetime import date
class CabBooking(models.Model):
_name = 'cab.booking'
_rec_name = 'booking_date'
booking_date = fields.Date(string="Booking Date", default=date.today(), required=True)
cab_timing = fields.Many2one('cab.time', string="Timing", required=True)
cab_routes = fields.Many2one('cab.location', string="Route From", required=True)
cab_routes_to = fields.Many2one('cab.location', string="Route To", required=True)
seat_available = fields.One2many('cab.timing', compute="scheduled_details")
@api.onchange('cab_routes', 'cab_timing', 'cab_routes_to')
def scheduled_details(self):
data = self.env['cab.timing'].search([('cab_route.name', '=', self.cab_routes.name),
('cab_time.name', '=', self.cab_timing.name),
('cab_route_to.name', '=', self.cab_routes_to.name)])
self.seat_available = data

31
cab_booking_management/models/cab_conf.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY 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 odoo import models, fields
class CabConfiguration(models.Model):
_name = 'cab.configuration'
_rec_name = 'cab_manager'
auto_approve = fields.Boolean(string="Auto Approve")
cab_manager = fields.Many2one('res.users', string='Manager', required=True)

92
cab_booking_management/models/cab_creation.py

@ -0,0 +1,92 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY 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 odoo import models, fields, api
from odoo.exceptions import UserError,ValidationError
class CabManagement(models.Model):
_name = 'cab.management'
name = fields.Char(compute="complete_name_compute", string="Cab Name")
ref_name = fields.Char(string="Cab Name", required=True)
cab_image = fields.Binary(string='Image', store=True, attachment=True)
licence_plate = fields.Char(string="Licence Plate", required=True)
activity_period_from = fields.Date(string="Activity Period")
activity_period_to = fields.Date(string="To")
driver_plot = fields.Char(string="Driver Ploted")
cab_value = fields.Float(string="Cab Value")
cab_model = fields.Char(string="Cab Model")
cab_color = fields.Char(string="Cab Color")
aq_date = fields.Date(string="Aquisition Date")
chas_no = fields.Char(string="Chasis No")
odo_reading = fields.Float(string="Odometre Reading")
seating_capacity = fields.Integer(string="Seating Capacity", required=True)
fuel_type = fields.Char(string="Fuel Type")
related_log_details = fields.One2many('cab.log', string="Log Details", compute="auto_fetch_log_details")
total_log_details = fields.One2many('cab.maintanence', string='Total Expenses', compute="auto_fetch_total_details")
location_log_details = fields.One2many('cab.log', string="Location", compute="auto_fetch_location_details")
@api.onchange('licence_plate')
def check_unique_constraint(self):
for records in self.env['cab.management'].search([]):
if self.licence_plate == records.licence_plate:
raise ValidationError("Record already exists and violates unique field constraint")
@api.one
def complete_name_compute(self):
self.name = self.ref_name
if self.licence_plate:
self.name = str(self.licence_plate) + ' / ' + str(self.ref_name)
@api.onchange('activity_period_from', 'activity_period_to')
def auto_fetch_log_details(self):
if self.activity_period_from and self.activity_period_to:
if self.activity_period_from <= self.activity_period_to:
data = self.env['cab.log'].search([("cab_log_date", ">=", self.activity_period_from),
("cab_log_date", "<=", self.activity_period_to)])
self.related_log_details = data
else:
self.activity_period_to = 0
raise UserError("Enter Valid Dates")
@api.onchange('activity_period_from', 'activity_period_to')
def auto_fetch_total_details(self):
if self.activity_period_from and self.activity_period_to:
if self.activity_period_from <= self.activity_period_to:
data = self.env['cab.maintanence'].search([("cab_log_date", ">=", self.activity_period_from),
("cab_log_date", "<=", self.activity_period_to)])
self.total_log_details = data
else:
raise UserError("Enter Valid Dates")
@api.onchange('activity_period_from', 'activity_period_to')
def auto_fetch_location_details(self):
if self.activity_period_from and self.activity_period_to:
if self.activity_period_from <= self.activity_period_to:
data = self.env['cab.log'].search([("cab_log_date", ">=", self.activity_period_from),
("cab_log_date", "<=", self.activity_period_to)])
self.location_log_details = data
else:
raise UserError("Enter Valid Dates")

14
cab_booking_management/models/cab_location.py

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
from odoo import models, fields
class CabLocation(models.Model):
_name = 'cab.location'
name = fields.Char(string='City', required=True)
cab_zip = fields.Char(string='ZIP')
cab_code = fields.Char(string='City Code', size=64, help="The official code for the city")
state_id = fields.Many2one('res.country.state', string='State', required=True)
country_id = fields.Many2one('res.country', string='Country', required=True)

163
cab_booking_management/models/cab_log.py

@ -0,0 +1,163 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY 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 odoo import models, fields, api, _
from odoo.exceptions import ValidationError
from datetime import date
class CabLog(models.Model):
_name = 'cab.log'
_inherit = ['mail.thread', 'ir.needaction_mixin']
_description = 'Cab'
name = fields.Many2one('cab.management', string="Name", store=True, required=True)
cab_log_date = fields.Date(string="Date", default=date.today(), required=True)
fuel_used = fields.Float(string="Fuel Used", required=True, help="To get total fuel used in Litre")
seat_capacity = fields.Integer(string="Seat Capacity", related="name.seating_capacity")
seat_available = fields.Integer(string="Seat Available")
cab_location = fields.Char(string="Destination Point", required=True)
cab_location_from = fields.Char(string="Starting Point", required=True)
seat_booked = fields.Integer(string="How many seats you need to book?", required=True)
odo_metre = fields.Float(string="OdoMetre Reading", required=True, help="Total distance covered in Km")
cab_expense = fields.Float(string="Expense", required=True)
cab_log_timing = fields.Many2one('cab.time', string="Time", required=True)
total_passenger = fields.Integer(string="Total Passenger", required=True)
partner_id = fields.Many2one('res.users', string="Customer Name", required=True)
cab_image = fields.Binary(string='Image', store=True, attachment=True)
state = fields.Selection([
('draft', 'Draft'),
('approved', 'Approved'),
('discard', 'Discard'),
('cancel', 'Cancelled'),
('done', 'Done')
], default='draft')
@api.onchange('name')
def change_location(self):
for records in self.env['cab.timing'].search([('name.name', '=', self.name.name)]):
if self.name.name == records.name.name:
self.cab_location = records.cab_route_to.name
self.cab_location_from = records.cab_route.name
@api.one
@api.constrains('cab_log_timing')
def change_time(self):
for records in self.env['cab.timing'].search([('name.name', '=', self.name.name)]):
if self.cab_log_timing:
if self.cab_log_timing not in records.cab_time:
raise ValidationError("No cabs available at given time")
@api.one
@api.constrains('seat_booked')
def error_message(self):
if self.seat_available < self.seat_booked:
raise ValidationError("No Available Seats")
elif self.seat_booked != self.total_passenger:
raise ValidationError("No of seat requested for booking and total passenger must be equal")
@api.onchange('seat_booked')
def change_total_passenger(self):
self.total_passenger = self.seat_booked
@api.one
def action_approve(self):
self.state = "approved"
@api.one
def action_cancel(self):
self.state = "cancel"
@api.one
def action_discard(self):
self.state = "discard"
@api.onchange('cab_log_date', 'state')
def auto_cabs_approve(self):
for data in self.env['cab.configuration'].search([]):
if data.auto_approve != False:
user_obj = self.env.user
if user_obj == data.cab_manager:
self.state = 'approved'
@api.onchange('cab_log_date', 'name', 'cab_log_timing')
def change_available_seat(self):
for data in self.env['cab.management'].search([('name', '=', self.name.name)]):
flag = 0
total_seat_booked = 0
for records in self.env['cab.log'].search([('name.name', '=', data.name)]):
if self.cab_log_date == records.cab_log_date and self.cab_log_timing == records.cab_log_timing:
if self.cab_location == records.cab_location and self.cab_location_from == records.cab_location_from:
total_seat_booked = total_seat_booked+records.seat_booked
flag += 1
if flag > 0:
test_val = self.seat_capacity - total_seat_booked
self.seat_available = test_val
else:
self.seat_available = self.seat_capacity
@api.multi
def action_sent(self):
self.ensure_one()
ir_model_data = self.env['ir.model.data']
try:
template_id = ir_model_data.get_object_reference('cab_booking_management', 'email_template_edi_cab')[1]
except ValueError:
template_id = False
try:
compose_form_id = ir_model_data.get_object_reference('mail', 'email_compose_message_wizard_form')[1]
except ValueError:
compose_form_id = False
ctx = dict()
ctx.update({
'default_model': 'cab.log',
'default_res_id': self.ids[0],
'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment',
})
return {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(compose_form_id, 'form')],
'view_id': compose_form_id,
'target': 'new',
'context': ctx,
}
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.multi
def send_mail(self, auto_commit=False):
if self._context.get('default_model') == 'cab.log' and self._context.get('default_res_id'):
order = self.env['cab.log'].browse([self._context['default_res_id']])
if order.state == 'approved':
order.state = 'done'
order.sent = True
self = self.with_context(mail_post_autofollow=True)
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)

55
cab_booking_management/models/cab_maintanence.py

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY 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 odoo import models, fields, api
class CabMaintanence(models.Model):
_name = 'cab.maintanence'
name = fields.Many2one('cab.management', string="Name", required=True)
cab_log_date = fields.Date(string="Date", required=True)
fuel_used = fields.Float(string="Fuel Used")
odo_metre = fields.Float(string="OdoMetre Reading")
cab_expense = fields.Float(string="Expense")
total_passenger = fields.Integer(string="Total Passenger")
@api.onchange('cab_log_date')
def total_log_details(self):
total_fuel = 0
odo_metres = 0
expense = 0
passenger = 0
for data in self.env['cab.log'].search([]):
if data.cab_log_date == self.cab_log_date:
total_fuel += data.fuel_used
odo_metres += data.odo_metre
expense += data.cab_expense
passenger += data.total_passenger
self.fuel_used = total_fuel
self.odo_metre = odo_metres
self.cab_expense = expense
self.total_passenger = passenger

56
cab_booking_management/models/cab_timing.py

@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY 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 odoo import models, fields, api
class CabTiming(models.Model):
_name = 'cab.timing'
name = fields.Many2one('cab.management', string="Cab Name", required=True)
cab_time = fields.Many2many('cab.time', 'cab_name_rel', string="Time", required=True,
help="Use this format 00:00,ex: 01:15")
cab_route = fields.Many2one('cab.location', string='Starting Place', required=True)
cab_route_to = fields.Many2one('cab.location', string='Destination Place', required=True)
seat = fields.Integer(string="Seating Capacity", related='name.seating_capacity', required=True)
@api.multi
def action_log_form_view(self):
return {
'name': 'CabLog',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'cab.log',
'type': 'ir.actions.act_window',
'target': 'current'
}
class Time(models.Model):
_name = 'cab.time'
name = fields.Char(string="Name", required=True, help="Use this format 00:00,ex: 01:15")

16
cab_booking_management/security/ir.model.access.csv

@ -0,0 +1,16 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_cab_management,cab.management,model_cab_management,base.group_user,1,1,1,1
access_cab_maintenanace,cab.maintanence,model_cab_maintanence,base.group_user,1,1,1,1
access_cab_log,cab.log,model_cab_log,base.group_user,1,1,1,1
access_cab_timing,cab.timing,model_cab_timing,base.group_user,1,1,1,1
access_cab_location,cab.location,model_cab_location,base.group_user,1,1,1,1
access_cab_booking,cab.booking,model_cab_booking,base.group_user,1,1,1,1
access_cab_conf,cab.configuration,model_cab_configuration,base.group_user,1,1,1,1
access_cab_time,cab.time,model_cab_time,base.group_user,1,1,1,1

BIN
cab_booking_management/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

BIN
cab_booking_management/static/description/booking.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
cab_booking_management/static/description/cab_activity.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
cab_booking_management/static/description/cab_booking.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
cab_booking_management/static/description/cab_cancel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
cab_booking_management/static/description/cab_conf.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
cab_booking_management/static/description/cab_creation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
cab_booking_management/static/description/cab_details.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
cab_booking_management/static/description/cab_maintain.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
cab_booking_management/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
cab_booking_management/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

177
cab_booking_management/static/description/index.html

@ -0,0 +1,177 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Cab Booking Management System (CBMS)</h2>
<h3 class="oe_slogan">Manage the cabs with ease</h3>
<h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4>
<div>
<h4><p>Major Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Booking the Cab.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Auto approval Settings in Configuration.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Cab Logs for Every Trip.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Record Every Activity Related to CBMS.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Email Notification for Successful Booking.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;Booking Status.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp;View All Cab Activities with Advanced Filttrations.</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="cab_creation.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_space">
<h3 class="oe_slogan">Cab Booking</h3>
<div class="oe_span6">
<p class='oe_mt32'>
<centre>We can book cabs from list of cabs based on your time and location.</centre>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="cab_booking.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan"> Auto approval</h3>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="cab_conf.png">
</div>
</div>
<div class="oe_span6">
<p class='oe_mt32'>
Approve cab booking automatically.
</p>
</div>
</div>
</section>
<section class="oe_container dark">
<div class="oe_row oe_space">
<h3 class="oe_slogan"> Cab Logs for Every Trip</h3>
<div class="oe_span6">
<p class='oe_mt32'>
It keep the record of all expenses of each cab trips.
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="log_details.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan"> Record Every Activity Related to CBMS</h3>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="cab_activity.png">
</div>
</div>
<div class="oe_span6">
<p class='oe_mt32'>
It shows the total expenses for a cab, on daily basis.
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_space">
<h3 class="oe_slogan"> Email Notification for Successful Booking.</h3>
<div class="oe_span6">
<p class='oe_mt32'>
Email is sent to the user on successful booking of cab.
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="mail.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Booking Status</h3>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="cab_cancel.png">
</div>
</div>
<div class="oe_span6">
<p class='oe_mt32'>
View your status of booking.You can also cancel your booking.
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_space">
<h3 class="oe_slogan"> Cab Maintenance</h3>
<div class="oe_span6">
<p class='oe_mt32'>
It shows the total expenses for a cab, on daily basis.
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="cab_maintain.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row">
<h3 class="oe_slogan">View All Cab Activities with Advanced Filttrations</h3>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="cab_details.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >You Looking for a free Documentation of this Application.?</h2>
<h3 class="oe_slogan">Give a Request Mail to:&nbsp;&nbsp;<i class="fa fa-envelope" aria-hidden="true"></i>&nbsp;&nbsp;<a href="#" style="color:blue;">odoo@cybrosys.com</a></h3>
</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
cab_booking_management/static/description/log_details.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
cab_booking_management/static/description/mail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

71
cab_booking_management/views/cab_booking_view.xml

@ -0,0 +1,71 @@
<odoo>
<data>
<record model="ir.ui.view" id="cab_booking_form_view">
<field name="name">Cab Booking</field>
<field name="model">cab.booking</field>
<field name="arch" type="xml">
<form string="Cab Management">
<header>
<html>
<div style="text-align: center;">
<h1><centre>BOOK YOUR CAB</centre> </h1>
</div>
</html>
</header>
<sheet>
<group>
<group>
<field name="booking_date"/>
</group>
<group>
<field name="cab_timing" style="width:50%%"/>
</group>
</group>
<group>
<label for="cab_routes" class="oe_inline"/>
<div >
<field name="cab_routes" class="oe_inline"/> to
<field name="cab_routes_to" class="oe_inline"/>
</div>
</group>
<field name="seat_available">
<tree name="Cab InformationTree" editable="bottom">
<field name="name"/>
<field name="seat" style="text-align: center;"/>
<button name="action_log_form_view" type="object" icon="fa-arrow-right" />
</tree>
</field>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="cab_booking_tree_view">
<field name="name">Cab Booking</field>
<field name="model">cab.booking</field>
<field name="arch" type="xml">
<tree string="Cab Booking">
<field name="booking_date"/>
<field name="cab_routes"/>
<field name="cab_timing"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="cab_booking_action">
<field name="name">Cab Booking</field>
<field name="res_model">cab.booking</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calender</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create Your First Booking
</p>
</field>
</record>
<menuitem id="cab_booking_menu" name="Booking" parent="cab_management_menu" action="cab_booking_action"
groups="base.group_user" sequence="60"/>
</data>
</odoo>

55
cab_booking_management/views/cab_conf_view.xml

@ -0,0 +1,55 @@
<odoo>
<data>
<record id="cab_management_group" model="res.groups">
<field name="name">Cab Management</field>
<field name="category_id" ref="base.module_category_extra"/>
</record>
<record model="ir.ui.view" id="cab_configuration_form_view">
<field name="name">Cab Config</field>
<field name="model">cab.configuration</field>
<field name="arch" type="xml">
<form string="Cab Configuration">
<sheet>
<group string="Cab Configuration">
<group>
<field name="auto_approve"/>
</group>
<group>
<field name="cab_manager"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="cab_conf_tree_view">
<field name="name">Cab Config</field>
<field name="model">cab.configuration</field>
<field name="arch" type="xml">
<tree string="Cab Conf">
<field name="auto_approve"/>
<field name="cab_manager"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="cab_configuration_action">
<field name="name">Cab Configuration</field>
<field name="res_model">cab.configuration</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create the Conf
</p>
</field>
</record>
<menuitem id="main_cab_configuration_menu" name="Configuration" parent="main_cab_management_menu"/>
<menuitem id="cab_configuration_menu" name="Cab Configuration" parent="main_cab_configuration_menu"
action="cab_configuration_action" groups="base.group_user"/>
</data>
</odoo>

147
cab_booking_management/views/cab_creation_view.xml

@ -0,0 +1,147 @@
<odoo>
<data>
<record model="ir.ui.view" id="cab_management_form_view">
<field name="name">Cab Details</field>
<field name="model">cab.management</field>
<field name="arch" type="xml">
<form string="Cab Management">
<sheet>
<field name="cab_image" widget="image" class="oe_avatar"/>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="ref_name" placeholder=" Vehicle Name" style="width:50%%"/>
<field name="name" invisible="1"/>
</h1>
<label for="licence_plate"/>
<h2>
<field name="licence_plate" style="width:25%%"/>
</h2>
</div>
<div class="oe_title">
<group >
<label for="activity_period_from" class="oe_inline"/>
<div >
<field name="activity_period_from" class="oe_inline"/> to
<field name="activity_period_to" class="oe_inline"/>
</div>
</group>
</div>
<label for="related_log_details"/>
<field name="related_log_details">
<tree name="Cab Log Tree">
<field name="cab_log_date"/>
<field name="cab_log_timing"/>
<field name="odo_metre"/>
<field name="fuel_used"/>
<field name="total_passenger"/>
</tree>
</field>
<notebook>
<page string="Cab Details">
<group>
<group>
<field name="driver_plot"/>
<field name="cab_value"/>
<field name="cab_model"/>
<field name="cab_color"/>
<field name="aq_date"/>
</group>
<group>
<field name="chas_no"/>
<field name="odo_reading"/>
<field name="seating_capacity"/>
<field name="fuel_type"/>
</group>
</group>
</page>
<page string="Location">
<label for="location_log_details"/>
<field name="location_log_details">
<tree>
<field name="cab_log_date"/>
<field name="cab_location"/>
<field name="partner_id"/>
</tree>
</field>
</page>
<page string="Total Activity">
<label for="total_log_details"/>
<field name="total_log_details">
<tree>
<field name="cab_log_date"/>
<field name="fuel_used"/>
<field name="odo_metre"/>
<field name="total_passenger"/>
<field name="cab_expense"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="cab_template_kanban_view" model="ir.ui.view">
<field name="name">cab.management.kanban</field>
<field name="model">cab.management</field>
<field name="arch" type="xml">
<kanban>
<field name="cab_image" modifiers="{}"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('cab.management', 'cab_image', record.id.value)"/>
</div>
<div class="oe_kanban_details">
<strong>
<span t-if="record.licence_plate.value">[<field name="licence_plate"/>]</span>
<ul>
<li>Name :<field name="name"/></li>
<li>O.M Reading : 0</li>
</ul>
</strong>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="cab_template_action" model="ir.actions.act_window">
<field name="name">Cab Details</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">cab.management</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="cab_template_kanban_view"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new Cab.
</p>
</field>
</record>
<record model="ir.actions.act_window" id="cab_management_action">
<field name="name">Cab Details</field>
<field name="res_model">cab.management</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form,calender</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create Your First Cab
</p>
</field>
</record>
<menuitem id="main_cab_management_menu" name="Cab Management"/>
<menuitem id="cab_management_menu" name="Cab Management" parent="main_cab_management_menu"/>
<menuitem id="cab_menu" name="Cab" parent="cab_management_menu" action="cab_management_action"
groups="base.group_user" sequence="10"/>
</data>
</odoo>

57
cab_booking_management/views/cab_location_view.xml

@ -0,0 +1,57 @@
<odoo>
<data>
<record model="ir.ui.view" id="cab_location_form_view">
<field name="name">Location</field>
<field name="model">cab.location</field>
<field name="arch" type="xml">
<form string="Cab Location">
<sheet>
<group>
<group>
<field name="name"/>
<field name="state_id"/>
<field name="cab_code"/>
</group>
<group>
<field name="cab_zip"/>
<field name="country_id"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="cab_location_tree_view">
<field name="name">Location</field>
<field name="model">cab.location</field>
<field name="arch" type="xml">
<tree string="Cab Location">
<field name="name"/>
<field name="state_id"/>
<field name="cab_code"/>
<field name="cab_zip"/>
<field name="country_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="cab_location_action">
<field name="name">Location</field>
<field name="res_model">cab.location</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calender</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create Your First Location
</p>
</field>
</record>
<menuitem id="main_cab_management_menu" name="Cab Management"/>
<menuitem id="cab_management_menu" name="Cab Management" parent="main_cab_management_menu"/>
<menuitem id="cab_location_menu" name="Location" parent="cab_management_menu" action="cab_location_action"
groups="base.group_user" sequence="40"/>
</data>
</odoo>

109
cab_booking_management/views/cab_log_view.xml

@ -0,0 +1,109 @@
<odoo>
<data>
<record model="ir.ui.view" id="cab_log_form_view">
<field name="name">Cab Details</field>
<field name="model">cab.log</field>
<field name="arch" type="xml">
<form string="Cab Log">
<header>
<button name="action_cancel"
string="Cancel Booking"
type="object"
state="'draft"
class="oe_highlight"
attrs = "{'invisible': [('state', 'in', ('approved','draft','discard','cancel'))]}"/>
<button name="action_approve"
string="Approve"
type="object"
state="'draft"
class="oe_highlight"
attrs = "{'invisible': [('state', 'in', ('discard','approved','cancel','done'))]}"/>
<button name="action_sent"
string="Send Mail"
type="object"
class="oe_highlight"
context="{'send_rfq':True }"
attrs = "{'invisible': [('state', 'in', ('discard','draft','cancel','done'))]}" />
<button name="action_discard"
string="Discard"
type="object"
class="oe_highlight"
attrs = "{'invisible': [('state', 'in', ('approved','discard','cancel','sent','done'))]}" />
<field name="state"
widget="statusbar"
statusbar_visible="draft,approved,sent,discard,cancel"
statusbar_colors='{"approved":"red"}'/>
</header>
<sheet>
<field name="cab_image"
widget="image"
class="oe_avatar"/>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" placeholder=" Cab Name" style="width:50%%" />
</h1>
</div>
<group>
<group>
<field name="cab_log_date"/>
<field name="partner_id"/>
<field name="cab_log_timing" style="width:50%%"/>
<field name="cab_location_from" style="width:50%%"/>
<field name="cab_location" style="width:50%%"/>
<field name="seat_capacity" invisible="1"/>
</group>
<group>
<field name="seat_available"/>
<field name="seat_booked" attrs="{'readonly':['|',('seat_available', '==', 0) ] }"/>
<field name="fuel_used"/>
<field name="odo_metre"/>
<field name="cab_expense"/>
<field name="total_passenger" invisible="1"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="cab_log_tree_view">
<field name="name">Log Details</field>
<field name="model">cab.log</field>
<field name="arch" type="xml">
<tree string="Cab Log">
<field name="name"/>
<field name="seat_available"/>
<field name="cab_log_date"/>
<field name="cab_log_timing"/>
<field name="cab_location_from"/>
<field name="cab_location"/>
<field name="odo_metre"/>
<field name="fuel_used"/>
<field name="cab_expense"/>
<field name="partner_id"/>
<field name="seat_booked"/>
<field name="state"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="cab_log_action">
<field name="name">Log Details</field>
<field name="res_model">cab.log</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calender</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create Your First Trip
</p>
</field>
</record>
<menuitem id="main_cab_management_menu" name="Cab Management"/>
<menuitem id="cab_management_menu" name="Cab Management" parent="main_cab_management_menu"/>
<menuitem id="cabs_log_menu" name="Cab Trip" parent="cab_management_menu" action="cab_log_action"
groups="base.group_user" sequence="30"/>
</data>
</odoo>

68
cab_booking_management/views/cab_maintanence_view.xml

@ -0,0 +1,68 @@
<odoo>
<data>
<record model="ir.ui.view" id="cab_maintanence_form_view">
<field name="name">Cab Details</field>
<field name="model">cab.maintanence</field>
<field name="arch" type="xml">
<form string="Cab Log">
<header>
<html>
<div style="text-align: center;">
<h1><centre>Cab Maintanence(Total Expenses)</centre> </h1>
</div>
</html>
</header>
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" placeholder=" Cab Name" style="width:50%%" />
</h1>
</div>
<group>
<group>
<field name="cab_log_date"/>
<field name="fuel_used"/>
</group>
<group>
<field name="odo_metre"/>
<field name="cab_expense"/>
<field name="total_passenger"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="cab_maintanence_tree_view">
<field name="name">Log Details</field>
<field name="model">cab.maintanence</field>
<field name="arch" type="xml">
<tree string="Cab Log">
<field name="name"/>
<field name="odo_metre"/>
<field name="cab_log_date"/>
<field name="fuel_used"/>
<field name="cab_expense"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="cab_maintanence_action">
<field name="name">Log Details</field>
<field name="res_model">cab.maintanence</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calender</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create Your First Record
</p>
</field>
</record>
<menuitem id="cab_maintanence_menu" name="Maintenance" parent="cab_management_menu"
action="cab_maintanence_action" groups="base.group_user" sequence="20"/>
</data>
</odoo>

63
cab_booking_management/views/cab_timing_view.xml

@ -0,0 +1,63 @@
<odoo>
<data>
<record model="ir.ui.view" id="cab_timing_form_view">
<field name="name">Cab Timing</field>
<field name="model">cab.timing</field>
<field name="arch" type="xml">
<form string="Cab Timing">
<header>
<html>
<div style="text-align: center;">
<h1><centre>Set Your Cab Time</centre> </h1>
</div>
</html>
</header>
<sheet>
<group>
<group>
<field name="name"/>
<field name="cab_route" style="width:50%%"/>
<field name="cab_route_to" style="width:50%%"/>
</group>
<group>
<field name="cab_time" widget="many2many_tags"/>
<field name="seat" style="width:25%%"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="cab_timing_tree_view">
<field name="name">Cab Timing</field>
<field name="model">cab.timing</field>
<field name="arch" type="xml">
<tree string="Cab Timing">
<field name="name"/>
<field name="cab_route"/>
<field name="cab_route_to"/>
<field name="cab_time" widget="many2many_tags"/>
<field name="seat"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="cab_timing_action">
<field name="name">Cab Timing</field>
<field name="res_model">cab.timing</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calender</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">Create Your First Record
</p>
</field>
</record>
<menuitem id="cab_timing_menu" name="Timing" parent="cab_management_menu" action="cab_timing_action"
groups="base.group_user" sequence="50"/>
</data>
</odoo>

23
cab_booking_management/views/templates.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="email_template_edi_cab" model="mail.template">
<field name="name">Cab Booked</field>
<field name="email_from">${(object.user_id.email}</field>
<field name="email_to">${object.partner_id.id}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="subject">Cab Booked</field>
<field name="model_id" ref="cab_booking_management.model_cab_log" />
<field name="auto_delete" eval="True" />
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Hello ${object.partner_id.name},</p>
<p> This Email is to inform you that your request for cab on ${object.cab_log_date} is approved </p>
</div>
]]>
</field>
</record>
</data>
</odoo>

23
crm_drag_back_permission/__init__.py

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

43
crm_drag_back_permission/__manifest__.py

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<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': 'CRM Kanban Drag Back Permission',
'version': '0.2',
'category': 'CRM',
'sequence': 6,
'summary': 'Permission for Drag Back in CRM',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'depends': ['crm', 'sale', 'sales_team'],
'website': 'http://www.cybrosys.com',
'images': ['static/description/banner.jpg'],
'data': [
'views/crm_sales_team.xml',
'views/crm_lead_update.xml',
'views/templates.xml',
'security/ir.model.access.csv',
],
'installable': True,
'auto_install': False,
}

25
crm_drag_back_permission/models/__init__.py

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

141
crm_drag_back_permission/models/update_kanban_record.py

@ -0,0 +1,141 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<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 odoo import models, fields, api
class StageChange(models.Model):
_inherit = 'crm.lead'
stage_previous = fields.Integer(string="Previous stage", default=False)
stage_next = fields.Integer(string="Next stage", default=False)
stage_type = fields.Char()
new_stage_id = fields.Selection([('previous', 'Previous'), ('current', 'Current'), ('next', 'Next')], readonly=True)
previous = fields.Char(string="Previous Stage", compute='get_previous_stage')
next_stage = fields.Char(string="Next Stage", compute='get_next_stage')
@api.one
def get_previous_stage(self):
self.previous = self.env['crm.stage'].search([('id', '=', self.stage_previous)]).name
@api.one
def get_next_stage(self):
self.next_stage = self.env['crm.stage'].search([('id', '=', self.stage_next)]).name
@api.one
def approve_oppor(self):
self.write({'stage_id': self.env['crm.stage'].browse([self.stage_next]).id, 'stage_previous': self.stage_id.id, 'stage_next': 0, 'new_stage_id': ''})
return
@api.one
def decline_oppor(self):
self.write({'stage_id': self.env['crm.stage'].browse([self.stage_previous]).id, 'stage_previous': self.stage_id.id, 'stage_next': 0, 'new_stage_id': ''})
return
@api.multi
def write(self, vals):
if not vals.get('stage_previous') and vals.get('stage_id'):
last_stage = self.browse(self.ids).stage_id
if self.env['crm.stage'].browse([vals['stage_id']]).stage_order < last_stage.stage_order \
and not self.env['res.users'].browse(self._uid).has_group('sales_team.group_sale_manager') \
and not self.env['res.users'].browse(self._uid).has_group('sales_team.group_sale_salesman_all_leads'):
vals['stage_previous'] = last_stage.id
vals['stage_next'] = vals['stage_id']
vals['stage_type'] = "approval"
vals['new_stage_id'] = 'current'
to_approve = self.env['crm.stage'].search([('type', '=', 'approval'), ('name', '=', 'Waiting for approval')])
if to_approve:
vals['stage_id'] = to_approve.id
else:
values = {
'name': "Waiting for approval",
'type': "approval",
'stage_order': -1,
}
result = self.env['crm.stage'].create(values)
vals['stage_id'] = result.id
elif vals.get('stage_id'):
vals['stage_type'] = ""
res = super(StageChange, self).write(vals)
return res
def get_approvals(self, context=None):
object_list = []
tree_res = self.env['ir.model.data'].get_object_reference('crm', 'crm_case_tree_view_oppor')
x = self.env['ir.model.data'].get_object_reference('crm_drag_back_permission', 'action_waiting_approval_window')
tree_id = tree_res and tree_res[1] or False
form_res = self.env['ir.model.data'].get_object_reference('crm', 'crm_case_form_view_leads')
form_id = form_res and form_res[1] or False
approval_stage = self.env['crm.lead']
approvals = approval_stage.search([('stage_id.type', '=', "approval")])
user_obj = self.env['res.users']
u_id = user_obj.browse([self._uid])
if u_id.has_group('sales_team.group_sale_salesman_all_leads') and u_id.has_group(
'sales_team.group_sale_salesman') and u_id.has_group('sales_team.group_sale_manager'):
for i in approvals:
object_list.append(i.id)
elif u_id.has_group('sales_team.group_sale_salesman_all_leads') and u_id.has_group('sales_team.group_sale_salesman'):
teams = self.env['crm.team'].search([('user_id.id', '=', self._uid)])
team_ids = []
for i in teams:
team_ids.append(i.id)
object_list = []
if approvals:
for obj in approvals:
if obj.team_id.id in team_ids:
object_list.append(obj.id)
elif u_id.has_group('sales_team.group_sale_salesman'):
object_list = []
if approvals:
for obj in approvals:
if obj.user_id.id == self._uid:
object_list.append(obj.id)
return {
'model': 'ir.actions.act_window',
'name': 'Waiting Approval',
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'crm.lead',
'views': [(tree_id, 'tree'), (form_id, 'form')],
'domain': [('id', 'in', object_list)],
'id': x[1],
}
class NewStage(models.Model):
_inherit = 'crm.stage'
stage_order = fields.Integer(string='Order')
type = fields.Selection([('lead', 'Lead'), ('opportunity', 'Opportunity'), ('both', 'Both'), ('approval', '')],
string='Type', required=True,
help="This field is used to distinguish stages related to Leads from stages related to "
"Opportunities or to specify stages available for both types.")

4
crm_drag_back_permission/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_crm_stage,crm.stage,model_crm_stage,sales_team.group_sale_salesman,1,1,1,1
access_crm_stage_head,crm.stage,model_crm_stage,sales_team.group_sale_salesman_all_leads,1,1,1,1

BIN
crm_drag_back_permission/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
crm_drag_back_permission/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
crm_drag_back_permission/static/description/image1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
crm_drag_back_permission/static/description/image2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
crm_drag_back_permission/static/description/image3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
crm_drag_back_permission/static/description/image4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
crm_drag_back_permission/static/description/image5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

96
crm_drag_back_permission/static/description/index.html

@ -0,0 +1,96 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">CRM Kanban Drag Back</h2>
<h3 class="oe_slogan">Permission for Back Drag in CRM Kanban view</h3>
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
</div>
<div class="oe_row oe_spaced">
<div>
This module restricts some users to drag leads backwards in sales pipeline without permission.
</div>
</div>
<div class="oe_row oe_spaced">
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="image1.png">
</div>
</div>
<div class="oe_span12">
<p class='oe_mt32'>
Go to Configuration -> Sales Teams, and enable the 'Leads' option for the teams you want to use.
</p>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="image2.png">
</div>
</div>
<div class="oe_span12">
<p class='oe_mt32'>
Go to Configuration -> Stages, and set an 'order'(integer value) for each stage you want to use in the pipeline.
The drag back is working based on this 'order' field value. When a user tries to drag a lead from one stage to another,
we will check the 'order' of those two stages.
If the movement is from a stage with higher order value to a stage with lower order value, it will be considered
as a back drag.
</p>
</div>
</div>
</section>
<section>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class='oe_mt32'>
When a salesperson tries to perform a back drag, the lead will go to a new stage, 'Waiting for Approval'.
From this stage, the Administrator or the Head of Sales of team which the lead belongs to, can
approve the lead to the stage requested by the user or decline the lead back to it's previous stage.
The salesperson can't move the lead from this stage.
</p>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="image3.png">
</div>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="image5.png">
</div>
</div>
</div>
</div>
</section>
<section>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class='oe_mt32'>
In the 'Waiting for Approval' stage, a lead will be visible only to the administrator,
the user to which the lead is assigned to and the head of sales of team that the lead belongs to.
When we select a lead in the 'Waiting for Approval' stage, we can see the stages, the lead comes from and where the lead is headed to.
</p>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="image4.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan">Need Any Help?</h2>
<div class="oe_slogan">
<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>
</section>

19
crm_drag_back_permission/static/src/js/hide_stage.js

@ -0,0 +1,19 @@
odoo.define('crm_drag_back_permission',function(require) {
var kanbanview = require('web_kanban.KanbanView');
var Model = require('web.Model');
kanbanview.include({
render: function () {
this._super(this);
for (var key in this.widgets) {
if (this.widgets[key]['title'] == 'Waiting for approval'){
var test = this.widgets[key].$el
test.css("display", "None");
}
}
},
});
});

116
crm_drag_back_permission/views/crm_lead_update.xml

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8" ?>
<openerp>
<data>
<record id="crm_case_form_view_lead_updated" model="ir.ui.view">
<field name="name">Leads updated</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="stage_previous" invisible="1" />
<field name="stage_next" invisible="1" />
<field name="stage_type" invisible="1" />
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="required">1</attribute>
</xpath>
<xpath expr="//form/header" position="inside">
<button name="approve_oppor" string="Approve" groups="sales_team.group_sale_manager,sales_team.group_sale_salesman_all_leads"
type="object" class="oe_highlight o_wow" attrs="{'invisible': [('stage_type','!=','approval')]}"/>
<button name="decline_oppor" string="Decline" groups="sales_team.group_sale_manager,sales_team.group_sale_salesman_all_leads"
type="object" class="oe_highlight o_wow" attrs="{'invisible': [('stage_type','!=','approval')]}"/>
</xpath>
<xpath expr="//form/header/button[1]" position="attributes">
<attribute name="attrs">{'invisible': [('stage_type','=','approval')]}
</attribute>
</xpath>
<xpath expr="//group[1]/group[2]" position="before">
<group>
<field name="previous" />
<field name="next_stage"/>
</group>
</xpath>
</field>
</record>
<record id="crm_case_form_view_opport_updated" model="ir.ui.view">
<field name="name">Opportunity updated</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="stage_previous" invisible="1" />
<field name="stage_next" invisible="1" />
<field name="stage_type" invisible="1" />
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="required">1</attribute>
</xpath>
<xpath expr="//form/header" position="inside">
<button name="approve_oppor" string="Approve" groups="sales_team.group_sale_manager,sales_team.group_sale_salesman_all_leads"
type="object" class="oe_highlight o_wow" attrs="{'invisible': [('stage_type','!=','approval')]}"/>
<button name="decline_oppor" string="Decline" groups="sales_team.group_sale_manager,sales_team.group_sale_salesman_all_leads"
type="object" class="oe_highlight o_wow" attrs="{'invisible': [('stage_type','!=','approval')]}" />
</xpath>
<xpath expr="//form/header/button[1]" position="attributes">
<attribute name="attrs">{'invisible': [('stage_type','=','approval')]}</attribute>
</xpath>
<xpath expr="//form/header/button[2]" position="attributes">
<attribute name="attrs">{'invisible': [('stage_type','=','approval')]}</attribute>
</xpath>
<xpath expr="//form/header/button[3]" position="attributes">
<attribute name="attrs">{'invisible': [('stage_type','=','approval')]}</attribute>
</xpath>
<xpath expr="//form/header/field[@name='stage_id']" position="attributes">
<attribute name="attrs">{'invisible': [('stage_type','=','approval')]}</attribute>
</xpath>
<xpath expr="//group[1]/group[2]" position="before">
<group>
<field name="previous" />
<field name="next_stage"/>
</group>
</xpath>
</field>
</record>
<record id="crm_case_stage_updated" model="ir.ui.view">
<field name="name">Stages Updated</field>
<field name="model">crm.stage</field>
<field name="inherit_id" ref="crm.crm_stage_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='on_change']" position="after">
<field name="stage_order" />
</xpath>
</field>
</record>
<record id="action_waiting_approval_window" model="ir.actions.act_window">
<field name="name">Waiting</field>
<field name="res_model">crm.lead</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record id="action_waiting_approval" model="ir.actions.server">
<field name="name">Waiting</field>
<field name="type">ir.actions.server</field>
<field name="res_model">crm.lead</field>
<field name="model_id" ref="model_crm_lead"/>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="state">code</field>
<field name="code">action = env['crm.lead'].get_approvals(context=context)</field>
</record>
<menuitem name="Waiting for approval" id="waiting_approval" action="action_waiting_approval" parent="sales_team.menu_sales" />
</data>
</openerp>

21
crm_drag_back_permission/views/crm_sales_team.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="sales_team.group_sale_manager" model="res.groups">
<field name="name">CEO/Head of Business strategy</field>
<field name="implied_ids" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>
<record id="sales_team.group_sale_salesman_all_leads" model="res.groups">
<field name="name">Head Of Sales</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="implied_ids" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
<field name="comment">the user will have access to all records of everyone in the sales application.</field>
</record>
<record id="sales_team.group_sale_salesman" model="res.groups">
<field name="name">SalesPerson</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="comment">the user will have access to his own data in the sales application.</field>
</record>
</data>
</openerp>

12
crm_drag_back_permission/views/templates.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="hide_stage_kanban" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/crm_drag_back_permission/static/src/js/hide_stage.js"></script>
</xpath>
</template>
</data>
</openerp>

36
cron_failure_notification/README.rst

@ -0,0 +1,36 @@
Cron Job Failure Notifications v10
==================================
This module will generate error Logs for Scheduled Actions / Cron jobs running in backend server.
Purpose of module to have creating history of failure of all jobs in backend.
Features
========
* Any failure will automatically logged.
* PDF Report for error logs.
* Custom Error Logs Scheduled Actions Email Template.
Installation
============
No other requirements.
To test the module:
- Activate Developer mode
- Go to Settings --> Technical --> Automation --> Scheduled actions.
- Select the record "Test Cron Failure Notification" and check active button.
- Click the button 'Run Manually'.
- A log of scheduler failure will be created under the menu 'Logs Scheduled Actions'.
Configuration
=============
To analyse log history of cron failure,
Go to Settings --> Technical --> Automation --> Logs Scheduled Actions.
Credits
=======
Developer: Mufeeda C K @ cybrosys
Guidance: Nilmar Shereef @ cybrosys, shereef@cybrosys.in

22
cron_failure_notification/__init__.py

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

50
cron_failure_notification/__manifest__.py

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<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': "Cron Failure Notification",
'version': '10.0.1.0.0',
'category': 'Extra Tools',
'summary': """Cron jobs/Scheduled Actions failure Log Notification & Its PDF Reports""",
'description': """
This module will generate error Logs for Scheduled
Actions / Cron jobs running in backend server
""",
'author': "Cybrosys Techno Solutions",
'company': "Cybrosys Techno Solutions",
'website': "http://www.cybrosys.com",
'depends': ['base', 'mail', 'web', 'base_setup'],
'data': [
'views/logs_scheduled_actions_view.xml',
'views/error_log_report_template.xml',
'views/report.xml',
'views/error_mail_template.xml'
],
'demo': [
'demo/ir_cron_demo.xml'
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

50
cron_failure_notification/__manifest__.py~

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<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': "Cron Failure Notification",
'version': '10.0.1.0.0',
'category': 'Extra Tools',
'summary': """Cron job failure log""",
'description': """
This module will generate error Logs for Scheduled
Actions / Cron jobs running in backend server
""",
'author': "Cybrosys Techno Solutions",
'company': "Cybrosys Techno Solutions",
'website': "http://www.cybrosys.com",
'depends': ['base', 'mail', 'web', 'base_setup'],
'data': [
'views/logs_scheduled_actions_view.xml',
'views/error_log_report_template.xml',
'views/report.xml',
'views/error_mail_template.xml'
],
'demo': [
'demo/ir_cron_demo.xml'
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'auto_install': False,
'application': False,
}

21
cron_failure_notification/demo/ir_cron_demo.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="test_scheduler_error_mailer" model="ir.cron">
<field name="name">Test Cron Failure Notification</field>
<field name="active" eval="False"/>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<!-- don't limit the number of calls -->
<field name="doall" eval="True"/>
<field name="model">ir.cron</field>
<field name="function">_test_scheduler_failure</field>
<field name="email_template_id" ref="cron_failure_notification.scheduler_error_mailer"/>
</record>
</data>
</odoo>

23
cron_failure_notification/models/__init__.py

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

113
cron_failure_notification/models/logs_scheduled_actions.py

@ -0,0 +1,113 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<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 datetime
import logging
from odoo import models, fields, api, _
from odoo.tools.translate import _
from odoo.exceptions import UserError
class LogsScheduledActions(models.Model):
_description = "Error log"
_name = 'logs.action'
_inherit = ['mail.thread', 'ir.needaction_mixin', 'ir.cron']
name = fields.Char(string="Name", required=True, track_visibility='always')
method = fields.Char(string="Method", track_visibility='always')
created_by = fields.Many2one('res.users', string="Created by", default=lambda self: self.env.user, index=True)
object_action = fields.Char(string="Object", track_visibility='always')
exec_date = fields.Datetime(string="Execution Date Time")
company_name = fields.Many2one('res.company', string="Company", default=lambda self: self.env.user.company_id,
index=True)
stages_id = fields.Selection(
[('new', 'New'), ('confirm', 'Confirmed'), ('resolved', 'Resolved'), ('cancelled', 'Cancelled')], default='new')
error_details = fields.Char(string="Error details", track_visibility='always')
@api.multi
def action_mail_send(self):
self.ensure_one()
ir_model_data = self.env['ir.model.data']
template_id = ir_model_data.get_object_reference('cron_failure_notification',
'scheduler_error_mailer')[1]
try:
compose_form_id = ir_model_data.get_object_reference('mail', 'email_compose_message_wizard_form')[1]
except ValueError:
compose_form_id = False
ctx = dict(self.env.context or {})
ctx.update({
'default_model': 'logs.action',
'default_res_id': self.ids[0],
'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment',
})
return {
'name': _('Compose Email'),
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(compose_form_id, 'form')],
'view_id': compose_form_id,
'target': 'new',
'context': ctx,
}
def button_confirm_action(self):
self.stages_id = 'confirm'
def button_resolved_action(self):
self.stages_id = 'resolved'
def button_cancel_action(self):
self.stages_id = 'cancelled'
_logger = logging.getLogger(__name__)
class IrCron(models.Model):
_inherit = "ir.cron"
@api.model
def _handle_callback_exception(
self, model_name, method_name, args, job_id, job_exception):
res = super(IrCron, self)._handle_callback_exception(
model_name, method_name, args, job_id, job_exception)
my_cron = self.browse(job_id)
self.env['logs.action'].create({
'name': my_cron.name,
'method': my_cron.model,
'object_action': my_cron.function,
'exec_date': datetime.datetime.now(),
'error_details': str(job_exception),
})
return res
@api.model
def _test_scheduler_failure(self):
"""This function is used to test and debug this module"""
raise UserError(
_("Task failure with UID = %d.") % self._uid)

BIN
cron_failure_notification/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
cron_failure_notification/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
cron_failure_notification/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

85
cron_failure_notification/static/description/index.html

@ -0,0 +1,85 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Cron Job Failure Notification</h2>
<h3 class="oe_slogan"><center>Error Logs for Scheduled Actions/Cron jobs running in backend server.</center></h3>
<h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4>
</div>
<div class="oe_row oe_spaced">
<h4><p>Major Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Creating Failure History for All Jobs in Backend.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Failure Report Will Automatically Logged.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Administrator Can Review Logs.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Send Report to Support/Technical Team by Email Button.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#8594;</span>&nbsp;&nbsp; Custom Email Template for Sending Mail with Failure Details.</li>
</ul>
</div>
</section>
<section class="oe_container oe_dark">
<h3 class="oe_slogan">Error Logs Scheduled Actions - Form View</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="logs_form_view.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<h3 class="oe_slogan">Print PDF Report- Error Logs Scheduled</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="logs_pdf_report.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h3 class="oe_slogan">Send By Email - Error Logs Scheduled Actions Attaching PDF Report</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="logs_mail_template.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_row oe_spaced">
<h3 class="oe_slogan" style="text-align:left;padding-left: 23px;">How to test this module ?</h3>
<div class="oe_row oe_spaced">
<p>
<ul>
<li>Activate Developer mode.</li>
<li>Go to Settings --> Technical --> Automation --> Scheduled actions.</li>
<li>Select the record "Test Cron Failure Notification" and check active button.</li>
<li>Click the button 'Run Manually'.</li>
<li>A log of scheduler failure will be created under the menu 'Logs Scheduled Actions'.</li>
<li>For more details, Please see the README.rst file with this module.</li>
</ul>
</p>
</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
cron_failure_notification/static/description/logs_form_view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
cron_failure_notification/static/description/logs_mail_template.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
cron_failure_notification/static/description/logs_pdf_report.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

55
cron_failure_notification/views/error_log_report_template.xml

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_log_error">
<t t-call="report.html_container">
<t t-call="report.internal_layout">
<div class="page">
<p t-esc="res_company.name"/>
<h2>
<span t-field="doc.name"/>
</h2>
<table class="table">
<tbody>
<tr t-if="doc.object_action">
<th>Object:</th>
<td><span t-field="doc.object_action"/></td>
</tr>
<tr t-if="doc.method">
<th>Method:</th>
<td><span t-field="doc.method"/></td>
</tr>
<tr t-if="doc.created_by">
<th>Responsible user:</th>
<td><span t-field="doc.created_by"/></td>
</tr>
<tr t-if="doc.exec_date">
<th>Execution Date Time:</th>
<td><span t-field="doc.exec_date"/></td>
</tr>
<tr t-if="doc.company_name">
<th>Company:</th>
<td><span t-field="doc.company_name"/></td>
</tr>
</tbody>
</table>
<br/><br/>
<strong><p>Error: </p></strong>
<p t-field="doc.error_details"/>
<div class="oe_structure"/>
</div>
</t>
</t>
</template>
<template id="report_logs_details">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="cron_failure_notification.report_log_error" />
</t>
</t>
</template>
</data>
</odoo>

25
cron_failure_notification/views/error_mail_template.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- Error Email template -->
<record id="scheduler_error_mailer" model="mail.template">
<field name="name">Scheduler Error</field>
<field name="email_from">${object.user_id.email}</field>
<field name="subject">'${object.name}' FAILED</field>
<field name="report_template" ref="action_report_logs"/>
<field name="model_id" ref="cron_failure_notification.model_logs_action"/>
<field name="auto_delete" eval="True"/>
<field name="body_html">
<![CDATA[
Dear Support team,<br>
<p>Here we are attaching error logs from scheduled cron jobs on our server, so please
urgently take action.<br> If you have any question, don't hesitate to contact us.<br></p><br>
Thank You.
]]>
</field>
</record>
</data>
</odoo>

77
cron_failure_notification/views/logs_scheduled_actions_view.xml

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="developer_mode_active_form">
<field name="name">DeveloperMode</field>
<field name="model"></field>
<field name="inherit_id" ref="web.login"/>
<field name="arch" type="xml">
<xpath expr="//input[@name='redirect']" position='attributes'>
<attribute name="t-att-value">'%s%sdebug=1' % (redirect or '/web', redirect and '?' in redirect and '&amp;' or '?')</attribute>
</xpath>
</field>
</record>
<record id="logs_form_view" model="ir.ui.view">
<field name="name">logs.action.form</field>
<field name="model">logs.action</field>
<field name="view_type">form</field>
<field name="view_type">form</field>
<field name="arch" type="xml">
<form string="Logs">
<header>
<button name="button_confirm_action" string="Confirm" type="object" class="oe_highlight" attrs="{'invisible': [('stages_id', '!=', 'new')]}"/>
<button name="button_cancel_action" string="Cancel" type="object" attrs="{'invisible': [('stages_id', '!=', 'new')]}"/>
<button name="button_resolved_action" string="Resolve" type="object" class="oe_highlight" attrs="{'invisible': [('stages_id', '!=', 'confirm')]}"/>
<button name="action_mail_send" string="Send By Email" type="object" context="{'send_mail':True}" class="oe_highlight" attrs="{'invisible': [('stages_id', '!=', 'confirm')]}"/>
<field name="stages_id" widget="statusbar"/>
</header>
<sheet string="Logs">
<group>
<group>
<field name="name"/>
<field name="method"/>
<field name="created_by"/>
</group>
<group>
<field name="object_action"/>
<field name="exec_date"/>
<field name="company_name"/>
</group>
</group>
<notebook>
<page name="error_info" string="Error">
<field name="error_details"/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="logs_tree_view">
<field name="name">logs.action.tree</field>
<field name="model">logs.action</field>
<field name="arch" type="xml">
<tree string="Logs">
<field name="name"/>
<field name="exec_date"/>
<field name="stages_id"/>
</tree>
</field>
</record>
<record id="ir_cron_act_logs" model="ir.actions.act_window">
<field name="name">Logs Scheduled Actions</field>
<field name="res_model">logs.action</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="logs_tree_view"/>
</record>
<menuitem id="menu_ir_cron_logs" action="ir_cron_act_logs" parent="base.menu_automation"/>
</data>
</odoo>

12
cron_failure_notification/views/report.xml

@ -0,0 +1,12 @@
<odoo>
<data>
<report id="action_report_logs"
model="logs.action"
string="Print Log Scheduled"
report_type="qweb-pdf"
file="cron_failure_notification.report_logs_details"
name="cron_failure_notification.report_logs_details"
menu="True"
/>
</data>
</odoo>

21
developer_mode/README.rst

@ -0,0 +1,21 @@
Automatic Developer Mode v10
============================
This module aims to reduce the repeated works of a Odoo Developer.
Features
========
* Automatically Trigger Developer Mode.
* Showing Running DB On Left Top.
* Update Modules Easily.
.. note::
# If you installed any other tool, This module may not work properly.
# There is a dev mode property missing issue with website module.
Credits
=======
Nilmar Shereef @ cybrosys, shereef@cybrosys.in

23
developer_mode/__init__.py

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

43
developer_mode/__manifest__.py

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nilmar Shereef(<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': "Automatic Developer Mode",
'summary': """Automatically Activate Developer Mode & Running DB Name on Left Top""",
'version': '10.0.3.0.0',
'author': 'Cybrosys Techno Solutions',
'website': "http://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'category': 'Extra Tools',
'depends': ['base', 'web', 'base_setup'],
'data': [
'views/web_view.xml',
'security/security_data.xml',
'views/developer_mode_view.xml',
'views/ir_rule_view.xml',
'data/cybro_developer_data.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save