Browse Source

[ADD] Initial commit 'commission_plan'

pull/193/head
Ajmal Cybro 3 years ago
parent
commit
d3a8d63ae5
  1. 39
      commission_plan/README.rst
  2. 24
      commission_plan/__init__.py
  3. 46
      commission_plan/__manifest__.py
  4. 22
      commission_plan/controllers/__init__.py
  5. 58
      commission_plan/controllers/main.py
  6. 6
      commission_plan/doc/RELEASE_NOTES.md
  7. 22
      commission_plan/models/__init__.py
  8. 126
      commission_plan/models/commission.py
  9. 5
      commission_plan/security/ir.model.access.csv
  10. BIN
      commission_plan/static/description/assets/icons/check.png
  11. BIN
      commission_plan/static/description/assets/icons/chevron.png
  12. BIN
      commission_plan/static/description/assets/icons/cogs.png
  13. BIN
      commission_plan/static/description/assets/icons/consultation.png
  14. BIN
      commission_plan/static/description/assets/icons/ecom-black.png
  15. BIN
      commission_plan/static/description/assets/icons/education-black.png
  16. BIN
      commission_plan/static/description/assets/icons/hotel-black.png
  17. BIN
      commission_plan/static/description/assets/icons/icon.png
  18. BIN
      commission_plan/static/description/assets/icons/license.png
  19. BIN
      commission_plan/static/description/assets/icons/lifebuoy.png
  20. BIN
      commission_plan/static/description/assets/icons/logo.png
  21. BIN
      commission_plan/static/description/assets/icons/manufacturing-black.png
  22. BIN
      commission_plan/static/description/assets/icons/pos-black.png
  23. BIN
      commission_plan/static/description/assets/icons/puzzle.png
  24. BIN
      commission_plan/static/description/assets/icons/restaurant-black.png
  25. BIN
      commission_plan/static/description/assets/icons/service-black.png
  26. BIN
      commission_plan/static/description/assets/icons/trading-black.png
  27. BIN
      commission_plan/static/description/assets/icons/training.png
  28. BIN
      commission_plan/static/description/assets/icons/update.png
  29. BIN
      commission_plan/static/description/assets/icons/user.png
  30. BIN
      commission_plan/static/description/assets/icons/wrench.png
  31. BIN
      commission_plan/static/description/assets/modules/accounting_image.gif
  32. BIN
      commission_plan/static/description/assets/modules/approval_image.png
  33. BIN
      commission_plan/static/description/assets/modules/budget_image.png
  34. BIN
      commission_plan/static/description/assets/modules/deadline_image.png
  35. BIN
      commission_plan/static/description/assets/modules/export_image.png
  36. BIN
      commission_plan/static/description/assets/modules/pos_image.png
  37. BIN
      commission_plan/static/description/assets/screenshots/CRM-Dashboard-user.png
  38. BIN
      commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-1.png
  39. BIN
      commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-2.png
  40. BIN
      commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-3.png
  41. BIN
      commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-4.png
  42. BIN
      commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-5.png
  43. BIN
      commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-6.png
  44. BIN
      commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-7.png
  45. BIN
      commission_plan/static/description/assets/screenshots/dash_screenshot-1.png
  46. BIN
      commission_plan/static/description/assets/screenshots/dash_screenshot-2.png
  47. BIN
      commission_plan/static/description/assets/screenshots/dash_screenshot-22.png
  48. BIN
      commission_plan/static/description/assets/screenshots/dash_screenshot-3.png
  49. BIN
      commission_plan/static/description/assets/screenshots/dash_screenshot-4.png
  50. BIN
      commission_plan/static/description/assets/screenshots/dash_screenshot-5.png
  51. BIN
      commission_plan/static/description/assets/screenshots/dash_screenshot-6.png
  52. BIN
      commission_plan/static/description/assets/screenshots/hero.gif
  53. BIN
      commission_plan/static/description/assets/screenshots/hero_kit.gif
  54. BIN
      commission_plan/static/description/assets/screenshots/output.gif
  55. BIN
      commission_plan/static/description/banner.png
  56. BIN
      commission_plan/static/description/icon.png
  57. 693
      commission_plan/static/description/index.html
  58. 43
      commission_plan/static/src/js/action_manager.js
  59. 11
      commission_plan/views/action_manager.xml
  60. 128
      commission_plan/views/commission.xml
  61. 22
      commission_plan/wizard/__init__.py
  62. 370
      commission_plan/wizard/commission_report.py
  63. 48
      commission_plan/wizard/commission_report.xml

39
commission_plan/README.rst

@ -0,0 +1,39 @@
CRM Commission Plan
=======
* CRM Commission Plan module for Odoo 13.
Installation
============
- www.odoo.com/documentation/13.0/setup/install.html
- Install our custom addon
License
-------
General Public License, Version 3 (LGPL v3).
(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html)
Company
-------
* 'Cybrosys Techno Solutions <https://cybrosys.com/>'__
Credits
-------
* 'Cybrosys Techno Solutions <https://cybrosys.com/>'__
Contacts
--------
* Mail Contact : odoo@cybrosys.com
Bug Tracker
-----------
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
Maintainer
==========
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com
Further information
===================
HTML Description: `<static/description/index.html>`__

24
commission_plan/__init__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import models
from . import wizard
from . import controllers

46
commission_plan/__manifest__.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
{
"name": "Odoo13 CRM Commission Plan",
'description': """CRM Commission Plan for odoo13, CRM, crm commission, commission plan, crm features""",
'summary': """CRM Commission Plan for odoo13""",
"category": 'Sales',
"version": '13.0.1.0.0',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
"depends": ['base', 'sale_management', 'crm'],
"data": [
'security/ir.model.access.csv',
'views/commission.xml',
'wizard/commission_report.xml',
'views/action_manager.xml',
],
'images': [
'static/description/banner.png',
],
'license': 'LGPL-3',
'installable': True,
'application': False,
'auto_install': False,
}

22
commission_plan/controllers/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import main

58
commission_plan/controllers/main.py

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
import json
from odoo import http
from odoo.http import content_disposition, request
from odoo.addons.web.controllers.main import _serialize_exception
from odoo.tools import html_escape
class XLSXReportController(http.Controller):
"""XLSX Report Controller"""
@http.route('/xlsx_reports', type='http', auth='user', methods=['POST'],
csrf=False)
def get_report_xlsx(self, model, options, output_format, token, report_name,
**kw):
"""Function for report printing"""
uid = request.session.uid
report_obj = request.env[model].with_user(uid)
options = json.loads(options)
try:
if output_format == 'xlsx':
response = request.make_response(None, headers=[
('Content-Type', 'application/vnd.ms-excel'),
('Content-Disposition',
content_disposition(report_name + '.xlsx'))])
report_obj.get_xlsx_report(options, response)
response.set_cookie('fileToken', token)
return response
except Exception as e:
se = _serialize_exception(e)
error = {
'code': 200,
'message': 'Odoo Server Error',
'data': se
}
return request.make_response(html_escape(json.dumps(error)))

6
commission_plan/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <commission_plan>
#### 18.12.2021
#### Version 13.0.1.0.0
#### ADD
- Initial commit for Commission Plan Module

22
commission_plan/models/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import commission

126
commission_plan/models/commission.py

@ -0,0 +1,126 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import exceptions
from odoo import fields, models, api, _
class CommissionPlan(models.Model):
_name = 'crm.commission'
_description = 'Commission Plan'
_rec_name = "name"
_inherit = ['mail.thread', 'mail.activity.mixin']
name = fields.Char('Name', required=True)
active = fields.Boolean('Active', default=True)
date_from = fields.Date(string="From Date", required=True)
date_to = fields.Date(string="To Date", required=True)
type = fields.Selection(
[('product', 'Product wise'),
('revenue', 'Revenue wise')], string="Type",
default="product")
team_id = fields.Many2one('crm.team', string='Sales Team')
user_id = fields.Many2one('res.users', string='Salesperson')
product_comm_ids = fields.One2many('commission.product', 'commission_id',
string="Product Wise")
straight_commission_rate = fields.Float(string='Commission rate (%)')
revenue_grd_comm_ids = fields.One2many(
'commission.graduated',
'commission_id',
string="Revenue Graduated Wise")
revenue_type = fields.Selection(
[('straight', 'Straight Commission'),
('graduated', 'Graduated Commission')],
string="Revenue Type")
@api.constrains("date_from", "date_to")
def _check_date(self):
for rec in self:
if rec.date_to < rec.date_from:
raise exceptions.ValidationError(
_("The From date cannot be earlier than To date.")
)
@api.onchange('type')
def onchange_type(self):
if self.type == 'revenue':
self.product_comm_ids = [(5, 0, 0)]
elif self.type == 'product':
self.revenue_type = False
self.straight_commission_rate = False
self.revenue_grd_comm_ids = [(5, 0, 0)]
class CommissionProduct(models.Model):
_name = 'commission.product'
_description = 'Commission Product Wise'
user_id = fields.Many2one('res.users')
category_id = fields.Many2one('product.category', string='Product Category')
product_id = fields.Many2one('product.product', string='Product',
domain="[('categ_id', '=', category_id)]")
percentage = fields.Float(string='Rate in Percentage (%)')
amount = fields.Monetary('Maximum Commission Amount', default=0.0)
currency_id = fields.Many2one("res.currency", string="Currency",
default=lambda self:
self.env.user.company_id.currency_id.id)
commission_id = fields.Many2one("crm.commission")
class CommissionRevenueGraduated(models.Model):
_name = 'commission.graduated'
_description = 'Commission Revenue Graduated Wise'
graduated_commission_rate = fields.Float(string='Commission rate (%)')
amount_from = fields.Float(string="From Amount")
amount_to = fields.Float(string="To Amount")
commission_id = fields.Many2one("crm.commission")
sequence = fields.Integer(string='Sequence', compute='_compute_sequence',
store=True)
@api.depends('commission_id')
def _compute_sequence(self):
number = 1
seq = self.mapped('commission_id')
for rule in seq.revenue_grd_comm_ids:
rule.sequence = number
number += 1
@api.constrains("amount_from", "amount_to")
def _check_amounts(self):
for rec in self:
if rec.amount_to < rec.amount_from:
raise exceptions.ValidationError(
_("The From Amount limit cannot be greater than To Amount.")
)
class CrmTeam(models.Model):
_inherit = 'crm.team'
commission_id = fields.Many2one('crm.commission', string='Commission Plan')
class CrmSalespersons(models.Model):
_inherit = 'res.users'
commission_id = fields.Many2one('crm.commission', string='Commission Plan')

5
commission_plan/security/ir.model.access.csv

@ -0,0 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_commission_plan,crm.commission,model_crm_commission,base.group_user,1,1,1,1
access_commission_product,commission.product,model_commission_product,base.group_user,1,1,1,1
access_commission_wizard,commission.wizard,model_commission_wizard,base.group_user,1,1,1,1
access_commission_graduated,commission.graduated,model_commission_graduated,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_commission_plan crm.commission model_crm_commission base.group_user 1 1 1 1
3 access_commission_product commission.product model_commission_product base.group_user 1 1 1 1
4 access_commission_wizard commission.wizard model_commission_wizard base.group_user 1 1 1 1
5 access_commission_graduated commission.graduated model_commission_graduated base.group_user 1 1 1 1

BIN
commission_plan/static/description/assets/icons/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
commission_plan/static/description/assets/icons/chevron.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
commission_plan/static/description/assets/icons/cogs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
commission_plan/static/description/assets/icons/consultation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
commission_plan/static/description/assets/icons/ecom-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

BIN
commission_plan/static/description/assets/icons/education-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

BIN
commission_plan/static/description/assets/icons/hotel-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

BIN
commission_plan/static/description/assets/icons/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
commission_plan/static/description/assets/icons/license.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
commission_plan/static/description/assets/icons/lifebuoy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
commission_plan/static/description/assets/icons/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
commission_plan/static/description/assets/icons/manufacturing-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
commission_plan/static/description/assets/icons/pos-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
commission_plan/static/description/assets/icons/puzzle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

BIN
commission_plan/static/description/assets/icons/restaurant-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

BIN
commission_plan/static/description/assets/icons/service-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

BIN
commission_plan/static/description/assets/icons/trading-black.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

BIN
commission_plan/static/description/assets/icons/training.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

BIN
commission_plan/static/description/assets/icons/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
commission_plan/static/description/assets/icons/user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

BIN
commission_plan/static/description/assets/icons/wrench.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
commission_plan/static/description/assets/modules/accounting_image.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

BIN
commission_plan/static/description/assets/modules/approval_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
commission_plan/static/description/assets/modules/budget_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
commission_plan/static/description/assets/modules/deadline_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
commission_plan/static/description/assets/modules/export_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
commission_plan/static/description/assets/modules/pos_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
commission_plan/static/description/assets/screenshots/CRM-Dashboard-user.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

BIN
commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
commission_plan/static/description/assets/screenshots/Crm-Commission-Plan-7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
commission_plan/static/description/assets/screenshots/dash_screenshot-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
commission_plan/static/description/assets/screenshots/dash_screenshot-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
commission_plan/static/description/assets/screenshots/dash_screenshot-22.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
commission_plan/static/description/assets/screenshots/dash_screenshot-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
commission_plan/static/description/assets/screenshots/dash_screenshot-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
commission_plan/static/description/assets/screenshots/dash_screenshot-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
commission_plan/static/description/assets/screenshots/dash_screenshot-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
commission_plan/static/description/assets/screenshots/hero.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
commission_plan/static/description/assets/screenshots/hero_kit.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 KiB

BIN
commission_plan/static/description/assets/screenshots/output.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

BIN
commission_plan/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
commission_plan/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

693
commission_plan/static/description/index.html

@ -0,0 +1,693 @@
<div class="container" style="padding: 1rem !important; margin-bottom: 1rem !important;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between"
style="border-bottom: 1px solid #d5d5d5;">
<div class="my-3">
<img src="./assets/icons/logo.png" style="width: auto !important; height: 40px !important;">
</div>
<div class="my-3 d-flex align-items-center">
<div
style="background-color: #7C7BAD !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Community
</div>
<div
style="background-color: #875A7B !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
</div>
</div>
</div>
</div>
<div class="container" style="padding: 0rem 1.5rem 4rem !important">
<div class="row" style="height: 950px !important;">
<div class="col-sm-12 col-md-12 col-lg-12"
style="padding: 4.1rem 1rem !important; background-color: #FFFFFF !important; height: 600px !important;">
<div class="d-flex justify-content-center mb-2">
<img src="assets/icons/icon.png" class="mr-2" height="80px" width="80px">
<h1
style="font-family: 'Montserrat', sans-serif !important; font-weight: 800 !important; color: #282F33 !important; font-size: 4rem !important; text-align: center !important;">
CRM Commission Plan</h1>
</div>
<p
style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #282F33 !important; font-size: 1.4rem !important; text-align: center !important;">
CRM Commission Plan for odoo13
</p>
<img src="./assets/screenshots/hero.gif" class="img-responsive" width="100%" height="auto" />
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 px-3 text-center">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 1.4rem; font-weight: 700 !important;">
Explore this module</h2>
<div class="mt-3">
<a href="#overview" class="mr-5"
style="font-family: 'Montserrat', sans-serif !important; font-size: 1rem; font-weight: 700; color: #714B67 !important;">Overview
<i class="fa fa-chevron-right ml-1" style="color: #714B67 !important;"></i></a>
<a href="#features" class="mr-5"
style="font-family: 'Montserrat', sans-serif !important; font-size: 1rem; font-weight: 700; color: #714B67 !important;">Key
Features <i class="fa fa-chevron-right ml-1" style="color: #714B67 !important;"></i></a>
<a href="#configuration" class="mr-5"
style="font-family: 'Montserrat', sans-serif !important; font-size: 1rem; font-weight: 700; color: #714B67 !important;">Configuration
<i class="fa fa-chevron-right ml-1" style="color: #714B67 !important;"></i></a>
<a href="#screenshots" class="mr-5"
style="font-family: 'Montserrat', sans-serif !important; font-size: 1rem; font-weight: 700; color: #714B67 !important;">Screenshots
<i class="fa fa-chevron-right ml-1" style="color: #714B67 !important;"></i></a>
<!--<a href="#video" class="mr-5"-->
<!-- style="font-family: 'Montserrat', sans-serif !important; font-size: 1rem; font-weight: 700; color: #714B67 !important;">Video<i-->
<!-- class="fa fa-chevron-right ml-1" style="color: #714B67 !important;"></i></a>-->
</div>
<hr class="my-5" style="border-color: d5d5d5 !important;" />
</div>
</div>
<div class="row " id="overview">
<div class="col-sm-12 col-md-12 col-lg-12 px-4">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Overview</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
<p class="mt-4"
style="font-size: 1.1rem !important; color: #282F33 !important; font-weight: 400 !important; line-height: 1.85 !important">
Motivating your sales representatives is one of the key factors for successful sales. The
commission-based
plan helps to motivate your Sales Teams and Salespersons to achieve the goals and earnings.
A Commission Plan module is a monetary incentive for motivating Salespeople to meet their Sales
quota
and the CRM Commission Plan has embraced the functionality. In the CRM Commission Plan, we have 2 types of Commission Plans
which are being defined product-wise and revenue-wise further under revenue-wise we have two types:
the straight commission and graduated commission.<br />
Moreover, the Salesperson and the sales team
are
rewarded based on the business Opportunities they bring into the company with a well-structured plan
which
can be crafted in the beginning.
</p>
</div>
</div>
<div class="row" id="features" style="margin-top: 3rem;">
<div class="col-sm-12 col-md-12 col-lg-12 px-4">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Features</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
<div class="row">
<div class="col-sm-12 col-md-6">
<div class="d-flex my-5"
style="padding-bottom: 1.3rem !important; border-bottom: 2px solid #f0f0f0;">
<img src="assets/icons/check.png" width="24px" height="24px" class="mr-2">
<h3 style="font-size: 1.2rem !important;">Craft custom Commission to Salesperson and Sales
Team</h3>
</div>
<div class="d-flex my-5"
style="padding-bottom: 1.3rem !important; border-bottom: 2px solid #f0f0f0;">
<img src="assets/icons/check.png" width="24px" height="24px" class="mr-2">
<h3 style="font-size: 1.2rem !important;">Draft Commissions based on Revenue and respective
Product</h3>
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="d-flex my-5"
style="padding-bottom: 1.3rem !important; border-bottom: 2px solid #f0f0f0;">
<img src="assets/icons/check.png" width="24px" height="24px" class="mr-2">
<h3 style="font-size: 1.2rem !important;">Define Commission based on Product Category</h3>
</div>
<div class="d-flex my-5"
style="padding-bottom: 1.3rem !important; border-bottom: 2px solid #f0f0f0;">
<img src="assets/icons/check.png" width="24px" height="24px" class="mr-2">
<h3 style="font-size: 1.2rem !important;">Informative Commission Plan report</h3>
</div>
</div>
</div>
</div>
</div>
<div class="row " id="configuration">
<div class="col-sm-12 col-md-12 col-lg-12 px-4">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Configuration</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
<p class="mt-4"
style="font-size: 1.1rem !important; color: #282F33 !important; font-weight: 400 !important; line-height: 1.85 !important">
<b>For creating new commission plans:</b><br />
<ol>
<li>
<b>Creating new commissions:</b><br />
<p>Initially Create a new commission and Choose a name to distinguish
that typ<br /></p>
</li>
<li>
<b>Select the type of the Commission:</b><br />
<p><b>Product-based:</b> Commissions are calculated as the percentage of
the price based on the selected product in the form.<br /></p>
<p><b>Revenue-based:</b> A certain percentage of revenue is given as
Commission to the Salesperson<br /></p>
<p>
<b>Straight revenue:</b> Commissions are calculated using a fixed
percentage of the revenue sold. You can fill the percentage in the field "Commission
rate".<br />
</p>
<p>
<b>Graduated revenue:</b> Commissions are calculated as a percentage
of the revenue generated at amount intervals.<br />
</p>
<p>
You can fill in the amount intervals and the percentages in the
"Graduated Revenue Commission" field.<br />
</p>
</li>
</ol>
<p class="mt-4"
style="font-size: 1.1rem !important; color: #282F33 !important; font-weight: 400 !important; line-height: 1.85 !important">
<b>For adding Commission in Salesperson & Sales team:</b><br />
</p>
<b>Go to CRM -> Configuration -> Salesperson or Sales team</b>
<ul>
<li>Edit the Salesperson or Sales team</li>
<li>Choose a commission type</li>
<li>Save it</li>
</ul>
<p class="mt-4"
style="font-size: 1.1rem !important; color: #282F33 !important; font-weight: 400 !important; line-height: 1.85 !important">
<b>For printing Commission in XLSX report::</b><br />
</p>
<b>Go to CRM -> Configuration -> Salesperson or Sales team</b>
<ul>
<li>CRM -> Reporting -> Commission Report</li>
<li>CRM -> Reporting -> Commission Report</li>
</ul>
</div>
</div>
<div class="row mt-5" id="screenshots">
<div class="col-sm-12 col-md-12 col-lg-12 px-4">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Screenshots</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
<div class="mt-5">
<div class="d-flex mb-2" style="padding-bottom: 0.5rem !important;">
<img src="assets/icons/chevron.png" width="20px" height="20px" class="mr-2"
style="margin-top: 4px !important;">
<h3>Commission Plan</h3>
</div>
<p>The Commission Plan window can be accessed from the Configuration tab of the module and
selected
on
the Commission Plan menu. Here all the Commission Plan details of the operation in respect
to
the
functioning of the Odoo CRM will be depicted.</p>
<img src="assets/screenshots/Crm-Commission-Plan-1.png" class="img-responsive img-thumbnail border">
</div>
<div class="mt-5">
<div class="d-flex mb-2" style="padding-bottom: 0.5rem !important;">
<img src="assets/icons/chevron.png" width="20px" height="20px" class="mr-2"
style="margin-top: 4px !important;">
<h3>Commission Plan based on Product Category</h3>
</div>
<p>The Commission Plan Creation window can be accessed from the Commission Plan window and while
selecting the Type the Product Wise options can be selected. Further, the Product Categories
with
respect to the respective Product Category based Commission Plan can be defined.</p>
<img src="assets/screenshots/Crm-Commission-Plan-2.png" class="img-responsive img-thumbnail border">
</div>
<div class="mt-5">
<div class="d-flex mb-2" style="padding-bottom: 0.5rem !important;">
<img src="assets/icons/chevron.png" width="20px" height="20px" class="mr-2"
style="margin-top: 4px !important;">
<h3>Revenue-based Commission Plan: Straight Revenue Commission Plan</h3>
</div>
<p>The second form of Commission Plan in the Odoo CRM Commission Plan where the Sales Revenue and its
percentage
calculation will be provided as Commission to the Salesperson.<br />
While Creating a Straight Revenue Commission plan the Commission type can be selected as
Straight
Commission. Further, the commission rate can be defined under the Straight Revenue
Commission
tab.</p>
<img src="assets/screenshots/Crm-Commission-Plan-3.png" class="img-responsive img-thumbnail border">
</div>
<div class="mt-5">
<div class="d-flex mb-2" style="padding-bottom: 0.5rem !important;">
<img src="assets/icons/chevron.png" width="20px" height="20px" class="mr-2"
style="margin-top: 4px !important;">
<h3>Revenue-based Commission Plan: Graduated Revenue Commission Plan</h3>
</div>
<p>While Creating a Graduated Revenue Commission Plan the Commission type can be selected as
Graduated Commission. Further, the commission rate can be defined under the Graduated
Revenue
Commission tab.</p>
<img src="assets/screenshots/Crm-Commission-Plan-4.png" class="img-responsive img-thumbnail border">
</div>
<div class="mt-5">
<div class="d-flex mb-2" style="padding-bottom: 0.5rem !important;">
<img src="assets/icons/chevron.png" width="20px" height="20px" class="mr-2"
style="margin-top: 4px !important;">
<h3>Assigning Commission Plan for Salesperson</h3>
</div>
<p>In the CRM Commission Plan under the respective Salesperson description tab, there will be a dedicated
tab
the
Commission Plan where the respective Commission Plan with respect to the operation can be
defined.</p>
<img src="assets/screenshots/Crm-Commission-Plan-5.png" class="img-responsive img-thumbnail border">
</div>
<div class="mt-5">
<div class="d-flex mb-2" style="padding-bottom: 0.5rem !important;">
<img src="assets/icons/chevron.png" width="20px" height="20px" class="mr-2"
style="margin-top: 4px !important;">
<h3>Assigning Commission Plan for Sales Team</h3>
</div>
<p>In the CRM Commission Plan under the respective sales team description tab, there will be a dedicated tab
the
Commission Plan where the respective Commission Plan with respect to the operation can be
defined.</p>
<img src="assets/screenshots/Crm-Commission-Plan-6.png" class="img-responsive img-thumbnail border">
</div>
<div class="mt-5">
<div class="d-flex mb-2" style="padding-bottom: 0.5rem !important;">
<img src="assets/icons/chevron.png" width="20px" height="20px" class="mr-2"
style="margin-top: 4px !important;">
<h3>Print the Commission Plan Report in XLSX Format</h3>
</div>
<p>The CRM Commission Plan also holds an advanced operations feature where the Admins, as well as every
User,
can take the Print out of the Commission Plan Reports based on their need and for the period
of
operations that are required. The Reports can be generated in XLSX formats and can be saved
based
on the need. To take the printout of the Commission Plan Report you should go to the
Reporting
tab
of the CRM Commission Plan and further select the Commission Plan menu and select the Required entries
and
Click to Print XLS.</p>
<img src="assets/screenshots/Crm-Commission-Plan-7.png" class="img-responsive img-thumbnail border">
</div>
</div>
</div>
<!-- SUGGESTED PRODUCTS -->
<div class="row mt-3">
<div class="col-lg-12 d-flex flex-column justify-content-center" style="padding: 2.5rem 1rem !important;">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Suggested Products</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
<div id="demo1" class="row carousel slide mt-4 data-ride=" carousel="">
<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/14.0/export_stockinfo_xls/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/export_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/14.0/dashboard_pos/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/pos_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/14.0/product_approval_management/"
target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/approval_image.png">
</div>
</a>
</div>
</div>
<div class="carousel-item" style="min-height:0px">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/14.0/base_account_budget/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/budget_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/14.0/task_deadline_reminder/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/deadline_image.png">
</div>
</a>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/14.0/base_accounting_kit/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./assets/modules/accounting_image.gif">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev"
style="left:-25px;width: 35px;color: #000;"> <span class="carousel-control-prev-icon"><i
class="fa fa-chevron-left" style="font-size:24px"></i></span> </a> <a
class="carousel-control-next" href="#demo1" data-slide="next"
style="right:-25px;width: 35px;color: #000;">
<span class="carousel-control-next-icon"><i class="fa fa-chevron-right"
style="font-size:24px"></i></span>
</a>
</div>
</div>
</div>
<!-- END OF SUGGESTED PRODUCTS -->
<!-- OUR SERVICES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Our Services</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #1dd1a1 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/cogs.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Customization</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ff6b6b !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/wrench.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6462CD !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/lifebuoy.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Support</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #ffa801 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/user.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Hire
Odoo
Developer</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #54a0ff !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/puzzle.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Integration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #6d7680 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/update.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Migration</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #786fa6 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/consultation.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Consultancy</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #f8a5c2 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/training.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Implementation</h6>
</div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
<div class="d-flex justify-content-center align-items-center mx-3 my-3"
style="background-color: #e6be26 !important; border-radius: 15px !important; height: 80px; width: 80px;">
<img src="assets/icons/license.png" class="img-responsive" height="48px" width="48px">
</div>
<h6 class="text-center" style="font-family: Montserrat, 'sans-serif' !important; font-weight: bold;">
Odoo
Licensing Consultancy</h6>
</div>
</div>
</section>
<!-- END OF END OF OUR SERVICES -->
<!-- OUR INDUSTRIES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Our Industries</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/trading-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Trading
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easily procure
and
sell your products</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/pos-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
POS
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Easy
configuration
and convivial experience</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/education-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Education
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
A platform for
educational management</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/manufacturing-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Manufacturing
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Plan, track and
schedule your operations</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/ecom-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
E-commerce &amp; Website
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Mobile
friendly,
awe-inspiring product pages</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/service-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Service Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Keep track of
services and invoice</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/restaurant-black.png" class="img-responsive mb-3" height="48px"
width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Restaurant
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
Run your bar or
restaurant methodically</p>
</div>
</div>
<div class="col-lg-3">
<div class="my-4 d-flex flex-column justify-content-center"
style="background-color: #f6f8f9 !important; border-radius: 10px; padding: 2rem !important; height: 250px !important;">
<img src="./assets/icons/hotel-black.png" class="img-responsive mb-3" height="48px" width="48px">
<h5
style="font-family: Montserrat, sans-serif !important; color: #000 !important; font-weight: bold;">
Hotel Management
</h5>
<p style="font-family: Montserrat, sans-serif !important; font-size: 0.9rem !important;">
An
all-inclusive
hotel management application</p>
</div>
</div>
</div>
</section>
<!-- END OF END OF OUR INDUSTRIES -->
<!-- FOOTER -->
<!-- Footer Section -->
<section class="container" style="margin: 5rem auto 2rem;">
<div class="row" style="max-width:1540px;">
<div class="col-lg-12">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-size: 2rem; font-weight: 700 !important; color: #21272B !important;">
Need Help?</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 30px !important; margin-left: 0 !important; margin-bottom: 2rem !important;" />
</div>
</div>
<!-- Contact Cards -->
<div class="row d-flex justify-content-center align-items-center"
style="max-width:1540px; margin: 0 auto 2rem auto;">
<div class="col-lg-12" style="padding: 0rem 3rem 2rem; border-radius: 10px; margin-right: 3rem; ">
<div class="row mt-4">
<div class="col-lg-6">
<a href="mailto:odoo@cybrosys.com" target="_blank" class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #4d4d4d; color: #FFF; border-radius: 4px;"><i
class="fa fa-envelope mr-2"></i>odoo@cybrosys.com</a>
</div>
<div class="col-lg-6">
<a href="https://api.whatsapp.com/send?phone=918606827707" target="_blank"
class="btn btn-block mb-2 deep_hover"
style="text-decoration: none; background-color: #25D366; color: #FFF; border-radius: 4px;"><i
class="fa fa-whatsapp mr-2"></i>+91 86068 27707</a>
</div>
</div>
</div>
</div>
<!-- End of Contact Cards -->
</section>
<!-- Footer -->
<section class="oe_container" style="padding: 2rem 3rem 1rem;">
<div class="row" style="max-width:1540px; margin: 0 auto; margin-right: 3rem; ">
<!-- Logo -->
<div class="col-lg-12 d-flex justify-content-center align-items-center" style="margin-top: 3rem;">
<img src="https://www.cybrosys.com/images/logo.png" width="200px" height="auto" />
</div>
<!-- End of Logo -->
<div class="col-lg-12">
<hr
style="margin-top: 3rem;background: linear-gradient(90deg, rgba(2,0,36,0) 0%, rgba(229,229,229,1) 33%, rgba(229,229,229,1) 58%, rgba(0,212,255,0) 100%); height: 2px; border-style: none;">
<!-- End of Footer Section -->
</div>
</div>
</section>
<!-- END OF FOOTER -->
</div>

43
commission_plan/static/src/js/action_manager.js

@ -0,0 +1,43 @@
odoo.define('commission_plan.action_manager', function(require){
"use strict";
/*
* Purpose is to add actions of type
* 'ir.actions.report' to the ActionManager
*/
var ActionManager = require('web.ActionManager');
var framework = require('web.framework');
var session = require('web.session');
ActionManager.include({
/*
* Executes actions of type 'ir.actions.report'.
* @private
* @param {Object} action the description of the action to execute
* @param {Object} options @see doAction for details
* @returns {Promise} resolved when the action has been executed
*/
_executexlsxReportDownloadAction: function (action) {
framework.blockUI();
var def = $.Deferred();
session.get_file({
url: '/xlsx_reports',
data: action.data,
success: def.resolve.bind(def),
error: (error) => this.call('crash_manager', 'rpc_error', error),
complete: framework.unblockUI,
});
return def;
},
/*
* Overrides to handle the 'ir.actions.report' actions.
* @override
* @private
*/
_executeReportAction: function (action, options) {
if (action.report_type === 'xlsx') {
return this._executexlsxReportDownloadAction(action, options);
}
return this._super.apply(this, arguments);
},
});
});

11
commission_plan/views/action_manager.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<template id="assets_backend" name="xls_assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript"
src="/commission_plan/static/src/js/action_manager.js"/>
</xpath>
</template>
</data>
</odoo>

128
commission_plan/views/commission.xml

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_crm_team_form_inherit" model="ir.ui.view">
<field name="name">team commission plan</field>
<field name="model">crm.team</field>
<field name="inherit_id" ref="sales_team.crm_team_view_form"/>
<field name="arch" type="xml">
<field name="alias_contact" position="after">
<field name="commission_id"/>
</field>
</field>
</record>
<record id="view_crm_salespersons_form_inherit" model="ir.ui.view">
<field name="name">sales persons commission plan</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_simple_form"/>
<field name="arch" type="xml">
<field name="mobile" position="after">
<field name="commission_id"/>
</field>
</field>
</record>
<record id="cm_commission_tree" model="ir.ui.view">
<field name="name">crm.commission.tree</field>
<field name="model">crm.commission</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="type"/>
</tree>
</field>
</record>
<record id="cm_commission_form" model="ir.ui.view">
<field name="name">crm.commission.form</field>
<field name="model">crm.commission</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="name"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group>
<field name="active"/>
<field name="type"/>
<field name="revenue_type" attrs="{'invisible':[('type', '=', 'product')]}"/>
</group>
</group>
<notebook>
<page string="Product Wise" attrs="{'invisible':[('type', '!=', 'product')]}" >
<field name="product_comm_ids" >
<tree editable="Top" create="1" multi_edit="1">
<field name="category_id" style="width:20%%"/>
<field name="product_id" style="width:20%%"/>
<field name="percentage" style="width:50%%"/>
<field name="amount" style="width:50%%"/>
</tree>
</field>
</page>
<page string="Straight Revenue Commission" attrs="{'invisible' : ['|','|',('type', '=', 'product'),('revenue_type', '=', False),('revenue_type', '=', 'graduated')]}">
<group>
<field name="straight_commission_rate" string="Commission rate (%)"
attrs="{'invisible' : ['|','|',('type', '=', 'product'),('revenue_type', '=', False),('revenue_type', '=', 'graduated')]}"/>
</group>
</page>
<page string="Graduated Revenue Commission" attrs="{'invisible' : ['|','|',('type', '=', 'product'),('revenue_type', '=', False),('revenue_type', '=', 'straight')]}">
<field name="revenue_grd_comm_ids" >
<tree editable="Top" create="1" multi_edit="1">
<field name="sequence"/>
<field name="amount_from"/>
<field name="amount_to"/>
<field name="graduated_commission_rate"/>
</tree>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="action_commission_plan" model="ir.actions.act_window">
<field name="name">Crm Commission Plan</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">crm.commission</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create New Commission Plan!
</p>
</field>
</record>
<menuitem id="crm_menu_commission_plan"
name="Commission Plans"
parent="crm.crm_menu_config"
action="action_commission_plan"
sequence="13"/>
<record id="action_crm_salespersons" model="ir.actions.act_window">
<field name="name">Sales Persons</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.users</field>
<field name="domain">[('share','=',False)]</field>
<field name="view_mode">tree,kanban,form</field>
</record>
<menuitem id="crm_menu_sales_persons"
name="Sales Persons"
parent="crm.crm_menu_config"
action="action_crm_salespersons"
sequence="6"/>
</odoo>

22
commission_plan/wizard/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import commission_report

370
commission_plan/wizard/commission_report.py

@ -0,0 +1,370 @@
"""Report Wizard for Commission Plan"""
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
import io
import json
from odoo import models, fields, api
from odoo.tools import date_utils
from odoo.exceptions import ValidationError
try:
from odoo.tools.misc import xlsxwriter
except ImportError:
import xlsxwriter
class CommissionReportWizard(models.TransientModel):
_name = 'commission.wizard'
_description = 'Commission Report Wizard'
date_from = fields.Date(string="From Date")
date_to = fields.Date(string="To Date")
salesperson_ids = fields.Many2many('res.users', string='Salesperson',
domain="[('share','=',False)]")
sales_team_ids = fields.Many2many('crm.team', string='Sales Team')
date = fields.Date(string='Date', default=fields.Date.context_today)
is_sales_person = fields.Boolean(default=False, string="Is sales person")
is_sales_team = fields.Boolean(default=False, string="Is sales team")
@api.onchange('salesperson_ids')
def onchange_salesperson_ids(self):
"""Function for hide a field base on values"""
self.is_sales_person = True if self.salesperson_ids else False
@api.onchange('sales_team_ids')
def onchange_sales_team_ids(self):
self.is_sales_team = True if self.sales_team_ids else False
@api.constrains('sales_team_ids', 'salesperson_ids')
def sales_team_constrains(self):
"""Function for showing validation error"""
for rec in self:
if self.sales_team_ids:
if not rec.sales_team_ids.member_ids:
raise ValidationError(
"Selected Sales Team haven't any Salespersons")
if not self.sales_team_ids.member_ids.commission_id and \
not self.sales_team_ids.commission_id:
raise ValidationError(
"Selected Sales Team haven't any Commission Plan")
elif self.salesperson_ids and not rec.salesperson_ids.commission_id:
raise ValidationError(
"Selected Salesperson haven't any Commission Plan")
def print_xls_report(self):
"""Function for printing xlsx report"""
# sales person's condition starts here #
user_sale_orders = self.env['sale.order'].search([
('user_id', 'in', self.salesperson_ids.ids)])
user_sale_orders_dict = {}
total_list = []
commission_list = []
user_commission_name = []
user_commission_salesperson = []
user_obj = user_sale_orders.mapped('user_id').sorted(key=lambda d: d.id)
for user in user_obj:
user_sale_orders_dict.update({
user: user_sale_orders.filtered(lambda l: l.user_id == user)
})
for user, user_sale_orders in user_sale_orders_dict.items():
commission_id = user.commission_id
if not commission_id:
continue
filtered_order_lines = user_sale_orders.filtered(
lambda l: self.date_from <= l.date_order.date(
) <= self.date_to and l.date_order.date() >= commission_id.date_from
).mapped('order_line')
filtered_order_lines_commission_total = sum(
filtered_order_lines.mapped('price_subtotal'))
if commission_id.type == 'product':
commission_products = commission_id.product_comm_ids.product_id
prod_commission = filtered_order_lines.filtered(
lambda l: l.product_id in commission_products)
for rule in commission_id.product_comm_ids.filtered(
lambda l: l.product_id in prod_commission.mapped(
'product_id')):
product_order_line = prod_commission.filtered(
lambda l: l.product_id == rule.product_id)
total_price = sum(
product_order_line.mapped('price_subtotal'))
product_commission = (total_price * rule.percentage) / 100
total_list.append(total_price)
user_commission_name.append(commission_id.name)
user_commission_salesperson.append(user.name)
commission_list.append(rule.amount) if (
product_commission > rule.amount) \
else commission_list.append(product_commission)
if commission_id.type == 'revenue' and (
commission_id.revenue_type == 'graduated'):
for rule in commission_id.revenue_grd_comm_ids:
if rule.amount_from <= filtered_order_lines_commission_total < rule.amount_to:
graduated_commission = (filtered_order_lines_commission_total
* rule.graduated_commission_rate) / 100
commission_list.append(graduated_commission)
user_commission_name.append(commission_id.name)
user_commission_salesperson.append(user.name)
total_list.append(filtered_order_lines_commission_total)
if commission_id.type == 'revenue' and (
commission_id.revenue_type == 'straight'):
straight_commission = (filtered_order_lines_commission_total
* commission_id.straight_commission_rate) / 100
commission_list.append(straight_commission)
user_commission_name.append(commission_id.name)
user_commission_salesperson.append(user.name)
total_list.append(filtered_order_lines_commission_total)
# sales person's condition ends here #
if not self.sales_team_ids and not self.salesperson_ids:
self.sales_team_ids = self.env['crm.team'].search([])
# sales team's condition starts here #
team_wizard_persons = self.sales_team_ids.member_ids
team_sale_orders = self.env['sale.order'].search(
[('user_id', 'in', team_wizard_persons.ids)])
team_sale_orders_dict = {}
commission_total = []
commission = []
commission_name = []
commission_salesperson = []
commission_sales_team = []
team_obj = team_sale_orders.mapped('user_id').sorted(key=lambda d: d.id)
for team_user in team_obj:
team_sale_orders_dict.update({
team_user: team_sale_orders.filtered(
lambda l: l.user_id == team_user)
})
for team_user, team_sale_orders in team_sale_orders_dict.items():
commissions_id = team_user.commission_id if team_user.commission_id \
else team_user.sale_team_id.commission_id
if commissions_id:
filtered_order_lines = team_sale_orders.filtered(
lambda l: self.date_from <= l.date_order.date(
) <= self.date_to and l.date_order.date() >= commissions_id.date_from
).mapped('order_line')
filtered_order_lines_commission_total = sum(
filtered_order_lines.mapped('price_subtotal'))
if commissions_id.type == 'product':
commission_products = commissions_id.product_comm_ids.product_id
prod_commission = filtered_order_lines.filtered(
lambda l: l.product_id in commission_products)
for rules in commissions_id.product_comm_ids.filtered(
lambda l: l.product_id in prod_commission.mapped(
'product_id')):
product_order_line = prod_commission.filtered(
lambda l: l.product_id == rules.product_id)
total_price = sum(
product_order_line.mapped('price_subtotal'))
product_commission = (total_price * rules.percentage) / 100
commission_total.append(total_price)
commission_name.append(commissions_id.name)
commission_salesperson.append(team_user.name)
commission_sales_team.append(
team_user.sale_team_id.name)
commission.append(rules.amount) if (
product_commission > rules.amount) \
else commission.append(product_commission)
if commissions_id.type == 'revenue' and (
commissions_id.revenue_type == 'graduated'):
for rules in commissions_id.revenue_grd_comm_ids:
if rules.amount_from <= filtered_order_lines_commission_total \
< rules.amount_to:
graduated_commission = (filtered_order_lines_commission_total
* rules.graduated_commission_rate) / 100
commission.append(graduated_commission)
commission_name.append(commissions_id.name)
commission_salesperson.append(team_user.name)
commission_sales_team.append(
team_user.sale_team_id.name)
commission_total.append(
filtered_order_lines_commission_total)
if commissions_id.type == 'revenue' and (
commissions_id.revenue_type == 'straight'):
straight_commission = (filtered_order_lines_commission_total
* commissions_id.straight_commission_rate) / 100
commission.append(straight_commission)
commission_name.append(commissions_id.name)
commission_salesperson.append(team_user.name)
commission_sales_team.append(team_user.sale_team_id.name)
commission_total.append(
filtered_order_lines_commission_total)
# sales team's condition ends here #
data = {
'model_id': self.id,
'date': self.date,
'date_from': self.date_from,
'date_to': self.date_to,
'sales_team_ids': self.sales_team_ids.ids,
'salesperson_ids': self.salesperson_ids.ids,
'commission_list': commission_list,
'total_list': total_list,
'commission': commission,
'commission_total': commission_total,
'commission_name': commission_name,
'commission_salesperson': commission_salesperson,
'commission_sales_team': commission_sales_team,
'user_commission_name': user_commission_name,
'user_commission_salesperson': user_commission_salesperson,
}
return {
'type': 'ir.actions.report',
'data': {
'model': 'commission.wizard',
'options': json.dumps(data, default=date_utils.json_default),
'output_format': 'xlsx',
'report_name': 'Commission Plan xlsx report'},
'report_type': 'xlsx'
}
def get_xlsx_report(self, data, response):
"""get_xlsx_report function"""
date = data['date']
team = data['sales_team_ids']
user = data['salesperson_ids']
commission_list = data['commission_list']
total_list = data['total_list']
commission = data['commission']
commission_total = data['commission_total']
commission_name = data['commission_name']
commission_salesperson = data['commission_salesperson']
commission_sales_team = data['commission_sales_team']
user_commission_name = data['user_commission_name']
user_commission_salesperson = data['user_commission_salesperson']
output = io.BytesIO()
workbook = xlsxwriter.Workbook(output, {'in_memory': True})
sheet = workbook.add_worksheet()
head = workbook.add_format({'align': 'center', 'bold': True,
'font_size': '15px', 'valign': 'vcenter'})
format1 = workbook.add_format({'align': 'left', 'font_size': '12px'})
format2 = workbook.add_format({'align': 'right', 'font_size': '12x'})
format3 = workbook.add_format(
{'align': 'right', 'font_size': '12x', 'bold': True})
heading = workbook.add_format({'align': 'left', 'bold': True,
'font_size': '12px',
'valign': 'vcenter'})
date_format = workbook.add_format(
{'num_format': 'dd/mm/yy', 'align': 'left', 'font_size': '10px'})
sheet.merge_range('A2:B2', "Printed Date: " + date, date_format)
sheet.write('A4', 'No.', heading)
sheet.set_column(5, 1, 25)
sheet.set_row(0, 25)
row = 5
col = 0
index = 1
if user:
sheet.merge_range('A1:E1', 'COMMISSION PLAN REPORT', head)
sheet.write('D2', 'Date From: ' + data['date_from'], date_format)
sheet.write('E2', 'Date To: ' + data['date_to'], date_format)
sheet.write('B4', 'Sale Persons', heading)
sheet.write('C4', 'Commission Plan Name', heading)
sheet.write('D4', 'Total Revenue', heading)
sheet.write('E4', 'Commission Amount', heading)
for j in user_commission_salesperson:
sheet.write(row, col + 0, index, format2)
sheet.write(row, col + 1, j, format1)
row += 1
index += 1
row = 5
col = 0
for j in user_commission_name:
sheet.write(row, col + 2, j, format1)
row += 1
row = 5
col = 0
for j in total_list:
sheet.write(row, col + 3, round(j, 2), format2)
row += 1
row = 5
col = 0
for i in commission_list:
sheet.write(row, col + 4, round(i, 2), format2)
row += 1
sheet.write(row + 1, col + 2, 'Total', format3)
sheet.write(row + 1, col + 3, round(sum(total_list), 2), format2)
sheet.write(row + 1, col + 4, round(sum(commission_list), 2),
format2)
elif team:
sheet.merge_range('A1:F1', 'COMMISSION PLAN REPORT', head)
sheet.write('E2', 'Date From: ' + data['date_from'], date_format)
sheet.write('F2', 'Date To: ' + data['date_to'], date_format)
sheet.write('B4', 'Sales Teams', heading)
sheet.write('C4', 'Sales Person', heading)
sheet.write('D4', 'Commission Plan Name', heading)
sheet.write('E4', 'Total Revenue', heading)
sheet.write('F4', 'Commission Amount', heading)
for j in commission_sales_team:
sheet.write(row, col + 0, index, format2)
sheet.write(row, col + 1, j, format1)
row += 1
index += 1
row = 5
col = 0
for j in commission_salesperson:
sheet.write(row, col + 2, j, format1)
row += 1
row = 5
col = 0
for j in commission_name:
sheet.write(row, col + 3, j, format1)
row += 1
row = 5
col = 0
for j in commission_total:
sheet.write(row, col + 4, round(j, 2), format2)
row += 1
row = 5
col = 0
for i in commission:
sheet.write(row, col + 5, round(i, 2), format2)
row += 1
sheet.write(row + 1, col + 3, 'Total:', format3)
sheet.write(row + 1, col + 4, round(sum(commission_total), 2),
format2)
sheet.write(row + 1, col + 5, round(sum(commission), 2), format2)
workbook.close()
output.seek(0)
response.stream.write(output.read())
output.close()

48
commission_plan/wizard/commission_report.xml

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="commission_wizard" model="ir.ui.view">
<field name="name">commission.wizard.form</field>
<field name="model">commission.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="date_from" required="1"/>
<field name="date_to" required="1"/>
</group>
<group>
<field name="is_sales_person" attrs="{'invisible':True}"/>
<field name="is_sales_team" attrs="{'invisible':True}"/>
<field name="sales_team_ids" widget="many2many_tags" options="{'no_create': True}"
attrs="{'invisible':[('is_sales_person', '=', True)]}"/>
<field name="salesperson_ids" widget="many2many_tags" options="{'no_create': True}"
attrs="{'invisible': [('is_sales_team', '=', True)]}"/>
</group>
</group>
</sheet>
<footer>
<button name="print_xls_report" string="Print XLS"
type="object" class="oe_highlight"/>
<button string="Cancel" class="btn btn_default"
special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="commission_reporting_action" model="ir.actions.act_window">
<field name="name">Commission Report</field>
<field name="res_model">commission.wizard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="commission_wizard"/>
<field name="target">new</field>
</record>
<menuitem id="commission_excel_report_root"
name="Commission Report "
parent="crm.crm_menu_report"
action="commission_reporting_action"
sequence="4"/>
</odoo>
Loading…
Cancel
Save