Browse Source

Dec 26 : [ADD] Initial Commit 'pivot_conditional_formatting'

pull/299/head
RisvanaCybro 1 year ago
parent
commit
e48ccca4d5
  1. 48
      pivot_conditional_formatting/README.rst
  2. 23
      pivot_conditional_formatting/__init__.py
  3. 56
      pivot_conditional_formatting/__manifest__.py
  4. 6
      pivot_conditional_formatting/doc/RELEASE_NOTES.md
  5. 23
      pivot_conditional_formatting/models/__init__.py
  6. 91
      pivot_conditional_formatting/models/pivot_conditional_settings.py
  7. 5
      pivot_conditional_formatting/security/ir.model.access.csv
  8. 8
      pivot_conditional_formatting/security/pivot_conditional_formatting_groups.xml
  9. 15
      pivot_conditional_formatting/security/pivot_conditional_settings_security.xml
  10. BIN
      pivot_conditional_formatting/static/description/assets/icons/check.png
  11. BIN
      pivot_conditional_formatting/static/description/assets/icons/chevron.png
  12. BIN
      pivot_conditional_formatting/static/description/assets/icons/cogs.png
  13. BIN
      pivot_conditional_formatting/static/description/assets/icons/consultation.png
  14. BIN
      pivot_conditional_formatting/static/description/assets/icons/ecom-black.png
  15. BIN
      pivot_conditional_formatting/static/description/assets/icons/education-black.png
  16. BIN
      pivot_conditional_formatting/static/description/assets/icons/hotel-black.png
  17. BIN
      pivot_conditional_formatting/static/description/assets/icons/license.png
  18. BIN
      pivot_conditional_formatting/static/description/assets/icons/lifebuoy.png
  19. BIN
      pivot_conditional_formatting/static/description/assets/icons/logo.png
  20. BIN
      pivot_conditional_formatting/static/description/assets/icons/manufacturing-black.png
  21. BIN
      pivot_conditional_formatting/static/description/assets/icons/pos-black.png
  22. BIN
      pivot_conditional_formatting/static/description/assets/icons/puzzle.png
  23. BIN
      pivot_conditional_formatting/static/description/assets/icons/restaurant-black.png
  24. BIN
      pivot_conditional_formatting/static/description/assets/icons/service-black.png
  25. BIN
      pivot_conditional_formatting/static/description/assets/icons/trading-black.png
  26. BIN
      pivot_conditional_formatting/static/description/assets/icons/training.png
  27. BIN
      pivot_conditional_formatting/static/description/assets/icons/update.png
  28. BIN
      pivot_conditional_formatting/static/description/assets/icons/user.png
  29. BIN
      pivot_conditional_formatting/static/description/assets/icons/wrench.png
  30. BIN
      pivot_conditional_formatting/static/description/assets/misc/categories.png
  31. BIN
      pivot_conditional_formatting/static/description/assets/misc/check-box.png
  32. BIN
      pivot_conditional_formatting/static/description/assets/misc/compass.png
  33. BIN
      pivot_conditional_formatting/static/description/assets/misc/corporate.png
  34. BIN
      pivot_conditional_formatting/static/description/assets/misc/customer-support.png
  35. BIN
      pivot_conditional_formatting/static/description/assets/misc/cybrosys-logo.png
  36. BIN
      pivot_conditional_formatting/static/description/assets/misc/features.png
  37. BIN
      pivot_conditional_formatting/static/description/assets/misc/logo.png
  38. BIN
      pivot_conditional_formatting/static/description/assets/misc/pictures.png
  39. BIN
      pivot_conditional_formatting/static/description/assets/misc/pie-chart.png
  40. BIN
      pivot_conditional_formatting/static/description/assets/misc/right-arrow.png
  41. BIN
      pivot_conditional_formatting/static/description/assets/misc/star.png
  42. BIN
      pivot_conditional_formatting/static/description/assets/misc/support.png
  43. BIN
      pivot_conditional_formatting/static/description/assets/misc/whatsapp.png
  44. BIN
      pivot_conditional_formatting/static/description/assets/modules/1.png
  45. BIN
      pivot_conditional_formatting/static/description/assets/modules/2.png
  46. BIN
      pivot_conditional_formatting/static/description/assets/modules/3.png
  47. BIN
      pivot_conditional_formatting/static/description/assets/modules/4.png
  48. BIN
      pivot_conditional_formatting/static/description/assets/modules/5.png
  49. BIN
      pivot_conditional_formatting/static/description/assets/modules/6.png
  50. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/hero.gif
  51. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/ss1.png
  52. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/ss2.png
  53. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/ss3.png
  54. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/ss4.png
  55. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/ss5.png
  56. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/ss6.png
  57. BIN
      pivot_conditional_formatting/static/description/assets/screenshots/ss7.png
  58. BIN
      pivot_conditional_formatting/static/description/banner.png
  59. BIN
      pivot_conditional_formatting/static/description/icon.png
  60. BIN
      pivot_conditional_formatting/static/description/images/checked.png
  61. BIN
      pivot_conditional_formatting/static/description/images/cybrosys.png
  62. 585
      pivot_conditional_formatting/static/description/index.html
  63. 107
      pivot_conditional_formatting/static/src/css/pivot_conditional_formatting.css
  64. 252
      pivot_conditional_formatting/static/src/js/pivot_conditional_formatting.js
  65. 85
      pivot_conditional_formatting/static/src/xml/pivot_conditional_formatting.xml
  66. 101
      pivot_conditional_formatting/views/pivot_conditional_settings_views.xml

48
pivot_conditional_formatting/README.rst

@ -0,0 +1,48 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Conditional Formatting in Pivot View
====================================
This module helps you to setup conditional formatting in the pivot view of a
model.
Configuration
=============
* No additional configurations needed
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
License
-------
General Public License, Version 3 (AGPL v3).
(http://www.gnu.org/licenses/agpl-3.0-standalone.html)
Credits
-------
* Developers: (V16) Muhammed Rishad
* Contact: odoo@cybrosys.com
Contacts
--------
* Mail Contact : odoo@cybrosys.com
* Website : https://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
==========
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com
This module is maintained by Cybrosys Technologies.
For support and more information, please visit `Our Website <https://cybrosys.com/>`__
Further information
===================
HTML Description: `<static/description/index.html>`__

23
pivot_conditional_formatting/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-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 (AGPL 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
"""init file"""
from . import models

56
pivot_conditional_formatting/__manifest__.py

@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-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 (AGPL 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
# """manifest"""
{
"name": "Conditional Formatting in Pivot View",
"version": "16.0.1.0.0",
"category": "Extra Tools",
"summary": "This Module allows to setup conditional formatting in "
"the pivot view of models",
"description": "The module is used for using conditional formatting option"
"in the pivot view of different models, you can setup"
" default formatting rules in the settings or add new rules"
" from the UI.",
"author": "Cybrosys Techno Solutions",
"company": "Cybrosys Techno Solutions",
"maintainer": "Cybrosys Techno Solutions",
"website": "https://www.cybrosys.com",
"depends": ["base", "web"],
"data": [
"security/pivot_conditional_formatting_groups.xml",
"security/pivot_conditional_settings_security.xml",
"security/ir.model.access.csv",
"views/pivot_conditional_settings_views.xml",
],
"assets": {
"web.assets_backend": [
"pivot_conditional_formatting/static/src/xml/pivot_conditional_formatting.xml",
"pivot_conditional_formatting/static/src/css/pivot_conditional_formatting.css",
"pivot_conditional_formatting/static/src/js/pivot_conditional_formatting.js",
],
},
"images": ["static/description/banner.png"],
"license": "AGPL-3",
"installable": True,
"auto_install": False,
"application": False,
}

6
pivot_conditional_formatting/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <pivot_conditional_formatting>
#### 20.11.2023
#### Version 16.0.1.0.0
#### ADD
- Initial Commit for Conditional Formatting in Pivot View

23
pivot_conditional_formatting/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-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 (AGPL 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
"""init file"""
from . import pivot_conditional_settings

91
pivot_conditional_formatting/models/pivot_conditional_settings.py

@ -0,0 +1,91 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2023-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 (AGPL 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
"""Models for setting conditional formatting rules in settings"""
from odoo import api, fields, models
class PivotConditionalSetting(models.Model):
"""Model Class for choosing the model and view to set the default rules"""
_name = 'pivot.conditional.settings'
_description = 'Pivot conditional setting'
_rec_name = "model_id"
model_id = fields.Many2one('ir.model', help="The model to set the rules "
"for", string="Model")
view_id = fields.Many2one('ir.ui.view', help="Pivot view of the model",
string="View")
rules_ids = fields.One2many('conditional.rules', 'conditional_id',
help="List View Showing details of different"
" rules", string="Rules")
company_id = fields.Many2one('res.company', string='Company',
default=lambda self: self.env.company,
help="Company id related to the "
"Pivot Condition setting")
@api.onchange('model_id')
def _onchange_model_id(self):
"""
This method is called when the 'model_id' field is changed. It
updates the domain of the 'view_id' field to filter records based
on the selected model and view type as 'pivot'.
:return: Dictionary containing the updated domain for the 'view_id'
field.
:rtype: dict
"""
return {'domain': {'view_id': [('model', '=', self.model_id.model),
('type', '=', 'pivot')]}}
class ConditionalRules(models.Model):
"""Model Class for the different Pivot view table, conditional formatting
rules"""
_name = 'conditional.rules'
_description = 'Conditional formatting'
_rec_name = "rule"
rule = fields.Selection(string='Rule', selection=([
('greater_than', 'Greater than'), ('less_than', 'Less Than'),
('is_empty', 'Is Empty'), ('in_between', 'In Between')]),
help="Different conditions for rules")
value = fields.Float(string='Value', help="Value for comparing the rule")
second_value = fields.Float(string='Second Value', help="Second Value for "
"comparing the "
"inbetween rule")
color = fields.Char(string='Color', required=True, help="Background "
"Color For the "
"Cells")
text_color = fields.Char(string='Text Color',
required=True, help="Text "
"Color for the cells")
model_id = fields.Many2one('ir.model', related='conditional_id.model_id',
help="model related to the rule",
string="Model")
view_id = fields.Many2one('ir.ui.view', related='conditional_id.view_id',
help="view related to the rule", string="View")
conditional_id = fields.Many2one('pivot.conditional.settings',
help="Pivot Condition setting related to"
" the rule", string="Condition")
company_id = fields.Many2one('res.company', string='Company',
default=lambda self: self.env.company,
help="Company id related to rule")

5
pivot_conditional_formatting/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_conditional_rules_user,access.conditional.rules,model_conditional_rules,pivot_conditional_formatting.pivot_conditional_settings_group_user,1,1,1,1
access_conditional_rules_reader,access.conditional.rules,model_conditional_rules,base.group_user,1,0,0,0
access_pivot_conditional_settings_user,access.pivot.conditional.settings,model_pivot_conditional_settings,pivot_conditional_formatting.pivot_conditional_settings_group_user,1,1,1,1
access_pivot_conditional_settings_reader,access.pivot.conditional.settings,model_pivot_conditional_settings,base.group_user,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_conditional_rules_user access.conditional.rules model_conditional_rules pivot_conditional_formatting.pivot_conditional_settings_group_user 1 1 1 1
3 access_conditional_rules_reader access.conditional.rules model_conditional_rules base.group_user 1 0 0 0
4 access_pivot_conditional_settings_user access.pivot.conditional.settings model_pivot_conditional_settings pivot_conditional_formatting.pivot_conditional_settings_group_user 1 1 1 1
5 access_pivot_conditional_settings_reader access.pivot.conditional.settings model_pivot_conditional_settings base.group_user 1 0 0 0

8
pivot_conditional_formatting/security/pivot_conditional_formatting_groups.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Groups for Pivot Conditional Rules -->
<record id="pivot_conditional_settings_group_user" model="res.groups">
<field name="name">Allow to Set Pivot Conditional Rules</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
</odoo>

15
pivot_conditional_formatting/security/pivot_conditional_settings_security.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Multi Company Rule for pivot.conditional.settings Model -->
<record id="pivot_conditional_settings_rule_multi_company" model="ir.rule" >
<field name="name">Pivot Conditional Formatting Rule</field>
<field name="model_id" ref="model_pivot_conditional_settings"/>
<field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
</record>
<!-- Multi Company Rule for conditional Rules Model -->
<record id="conditional_rules_rule_multi_company" model="ir.rule">
<field name="name">Pivot Conditional Formatting Rule2</field>
<field name="model_id" ref="model_conditional_rules"/>
<field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
</record>
</odoo>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/categories.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/check-box.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/compass.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/corporate.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/customer-support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/cybrosys-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/features.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
pivot_conditional_formatting/static/description/assets/misc/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/pictures.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/pie-chart.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/right-arrow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 B

BIN
pivot_conditional_formatting/static/description/assets/misc/star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/support.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
pivot_conditional_formatting/static/description/assets/misc/whatsapp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
pivot_conditional_formatting/static/description/assets/modules/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
pivot_conditional_formatting/static/description/assets/modules/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
pivot_conditional_formatting/static/description/assets/modules/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
pivot_conditional_formatting/static/description/assets/modules/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
pivot_conditional_formatting/static/description/assets/modules/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
pivot_conditional_formatting/static/description/assets/modules/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

BIN
pivot_conditional_formatting/static/description/assets/screenshots/ss1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
pivot_conditional_formatting/static/description/assets/screenshots/ss2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
pivot_conditional_formatting/static/description/assets/screenshots/ss3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
pivot_conditional_formatting/static/description/assets/screenshots/ss4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
pivot_conditional_formatting/static/description/assets/screenshots/ss5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
pivot_conditional_formatting/static/description/assets/screenshots/ss6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

BIN
pivot_conditional_formatting/static/description/assets/screenshots/ss7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
pivot_conditional_formatting/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
pivot_conditional_formatting/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
pivot_conditional_formatting/static/description/images/checked.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
pivot_conditional_formatting/static/description/images/cybrosys.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

585
pivot_conditional_formatting/static/description/index.html

@ -0,0 +1,585 @@
<div style="background-color: #714B67; height: 810px; width: 100%; padding: 15px; position: relative;">
<!-- TITLE BAR -->
<div class="d-flex align-items-center justify-content-between"
style="border-bottom: 1px solid #875A7B; padding: 15px; display: flex; justify-content: space-between; align-items: center;">
<img src="assets/misc/cybrosys-logo.png" width="42" height="42" style="width: 42px; height: 42px;" />
<div>
<div style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" class="mr-2">
<i class="fa fa-check mr-1"></i>Community
</div>
<div style="color: #7C7BAD; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" class="mr-2">
<i class="fa fa-check mr-1"></i>Enterprise
</div>
<div style="color: #017E84; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: bold; background-color: white; display: inline-block; padding: 3px 10px; border-radius: 50px;" class="mr-2">
<i class="fa fa-check mr-1"></i>Odoo.sh
</div>
</div>
</div>
<div class="container" style="padding: 4rem 1.5rem !important">
<div class="row" style="height: 900px !important;">
<div class="col-sm-12 col-md-12 col-lg-12" style="padding: 4rem 1rem !important; background-color: #714B67 !important; height: 600px !important; border-radius: 20px !important;">
<h1 style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #FFFFFF !important; font-size: 3.5rem !important; text-align: center !important;">
Conditional Formatting in Pivot View</h1>
<p style="font-family: 'Montserrat', sans-serif !important; font-weight: 300 !important; color: #FFFFFF !important; font-size: 1.4rem !important; text-align: center !important;">
Conditional Formatting in pivot view according to different rules.
</p>
<img src="assets/screenshots/hero.gif" class="img-responsive" width="100%" height="auto" />
</div>
</div>
<div class="row">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin-bottom: 2rem !important">
<h2 style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-compass mr-2"></i>Explore this module
</h2>
</div>
<div class="col-md-6">
<a href="#overview" style="text-decoration: none !important;">
<div class="row" style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Overview</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
Learn more about this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#features" style="text-decoration: none !important;">
<div class="row" style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3 style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">Features</h3>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">View features of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
<div class="col-md-6">
<a href="#screenshots" style="text-decoration: none !important;">
<div class="row"
style="background-color: #f5f2f5 !important; border-radius: 10px !important; margin: 1rem !important; padding: 1.5em !important; height: 100px !important;">
<div class="col-8">
<h3
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.2rem !important;">
Screenshots</h3>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #714B67 !important; font-size: 0.9rem !important;">
See key screenshots of this module</p>
</div>
<div class="col-4 text-right d-flex justify-content-end align-items-center">
<i class="fa fa-chevron-right" style="color: #714B67 !important;"></i>
</div>
</div>
</a>
</div>
</div>
<div class="row" id="overview">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2 style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-pie-chart mr-2"></i>Overview
</h2>
</div>
<div class="col-mg-12 pl-3">
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
This module helps to setup predefined rules for conditional
formatting in pivot view for specific models.</p>
</div>
</div>
<div class="row" id="features">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2
style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-star mr-2"></i>Features
</h2>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4 style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">Community &amp; Enterprise support.</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4 style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Showcase difference between cells, according to the
rules.
</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4 style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Predefinable default rules for specific models and
views.
</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4 style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Select cells and add rules dynamically.
</h4>
</div>
</div>
<div class="col-md-6 pl-3 py-3 d-flex">
<div>
<img src="assets/icons/check.png">
</div>
<div>
<h4 style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Define background and text colors for the cells.
</h4>
</div>
</div>
</div>
<div class="row" id="screenshots">
<div class="col-md-12" style="border-bottom: 1px solid #d5d5d5 !important; margin: 2rem 0 !important">
<h2 style="font-family: 'Montserrat', sans-serif !important; font-weight: 600 !important; color: #714B67 !important; font-size: 1.5rem !important;">
<i class="fa fa-image mr-2"></i>Screenshots
</h2>
</div>
<div class="col-lg-12 my-2">
<h4 class="mt-2" style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Enable option for setting conditional rules on pivot views
</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Go to Settings -> Users & Companies -> Users ->
under "Technical" section in your user, enable "Allow to
Set Pivot Conditional Rules option".
</p>
<img src="assets/screenshots/ss1.png"
class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
<div class="col-lg-12 my-2">
<h4 class="mt-2" style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Setup default rules for models
</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Go to Settings -> Pivot Settings -> Create new rules in this
menu. Choose the Model and its Pivot View, then establish the
Rules in the table below based on different rule Conditions.
Set the Value, Background color for the cells and Text
color for the cells.
</p>
<img src="assets/screenshots/ss2.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
<img src="assets/screenshots/ss3.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
<div class="col-lg-12 my-2">
<h4 class="mt-2" style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Setup rules from the pivot view
</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
When you go to a pivot view with Default Rules,
You will see the changes in the pivot according to the Default Rules.
Drag along the pivot cells to select the cells you want to apply
the rules on.
</p>
<img src="assets/screenshots/ss4.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
<img src="assets/screenshots/ss5.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
<div class="col-lg-12 my-2">
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important;">
Click on the Conditional Formatting button for setting the Rule,
then select the Condition and enter the Value to base the condition
on, choose the Background color and Text color and click the Save
button to apply the rule.
</p>
<img src="assets/screenshots/ss6.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
<img src="assets/screenshots/ss7.png" class="img-responsive img-thumbnail border" width="100%"
height="auto" />
</div>
</div>
<!-- RELATED PRODUCTS -->
<div class="d-flex align-items-center" style="border-bottom: 2px solid #714B67; padding: 15px 0px;">
<div class="d-flex justify-content-center align-items-center mr-2"
style="background-color: #F5F5F5; border-radius: 0px; width: 40px; height: 40px;">
<img src="assets/misc/categories.png" />
</div>
<h2 class="mt-2" style="font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: bold;">
Related Products
</h2>
</div>
<div class="row">
<div class="col-sm-12">
<div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow -->
<div class="carousel-inner" style="padding: 30px;">
<div class="carousel-item" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/todo_list/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/1.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/16.0/multi_branch_base/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/2.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/16.0/odoo_dynamic_dashboard/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/3.png">
</div>
</a>
</div>
</div>
<div class="carousel-item active" style="min-height: 198.656px;">
<div class="col-xs-12 col-sm-4 col-md-4 mb16 mt16" style="float:left">
<a href="https://apps.odoo.com/apps/modules/16.0/hide_menu_user/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/4.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/16.0/readonly_unit_price_cybrosys/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/5.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/16.0/activity_dashboard_mngmnt/" target="_blank">
<div style="border-radius:10px">
<img class="img img-responsive center-block" style="border-radius: 0px;" src="assets/modules/6.png">
</div>
</a>
</div>
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev" style="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="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 RELATED PRODUCTS -->
<!-- OUR SERVICES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Services</h2>
<hr style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !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>
<!-- OUR INDUSTRIES -->
<section class="container" style="margin-top: 6rem !important;">
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Industries</h2>
<hr style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !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 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 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Need Help?</h2>
<hr style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !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-4">
<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-4">
<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>WhatsApp
</a>
</div>
<div class="col-lg-4">
<a href="mailto:info@cybrosys.com" target="_blank" class="btn btn-block deep_hover"
style="text-decoration: none; background-color: #4d4d4d; color: #FFF; border-radius: 4px;"><i class="fa fa-envelope mr-2"></i>
info@cybrosys.com
</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>
</div>

107
pivot_conditional_formatting/static/src/css/pivot_conditional_formatting.css

@ -0,0 +1,107 @@
.selected_cell{
border: 4px solid red !important;
opacity: 0.75;
}
.prevent-select {
-webkit-user-select: none; /* Safari */
-ms-user-select: none; /* IE 10 and IE 11 */
user-select: none; /* Standard syntax */
}
.conditional_container{
display: flex;
width: 30vw;
min-height:20vh;
background: #e3eaf0;
position: relative;
padding: 5px;
margin-top: 1vh;
box-shadow: 3px 3px 5px 0px rgb(0 0 0 / 32%);
margin-left: 1vw;
margin-bottom: 1vh;
border-radius: 5px;
}
.sub_container1{
height: 100%;
background: #e3eaf0;
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: column;
width: 100%;
}
.condition_select{
width: 30%;
background: #71639e;
color: black;
font-weight: 500;
margin: 3%;
text-align: center;
padding: 1%;
border-radius: 4px;
}
.condition_val{
width: 61%;
height: 29px;
margin: 2%;
border: 2px solid #71639e;
border-radius: 4px;
}
.condition_button{
border: none;
background: #8b93d2;
margin: 4% 0;
padding: 1% 6%;
border-radius: 3px;
font-size: 16px;
}
.condition_button:hover{
background: #5b64ad;
}
.rule_container{
background: #e3eaf0;
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: column;
height: 100px;
border: 1px solid black;
}
.input_container{
display:flex;
}
.sub_input_container{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
color: black;
}
.sub_color_container{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding: 0px 30px;
color: black;
}
.color_container{
display: flex;
}
.color-input{
width: 34px;
height: 32px;
border: none;
outline: none;
}
.validation-error{
display: none;
color: red;
}

252
pivot_conditional_formatting/static/src/js/pivot_conditional_formatting.js

@ -0,0 +1,252 @@
/** @odoo-module **/
import { PivotRenderer } from "@web/views/pivot/pivot_renderer";
import { PivotController } from "@web/views/pivot/pivot_controller";
import { useService } from "@web/core/utils/hooks";
import { patch } from '@web/core/utils/patch';
const { useExternalListener, useEffect } = owl;
patch(PivotRenderer.prototype,'pivot_render.patch',{
setup() {
this._super.apply();
this.orm = useService("orm");
this.isMouseDown = false;
this.startRowIndex = null;
this.startCellIndex = null;
useExternalListener(document, 'mouseup', this.mouse_up_function)
useEffect(() => {
this.set_default_rules()
})
},
async set_default_rules(){
// function for default rules to be applied on the pivot table
var self = this
var viewId = this.env.config.viewId
var model = this.env.searchModel.resModel
await this.orm.call("conditional.rules","search_read", [],{
domain: [['model_id','=',model],['view_id','=',viewId]],
}).then(function(res){
self.conditional_rules = res
})
var cells = this.__owl__.bdom.el.querySelectorAll('td')
cells.forEach(function(data){
data.style.backgroundColor = "#f8f9fa"
data.style.color = "black"
})
$(this.__owl__.bdom.el.querySelectorAll(
'.o_pivot.table-responsive table')).find(
".selected_cell").removeClass("selected_cell");
$(this.__owl__.bdom.parentEl.parentElement).find(
'.conditional_button').css({display:"none"})
$(this.__owl__.bdom.parentEl.parentElement).find(
'.conditional_container').css({display:"none"})
for (let i = 0, len = this.conditional_rules.length; i < len; i++){
var condition = this.conditional_rules[i].rule
var condition_val = this.conditional_rules[i].value
var second_condition_val = this.conditional_rules[i].second_value
var color_val = this.conditional_rules[i].color
var text_color_val = this.conditional_rules[i].text_color
for (let j = 0, len = cells.length; j < len; j++){
var cell_val = cells[j].innerText
if(cell_val){
cell_val = cell_val.replace(',','')
}
if(condition == 'less_than'){
if(parseFloat(condition_val)>parseFloat(cell_val)){
cells[j].classList.remove("bg-100")
cells[j].style.backgroundColor = color_val
cells[j].style.color = text_color_val
}
}
if(condition == "greater_than"){
if(parseFloat(condition_val)< parseFloat(cell_val)){
cells[j].classList.remove("bg-100")
cells[j].style.backgroundColor = color_val
cells[j].style.color = text_color_val
}
}
if(condition == "is_empty"){
if(cells[j].innerText == ""){
cells[j].classList.remove("bg-100")
cells[j].style.backgroundColor = color_val
cells[j].style.color = text_color_val
}
}
if(condition == "in_between"){
if(parseFloat(cell_val)> parseFloat(condition_val) && parseFloat(cell_val)< parseFloat(second_condition_val)){
cells[j].classList.remove("bg-100")
cells[j].style.backgroundColor = color_val
cells[j].style.color = text_color_val
}
}
}
}
},
conditional_formattoo(e){
// function for selecting table columns and adding and removing
// classes
if (e.target.localName == 'td' || e.target.className == 'o_value'){
this.isMouseDown = true;
var cell;
if(e.target.className == 'o_value'){
cell = e.target.parentElement;
}else{
cell = e.target
}
$(this.__owl__.bdom.el.querySelectorAll(
'.o_pivot.table-responsive table')).find(".selected_cell"
).removeClass("selected_cell"); // deselect everything
cell.className = 'selected_cell prevent-select'
this.startCellIndex = cell.cellIndex;
this.startRowIndex = cell.parentElement.cellIndex;
return false;
}
},
mouse_over_function(e){
// function for selecting table columns
if (!this.isMouseDown) return;
if (e.target.localName == 'td' || e.target.className == 'o_value'){
var cell = e.target.parentElement;
if(e.target.className == 'o_value'){
cell = e.target.parentElement;
}else{
cell = e.target
}
cell.classList.add("selected_cell")
$(this.__owl__.bdom.parentEl.parentElement).find(
'.conditional_button').css({display:'block'})
}
},
mouse_up_function(){
// function for changing variable value to stop table cell selection
this.isMouseDown = false;
},
display_field(){
// function for hiding and showing input fields inside popup window
var condition = $(this.__owl__.bdom.el.querySelectorAll(
'.condition_select')).val()
if(this.__owl__.bdom.el.querySelectorAll(
'.validation-error')[0].style.display == "inline"){
this.__owl__.bdom.el.querySelectorAll(
'.validation-error')[0].style.display = "none";
}
$(this.__owl__.bdom.el.querySelectorAll(
'#condition_val'))[0].value = ''
$(this.__owl__.bdom.el.querySelectorAll(
'#secondcondition_val'))[0].value = ''
if(condition == 'in between'){
$(this.__owl__.bdom.el.querySelectorAll(
'#secondcondition_val')).css({display:'block'})
$(this.__owl__.bdom.el.querySelectorAll(
'#value_label')).css({display:'block'})
$(this.__owl__.bdom.el.querySelectorAll(
'#sub_input_container2')).css({display:'flex'})
}else{
$(this.__owl__.bdom.el.querySelectorAll(
'#secondcondition_val')).css({display:'none'})
$(this.__owl__.bdom.el.querySelectorAll(
'#value_label')).css({display:'none'})
$(this.__owl__.bdom.el.querySelectorAll(
'#sub_input_container2')).css({display:'none'})
}
if(condition === 'null'){
$(this.__owl__.bdom.el.querySelectorAll(
'#condition_val')).css({display:'none'})
$(this.__owl__.bdom.el.querySelectorAll(
'#value_label1')).css({display:'none'})
$(this.__owl__.bdom.el.querySelectorAll(
'#sub_input_container1')).css({display:'none'})
}else{
$(this.__owl__.bdom.el.querySelectorAll(
'#condition_val')).css({display:'block'})
$(this.__owl__.bdom.el.querySelectorAll(
'#value_label1')).css({display:'block'})
$(this.__owl__.bdom.el.querySelectorAll(
'#sub_input_container1')).css({display:'flex'})
}
},
set_rule(){
// function for applying rules through popup window
var condition = $(this.__owl__.bdom.el.querySelectorAll(
'.condition_select')).val()
var color_val = $(this.__owl__.bdom.el.querySelectorAll(
'.colorpicker')).val()
var text_color_val = $(this.__owl__.bdom.el.querySelectorAll(
'.text_color')).val()
var cells = $(this.__owl__.bdom.el.querySelectorAll(
'.selected_cell'))
var condition_val = $(this.__owl__.bdom.el.querySelectorAll(
'#condition_val')).val()
var second_condition_val = $(this.__owl__.bdom.el.querySelectorAll(
'#secondcondition_val')).val()
this.__owl__.bdom.el.querySelectorAll(
'#condition_val')[0].value = ''
this.__owl__.bdom.el.querySelectorAll(
'#secondcondition_val')[0].value = ''
if(condition == 'in between'){
if(condition_val > second_condition_val){
$(this.__owl__.bdom.el.querySelectorAll(
'.validation-error')).css({display:'inline'})
return
}
}
for (let i = 0, len = cells.length; i < len; i++){
var cell_val = cells[i].innerText
if(cell_val){
cell_val = cell_val.replace(',','')
}
if(condition == 'less than'){
if(parseFloat(condition_val)>parseFloat(cell_val)){
cells[i].classList.remove("bg-100")
cells[i].style.backgroundColor = color_val
cells[i].style.color = text_color_val
}
}
if(condition == 'greater than'){
if(parseFloat(condition_val)< parseFloat(cell_val)){
cells[i].classList.remove("bg-100")
cells[i].style.backgroundColor = color_val
cells[i].style.color = text_color_val
}
}
if(condition == "null"){
if(cells[i].innerText == ""){
cells[i].classList.remove("bg-100")
cells[i].classList.remove("bg-100")
cells[i].style.backgroundColor = color_val
cells[i].style.color = text_color_val
}
}
if(condition == 'in between'){
if(parseFloat(cell_val)> parseFloat(condition_val) && parseFloat(cell_val)< parseFloat(second_condition_val)){
cells[i].classList.remove("bg-100")
cells[i].style.backgroundColor = color_val
cells[i].style.color = text_color_val
}
}
}
},
});
patch(PivotController.prototype, 'PivotController.Patch', {
conditional_format_tab(){
// This function is called to display the conditional formatting
// window/wizard in the UI.
$(this.__owl__.bdom.el.querySelectorAll(".conditional_container")).css({display:"block"})
this.__owl__.bdom.el.querySelectorAll("#condition_val")[0].value = ''
this.__owl__.bdom.el.querySelectorAll("#secondcondition_val")[0].value = ''
if(this.__owl__.bdom.el.querySelectorAll(
'.validation-error')[0].style.display == "inline"){
this.__owl__.bdom.el.querySelectorAll(
'.validation-error')[0].style.display = "none";
}
},
});

85
pivot_conditional_formatting/static/src/xml/pivot_conditional_formatting.xml

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--XML Template for Pivot Conditional Formatting
This XML code represents a template for implementing conditional formatting functionality in a pivot view. It defines a set of elements and attributes that can be used to create a user interface for setting conditional formatting rules in a pivot table.
The template includes options for selecting the type of condition (e.g., "greater than," "less than"), entering the condition values, selecting colors for highlighting, and saving the formatting rule.
Usage:
1. Include this XML template in the appropriate location in your application's codebase.
2. Customize the template as needed to match the desired user interface and functionality.
3. Use the defined elements and attributes to implement the conditional formatting feature in your pivot view.
Note: This code is a template and may require integration with the rest of your application's code to fully function. It provides a starting point for implementing conditional formatting but may need additional logic and event handlers to make it work seamlessly within your application.
-->
<templates id="template" xml:space="preserve">
<!-- PivotConditions template -->
<t t-name="pivot_conditional_formatting.PivotConditions"
t-inherit="web.PivotRenderer" t-inherit-mode="extension"
owl="1">
<xpath expr="//table" position="before">
<!-- Conditional formatting container -->
<div class="conditional_container" style="display:none">
<div class="sub_container1">
<!-- Dropdown for selecting condition -->
<select class="condition_select"
t-on-change="display_field">
<option value="greater than">Greater Than</option>
<option value="in between">In Between</option>
<option value="null">Is Empty</option>
<option value="less than">Less Than</option>
</select>
<div class="input_container">
<div class="sub_input_container"
id="sub_input_container1">
<label for="condition_val" id="value_label1">Value :</label>
<input type="number" class="condition_val"
id="condition_val"/>
</div>
<div class="sub_input_container"
id="sub_input_container2" style="display:none">
<label for="secondcondition_val" id="value_label"
style="display:none">Second Value :</label>
<input type="number" class="condition_val"
id="secondcondition_val"
style="display:none"/>
</div>
</div>
<span class="validation-error" >
First input should be greater than Second</span>
<div class="color_container">
<div class="sub_color_container">
<label for="colorpicker">Color :</label>
<input type="color" class="colorpicker color-input"
id="colorpicker"/>
</div>
<div class="sub_color_container">
<label for="text_color">Text-Color :</label>
<input type="color" class="text_color color-input"
id="text_color"/>
</div>
</div>
<!-- Button to save the conditional formatting rule -->
<button class="condition_button"
t-on-click="set_rule">save</button>
</div>
</div>
</xpath>
<xpath expr="//table" position="attributes">
<attribute name="t-on-mousedown">conditional_formattoo</attribute>
<attribute name="t-on-mouseover">mouse_over_function</attribute>
</xpath>
</t>
<!-- PivotConditionButton template -->
<t t-name="pivot_conditional_formatting.PivotConditionButton"
t-inherit="web.PivotView.Buttons" t-inherit-mode="extension"
owl="1">
<xpath expr="//div[hasclass('btn-group')]" position="after">
<!-- Conditional formatting button -->
<div class='conditional_button' style="display:none">
<button class='btn btn-primary'
t-on-click="conditional_format_tab">Conditional Formatting</button>
</div>
</xpath>
</t>
</templates>

101
pivot_conditional_formatting/views/pivot_conditional_settings_views.xml

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This XML configuration file defines views and menus for the Pivot Conditional module in Odoo. It includes view definitions for conditional rules and settings, as well as menu items to access the settings. The views are used to customize the appearance and behavior of pivot tables in Odoo.
-->
<odoo>
<!-- Form view for conditional.rules Model-->
<record id="conditional_rules_view_form" model="ir.ui.view">
<field name="name">conditional.rules.view.form</field>
<field name="model">conditional.rules</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="rule"/>
<field name="value"
attrs="{'invisible':[('rule','=','is_empty')]}"/>
<field name="second_value"
attrs="{'invisible':[('rule','!=','in_between')]}"/>
<field name="color" widget="color"/>
<field name="text_color" widget="color"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- Tree view for conditional.rules Model-->
<record id="conditional_rules_view_tree" model="ir.ui.view">
<field name="name">conditional.rule.view.tree</field>
<field name="model">conditional.rules</field>
<field name="arch" type="xml">
<tree>
<field name="rule"/>
<field name="value" required="True"
attrs="{'invisible':[('rule','=','is_empty')]}"/>
<field name="second_value"
attrs="{'invisible':[('rule','!=','in_between')]}"/>
<field name="color" widget="color"/>
<field name="text_color" widget="color"/>
</tree>
</field>
</record>
<!-- Tree view for pivot.conditional.settings Model-->
<record id="pivot_conditional_settings_view_tree" model="ir.ui.view">
<field name="name">pivot.conditional.settings.view.tree</field>
<field name="model">pivot.conditional.settings</field>
<field name="arch" type="xml">
<tree>
<field name="model_id"/>
<field name="view_id"/>
</tree>
</field>
</record>
<!-- Form view for pivot.conditional.settings Model-->
<record id="pivot_conditional_settings_view_form" model="ir.ui.view">
<field name="name">pivot.conditional.settings.view.form</field>
<field name="model">pivot.conditional.settings</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="model_id" required="True"/>
<field name="view_id" required="True"
attrs="{'invisible':[('model_id','=',False)]}"
options='{"no_open": True, "no_create": True}'/>
<field name="rules_ids">
<tree editable="bottom">
<field name="rule"/>
<field name="value"
attrs="{'invisible':[('rule','=','is_empty')]}"/>
<field name="second_value"
attrs="{'invisible':[('rule','!=','in_between')]}"/>
<field name="color" widget="color"
string="Cell Color"/>
<field name="text_color" widget="color"
string="Text Color"/>
</tree>
</field>
</group>
</sheet>
</form>
</field>
</record>
<!-- Action for pivot.conditional.settings Model-->
<record id="pivot_conditional_settings_action"
model="ir.actions.act_window">
<field name="name">Pivot Conditional Settings Action</field>
<field name="res_model">pivot.conditional.settings</field>
<field name="view_mode">tree,form</field>
</record>
<!-- Menu for pivot.conditional.settings Model-->
<menuitem id="pivot_conditional_settings_menu" name="Pivot Settings"
parent="base.menu_administration" sequence="1"/>
<menuitem id="pivot_conditional_settings_sub_menu" name="Settings"
parent="pivot_conditional_settings_menu"
action="pivot_conditional_settings_action"/>
</odoo>
Loading…
Cancel
Save