Browse Source

Merge pull request #1 from CybroOdoo/14.0

14.0
pull/218/head
Volodymyr Karabanov 2 years ago
committed by GitHub
parent
commit
42636a3641
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      base_accounting_kit/__manifest__.py
  2. 9
      base_accounting_kit/models/payment_matching.py
  3. 39
      duplicate_contact_details_alert/README.rst
  4. 23
      duplicate_contact_details_alert/__init__.py
  5. 41
      duplicate_contact_details_alert/__manifest__.py
  6. 6
      duplicate_contact_details_alert/doc/RELEASE_NOTES.md
  7. 24
      duplicate_contact_details_alert/models/__init__.py
  8. 66
      duplicate_contact_details_alert/models/res_config_settings.py
  9. 79
      duplicate_contact_details_alert/models/res_partner.py
  10. BIN
      duplicate_contact_details_alert/static/description/assets/icons/check.png
  11. BIN
      duplicate_contact_details_alert/static/description/assets/icons/chevron.png
  12. BIN
      duplicate_contact_details_alert/static/description/assets/icons/cogs.png
  13. BIN
      duplicate_contact_details_alert/static/description/assets/icons/consultation.png
  14. BIN
      duplicate_contact_details_alert/static/description/assets/icons/ecom-black.png
  15. BIN
      duplicate_contact_details_alert/static/description/assets/icons/education-black.png
  16. BIN
      duplicate_contact_details_alert/static/description/assets/icons/hotel-black.png
  17. BIN
      duplicate_contact_details_alert/static/description/assets/icons/license.png
  18. BIN
      duplicate_contact_details_alert/static/description/assets/icons/lifebuoy.png
  19. BIN
      duplicate_contact_details_alert/static/description/assets/icons/logo.png
  20. BIN
      duplicate_contact_details_alert/static/description/assets/icons/manufacturing-black.png
  21. BIN
      duplicate_contact_details_alert/static/description/assets/icons/pos-black.png
  22. BIN
      duplicate_contact_details_alert/static/description/assets/icons/puzzle.png
  23. BIN
      duplicate_contact_details_alert/static/description/assets/icons/restaurant-black.png
  24. BIN
      duplicate_contact_details_alert/static/description/assets/icons/service-black.png
  25. BIN
      duplicate_contact_details_alert/static/description/assets/icons/trading-black.png
  26. BIN
      duplicate_contact_details_alert/static/description/assets/icons/training.png
  27. BIN
      duplicate_contact_details_alert/static/description/assets/icons/update.png
  28. BIN
      duplicate_contact_details_alert/static/description/assets/icons/user.png
  29. BIN
      duplicate_contact_details_alert/static/description/assets/icons/wrench.png
  30. BIN
      duplicate_contact_details_alert/static/description/assets/modules/budget_image.png
  31. BIN
      duplicate_contact_details_alert/static/description/assets/modules/credit_image.png
  32. BIN
      duplicate_contact_details_alert/static/description/assets/modules/employee_image.png
  33. BIN
      duplicate_contact_details_alert/static/description/assets/modules/export_image.png
  34. BIN
      duplicate_contact_details_alert/static/description/assets/modules/gantt_image.png
  35. BIN
      duplicate_contact_details_alert/static/description/assets/modules/quotation_image.png
  36. BIN
      duplicate_contact_details_alert/static/description/assets/screenshots/dup_con1.png
  37. BIN
      duplicate_contact_details_alert/static/description/assets/screenshots/dup_con2.png
  38. BIN
      duplicate_contact_details_alert/static/description/assets/screenshots/hero.gif
  39. BIN
      duplicate_contact_details_alert/static/description/banner.png
  40. BIN
      duplicate_contact_details_alert/static/description/icon.png
  41. 559
      duplicate_contact_details_alert/static/description/index.html
  42. 39
      duplicate_contact_details_alert/views/res_config_settings_views.xml
  43. 41
      hide_cost_price/README.rst
  44. 22
      hide_cost_price/__init__.py
  45. 43
      hide_cost_price/__manifest__.py
  46. 6
      hide_cost_price/doc/RELEASE_NOTES.md
  47. 11
      hide_cost_price/security/view_cost_price.xml
  48. BIN
      hide_cost_price/static/description/assets/icons/chevron.png
  49. BIN
      hide_cost_price/static/description/assets/icons/cogs.png
  50. BIN
      hide_cost_price/static/description/assets/icons/consultation.png
  51. BIN
      hide_cost_price/static/description/assets/icons/ecom-black.png
  52. BIN
      hide_cost_price/static/description/assets/icons/education-black.png
  53. BIN
      hide_cost_price/static/description/assets/icons/hotel-black.png
  54. BIN
      hide_cost_price/static/description/assets/icons/license.png
  55. BIN
      hide_cost_price/static/description/assets/icons/lifebuoy.png
  56. BIN
      hide_cost_price/static/description/assets/icons/manufacturing-black.png
  57. BIN
      hide_cost_price/static/description/assets/icons/pos-black.png
  58. BIN
      hide_cost_price/static/description/assets/icons/puzzle.png
  59. BIN
      hide_cost_price/static/description/assets/icons/restaurant-black.png
  60. BIN
      hide_cost_price/static/description/assets/icons/service-black.png
  61. BIN
      hide_cost_price/static/description/assets/icons/trading-black.png
  62. BIN
      hide_cost_price/static/description/assets/icons/training.png
  63. BIN
      hide_cost_price/static/description/assets/icons/update.png
  64. BIN
      hide_cost_price/static/description/assets/icons/user.png
  65. BIN
      hide_cost_price/static/description/assets/icons/wrench.png
  66. BIN
      hide_cost_price/static/description/banner.png
  67. BIN
      hide_cost_price/static/description/icon.png
  68. BIN
      hide_cost_price/static/description/images/checked.png
  69. BIN
      hide_cost_price/static/description/images/hero.png
  70. BIN
      hide_cost_price/static/description/images/modules/approval_image.png
  71. BIN
      hide_cost_price/static/description/images/modules/dynamic_image.png
  72. BIN
      hide_cost_price/static/description/images/modules/mulitple-ref_image.png
  73. BIN
      hide_cost_price/static/description/images/modules/pos_image.png
  74. BIN
      hide_cost_price/static/description/images/modules/shopify_image.png
  75. BIN
      hide_cost_price/static/description/images/screen1.png
  76. BIN
      hide_cost_price/static/description/images/screen2.png
  77. BIN
      hide_cost_price/static/description/images/screen3.png
  78. 535
      hide_cost_price/static/description/index.html
  79. 60
      hide_cost_price/views/hide_product_cost.xml
  80. 2
      hide_menu_user/__manifest__.py
  81. 10
      hide_menu_user/models/res_user.py
  82. 2
      hr_payroll_dashboard/__manifest__.py
  83. 394
      hr_payroll_dashboard/models/employee.py
  84. 880
      hr_payroll_dashboard/static/src/js/hr_payroll_dashboard.js
  85. 22
      hr_payroll_dashboard/static/src/xml/payroll_dashboard.xml
  86. 44
      insta_feed_snippet/README.rst
  87. 2
      insta_feed_snippet/__init__.py
  88. 44
      insta_feed_snippet/__manifest__.py
  89. 1
      insta_feed_snippet/controllers/__init__.py
  90. 30
      insta_feed_snippet/controllers/main.py
  91. 7
      insta_feed_snippet/doc/RELEASE_NOTES.md
  92. 2
      insta_feed_snippet/models/__init__.py
  93. 27
      insta_feed_snippet/models/insta_post.py
  94. 81
      insta_feed_snippet/models/insta_profile.py
  95. 4
      insta_feed_snippet/security/ir.model.access.csv
  96. BIN
      insta_feed_snippet/static/description/assets/icons/check.png
  97. BIN
      insta_feed_snippet/static/description/assets/icons/chevron.png
  98. BIN
      insta_feed_snippet/static/description/assets/icons/cogs.png
  99. BIN
      insta_feed_snippet/static/description/assets/icons/consultation.png
  100. BIN
      insta_feed_snippet/static/description/assets/icons/ecom-black.png

2
base_accounting_kit/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Odoo 14 Full Accounting Kit', 'name': 'Odoo 14 Full Accounting Kit',
'version': '14.0.3.13.14', 'version': '14.0.3.13.16',
'category': 'Accounting', 'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs',
'summary': """ Asset and Budget Management, 'summary': """ Asset and Budget Management,

9
base_accounting_kit/models/payment_matching.py

@ -234,7 +234,6 @@ class AccountReconciliation(models.AbstractModel):
results = self.get_bank_statement_line_data(bank_statement_lines.ids) results = self.get_bank_statement_line_data(bank_statement_lines.ids)
bank_statement_lines_left = self.env['account.bank.statement.line'].browse([line['st_line']['id'] for line in results['lines']]) bank_statement_lines_left = self.env['account.bank.statement.line'].browse([line['st_line']['id'] for line in results['lines']])
bank_statements_left = bank_statement_lines_left.mapped('statement_id') bank_statements_left = bank_statement_lines_left.mapped('statement_id')
results.update({ results.update({
'statement_name': len(bank_statements_left) == 1 and bank_statements_left.name or False, 'statement_name': len(bank_statements_left) == 1 and bank_statements_left.name or False,
'journal_id': bank_statements and bank_statements[0].journal_id.id or False, 'journal_id': bank_statements and bank_statements[0].journal_id.id or False,
@ -253,7 +252,6 @@ class AccountReconciliation(models.AbstractModel):
'ids': results['reconciled_aml_ids'], 'ids': results['reconciled_aml_ids'],
} }
}) })
return results return results
@api.model @api.model
@ -731,10 +729,9 @@ class AccountReconciliation(models.AbstractModel):
amount_currency = amount amount_currency = amount
amount_currency_str = "" amount_currency_str = ""
amount_str = formatLang(self.env, abs(amount), currency_obj=st_line.currency_id or statement_currency) amount_str = formatLang(self.env, abs(amount), currency_obj=st_line.currency_id or statement_currency)
data = { data = {
'id': st_line.id, 'id': st_line.id,
'ref': st_line.ref, 'payment_ref': st_line.payment_ref,
'note': st_line.narration or "", 'note': st_line.narration or "",
'name': st_line.name, 'name': st_line.name,
'date': format_date(self.env, st_line.date), 'date': format_date(self.env, st_line.date),
@ -756,7 +753,6 @@ class AccountReconciliation(models.AbstractModel):
} }
if st_line.partner_id: if st_line.partner_id:
data['open_balance_account_id'] = amount > 0 and st_line.partner_id.property_account_receivable_id.id or st_line.partner_id.property_account_payable_id.id data['open_balance_account_id'] = amount > 0 and st_line.partner_id.property_account_receivable_id.id or st_line.partner_id.property_account_payable_id.id
return data return data
@api.model @api.model
@ -1129,9 +1125,8 @@ class AccountBankStatementLine(models.Model):
elif self.move_name: elif self.move_name:
raise UserError(_('Operation not allowed. Since your statement line already received a number (%s), you cannot reconcile it entirely with existing journal entries otherwise it would make a gap in the numbering. You should book an entry and make a regular revert of it in case you want to cancel it.')% (self.move_name)) raise UserError(_('Operation not allowed. Since your statement line already received a number (%s), you cannot reconcile it entirely with existing journal entries otherwise it would make a gap in the numbering. You should book an entry and make a regular revert of it in case you want to cancel it.')% (self.move_name))
# create the res.partner.bank if needed # create the res.partner.bank if needed
if self.account_number and self.partner_id and not self.bank_account_id: if self.account_number and self.partner_id and not self.statement_id:
# Search bank account without partner to handle the case the res.partner.bank already exists but is set # Search bank account without partner to handle the case the res.partner.bank already exists but is set
# on a different partner. # on a different partner.
self.partner_bank_id = self._find_or_create_bank_account() self.partner_bank_id = self._find_or_create_bank_account()

39
duplicate_contact_details_alert/README.rst

@ -0,0 +1,39 @@
Duplicate Contact Details Alert
===============================
* Duplicate Contact Details Alert module for Odoo 14.
Installation
============
- www.odoo.com/documentation/14.0/setup/install.html
- Install our custom addon
License
-------
General Public License, Version 3 (AGPL v3).
(https://www.odoo.com/documentation/user/14.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>`__

23
duplicate_contact_details_alert/__init__.py

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

41
duplicate_contact_details_alert/__manifest__.py

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2022-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': "Duplicate Contact Details Alert",
'version': '14.0.1.0.0',
'summary': """Duplicate Contact Details Alert""",
"category": 'Extra Tools',
'description': """Duplicate Contact Details Alert""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'depends': ['base', 'contacts'],
'data': [
'views/res_config_settings_views.xml',
],
'images': ['static/description/banner.png'],
'license': "LGPL-3",
'installable': True,
'application': False,
'auto_install': False,
}

6
duplicate_contact_details_alert/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <duplicate_contact_details_alert>
#### 24.10.2022
#### Version 14.0.1.0.0
#### ADD
- Initial commit for Duplicate Contact Details Alert Module

24
duplicate_contact_details_alert/models/__init__.py

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

66
duplicate_contact_details_alert/models/res_config_settings.py

@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2022-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 api, fields, models
from ast import literal_eval
class ResConfig(models.TransientModel):
_inherit = 'res.config.settings'
def _get_contacts_fields_domain(self):
return [
('model', '=', 'res.partner'), ('store', '=', True),
('ttype', 'in', ['binary', 'char'])]
is_unique_contact = fields.Boolean(string="Unique Contacts Alert")
unique_contact_ids = fields.Many2many(
'ir.model.fields', string='Contact Fields',
domain=_get_contacts_fields_domain,
help='Warning to avoid duplication of customer/vendor'
' details in the system')
def set_values(self):
super(ResConfig, self).set_values()
self.env['ir.config_parameter'].set_param(
'duplicate_contact_details_alert.is_unique_contact',
self.is_unique_contact)
self.env['ir.config_parameter'].set_param(
'duplicate_contact_details_alert.unique_contact_ids',
self.unique_contact_ids.ids)
@api.model
def get_values(self):
res = super(ResConfig, self).get_values()
params = self.env['ir.config_parameter'].sudo()
contact_field_ids = params.get_param(
'duplicate_contact_details_alert.unique_contact_ids')
if contact_field_ids:
res.update(
is_unique_contact=params.get_param(
'duplicate_contact_details_alert.is_unique_contact'),
unique_contact_ids=[(6, 0, literal_eval(contact_field_ids))],
)
return res
else:
return res

79
duplicate_contact_details_alert/models/res_partner.py

@ -0,0 +1,79 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2022-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 api, fields, models, _
from odoo.exceptions import UserError, ValidationError
import ast
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.model
def create(self, vals):
unique_contact_ids = self.env[
'ir.config_parameter'].sudo().get_param(
'duplicate_contact_details_alert.unique_contact_ids')
if unique_contact_ids:
fields_list = ast.literal_eval(unique_contact_ids)
for x in fields_list:
contact_fields = self.env['ir.model.fields'].browse(x)
field_vals = contact_fields.name
if vals.get(field_vals):
partner = self.env['res.partner'].search(
[(field_vals, '=', vals.get(field_vals))], limit=1)
if partner:
raise ValidationError(
_("The %s is already"
" used for contact %s.") %
(contact_fields.name, partner.name))
else:
res = super(ResPartner, self).create(vals)
return res
else:
res = super(ResPartner, self).create(vals)
return res
def write(self, vals):
unique_contact_ids = self.env[
'ir.config_parameter'].sudo().get_param(
'duplicate_contact_details_alert.unique_contact_ids')
if unique_contact_ids:
fields_list = ast.literal_eval(unique_contact_ids)
for x in fields_list:
contact_fields = self.env['ir.model.fields'].browse(x)
field_vals = contact_fields.name
if vals.get(field_vals):
partner = self.env['res.partner'].search(
[(field_vals, '=', vals.get(field_vals))], limit=1)
if partner:
raise ValidationError(
_("The %s is already"
" used for contact %s.") %
(contact_fields.name, partner.name))
else:
res = super(ResPartner, self).write(vals)
return res
else:
res = super(ResPartner, self).write(vals)
return res

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
duplicate_contact_details_alert/static/description/assets/modules/credit_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
duplicate_contact_details_alert/static/description/assets/modules/employee_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
duplicate_contact_details_alert/static/description/assets/modules/gantt_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
duplicate_contact_details_alert/static/description/assets/modules/quotation_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
duplicate_contact_details_alert/static/description/assets/screenshots/dup_con1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

BIN
duplicate_contact_details_alert/static/description/assets/screenshots/dup_con2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
duplicate_contact_details_alert/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
duplicate_contact_details_alert/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

559
duplicate_contact_details_alert/static/description/index.html

@ -0,0 +1,559 @@
<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>
</div>
</div>
</div>
<div class="container" style="padding: 0rem 1.5rem 4rem !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;">
Duplicate Contact Alert</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;">
Duplicate contact alert module helps to detect duplicate contact values.
</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 class="row">
<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>
</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;">
The Duplicate contact alert module helps to detect duplicate contact values. When a user enters the same value in the contact, it returns a validation error message, which helps customers prevent duplicate entries.
</p>
</div>
</p>
</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;">
Select Multiple Fields</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
User can select multiple fields to check for duplicate values.</h4>
</h4>
</p>
</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;">
Validation Alert</h4>
<p style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1rem !important; line-height: 30px !important;">
Validation warning is triggered when users enter duplicate values.</h4>
</p>
</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">
<h2 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.7rem !important;">
Enable the "Unique Contacts" button.</h2>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Go to Settings --> Enable "Unique Contacts" button and select Fields.
</p>
<img src="assets/screenshots/dup_con1.png" class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
<div class="col-lg-12 my-3">
<h2 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.7rem !important;">
Validation alert for duplicate contact values</h2>
<p
style="font-family: 'Roboto', sans-serif !important; font-weight: 400 !important; color: #282F33 !important; font-size: 1.3rem !important;">
When you enter the same value in the contact fields, it raises a validation error message.
</p>
<img src="assets/screenshots/dup_con2.png" class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>
</div>
<!-- SUGGESTED PRODUCTS -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="color: #212529 !important;">Suggested Products</h2>
<hr
style="border: 3px solid #714B67 !important; background-color: #714B67 !important; width: 80px !important; margin-bottom: 2rem !important;"/>
<div id="demo1" class="row carousel slide" 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/15.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/15.0/custom_gantt_view/" 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/gantt_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/15.0/sales_credit_limit/" 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/credit_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/15.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/15.0/product_to_quotation/" 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/quotation_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/15.0/employee_documents_expiry/"
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/employee_image.png">
</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 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>
<!-- END OF END OF OUR SERVICES -->
<!-- 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 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-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>

39
duplicate_contact_details_alert/views/res_config_settings_views.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_contacts_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.duplicate_contact_details_alert</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='contacts_settings']" position="inside">
<div id="unique_contact_settings">
<div class='row mt16 o_settings_container'
name="contact_alert_setting_container">
<div class="col-12 col-lg-6 o_setting_box"
id="contact_alert">
<div class="o_setting_left_pane">
<field name="is_unique_contact"/>
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Unique Contacts
</span>
<div class="text-muted">Validation alerts for duplicate contact details</div>
<div class="row mt16"
attrs="{'invisible': [('is_unique_contact', '=', False)]}">
<label for="unique_contact_ids"
class="col-lg-4 o_light_label"/>
<field name="unique_contact_ids"
widget="many2many_tags"
class="oe_inline"/>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

41
hide_cost_price/README.rst

@ -0,0 +1,41 @@
Hide Product Cost Price v14
===========================
The cost price of the product will be only visible for the users added in the group "view cost price".
If user is not there in the group, the cost price of the product will remain invisible for the user.
By default administrator will be added to this group
Depends
=======
[product] addon Odoo
Tech
====
* [XML] - Odoo views
Installation
============
- www.odoo.com/documentation/14.0/setup/install.html
- Install our custom addon
License
=======
GNU AGPL, Version 3 (AGPLv3)
(http://www.gnu.org/licenses/agpl.html)
Bug Tracker
===========
Contact odoo@cybrosys.com
Authors
-------
* Sonu Soman <sonu@cybrosys.info>
Maintainer
----------
This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com.

22
hide_cost_price/__init__.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy(<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################

43
hide_cost_price/__manifest__.py

@ -0,0 +1,43 @@
# -*- 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>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': 'Hide Product Cost Price',
'summary': """Product Cost Price Will be Visible Only for Specified Group""",
'version': '14.0.1.0.0',
'description': """Product cost price will be visible only for specified group""",
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'https://www.cybrosys.com',
'category': 'Extra Tools',
'depends': ['base', 'product'],
'license': 'AGPL-3',
'data': [
'security/view_cost_price.xml',
'views/hide_product_cost.xml'
],
'images': ['static/description/banner.png'],
'installable': True,
'auto_install': False,
}

6
hide_cost_price/doc/RELEASE_NOTES.md

@ -0,0 +1,6 @@
## Module <hide_cost_price>
#### 22.07.2021
#### Version 14.0.1.0.0
##### ADD
- Initial commit

11
hide_cost_price/security/view_cost_price.xml

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<odoo>
<data>
<record id="view_cost_price" model="res.groups">
<field name="name">View Cost Price</field>
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
</record>
</data>
</odoo>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 911 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
hide_cost_price/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
hide_cost_price/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
hide_cost_price/static/description/images/hero.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
hide_cost_price/static/description/images/modules/approval_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
hide_cost_price/static/description/images/modules/dynamic_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
hide_cost_price/static/description/images/modules/mulitple-ref_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
hide_cost_price/static/description/images/modules/pos_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
hide_cost_price/static/description/images/modules/shopify_image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
hide_cost_price/static/description/images/screen1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
hide_cost_price/static/description/images/screen2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
hide_cost_price/static/description/images/screen3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

535
hide_cost_price/static/description/index.html

@ -0,0 +1,535 @@
<div style="padding: 3.5rem 1.5rem !important; background-color: #ffffff !important;">
<div class="container">
<!-- HERO -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 1rem !important;">
<h1 class="text-center" style="color: #212121 !important; font-size: 3rem !important;"><span
style="font-weight: 700 !important;">Hide Product Cost Price</span></h1>
<p class="text-center"
style="color: #212529 !important; font-size: 1.5rem !important; letter-spacing: 1px !important;">
Cost price will be visible only for selected users</p>
<img src="./images/hero.png" class="img-responsive">
</div>
</div>
<!-- END OF HERO -->
<!-- OVERVIEW -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="color: #212529 !important;">Overview</h2>
<hr
style="border: 3px solid #AC1015 !important; background-color: #AC1015 !important; width: 80px !important; margin-bottom: 2rem !important;" />
<p class="text-center" style="color: #212529 !important; font-size: 1.5rem !important;">
With the module create a custom new group, add users to this group and only the memebers of this
group can view the cost price of the product.
</p>
</div>
</div>
<!-- END OF OVERVIEW -->
<!-- KEY FEATURES -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center" style="padding: 2.5rem 1rem !important;">
<h2 class="text-center" style="color: #212529 !important;">Key Features</h2>
<hr
style="border: 3px solid #AC1015 !important; background-color: #AC1015 !important; width: 80px !important; margin-bottom: 2rem !important;" />
<div class="row">
<div class="col-lg-12">
<div class="d-flex deep-2"
style="height: 60px !important; padding: 1rem 1.5rem !important; border-radius: 0 !important; margin: 1.5rem 0">
<img src="./images/checked.png" style="height: 24px !important; width: 24px !important;"
class="mt-1 mr-2" height="24px" width="24px">
<p style="color: #212529 !important; font-size: 1.3rem !important;">
Cost price visibility restricted.
</p>
</div>
<div class="d-flex deep-2"
style="height: 60px !important; padding: 1rem 1.5rem !important; border-radius: 0 !important; margin: 1.5rem 0">
<img src="./images/checked.png" style="height: 24px !important; width: 24px !important;"
class="mt-1 mr-2" height="24px" width="24px">
<p style="color: #212529 !important; font-size: 1.3rem !important;">
Visible only for the users in the group.
</p>
</div>
<div class="d-flex deep-2"
style="height: 60px !important; padding: 1rem 1.5rem !important; border-radius: 0 !important; margin: 1.5rem 0">
<img src="./images/checked.png" style="height: 24px !important; width: 24px !important;"
class="mt-1 mr-2" height="24px" width="24px">
<p style="color: #212529 !important; font-size: 1.3rem !important;">
By default administrator will be added to this group.
</p>
</div>
</div>
</div>
</div>
</div>
<!-- END OF KEY FEATURES -->
<!-- SCREENSHOTS -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center" style="padding: 2.5rem 1rem !important;">
<h2 style="text-align: center; color: #212529 !important;">Screenshots</h2>
<hr
style="border: 3px solid #AC1015 !important; background-color: #AC1015 !important; width: 80px !important; margin-bottom: 2rem !important;" />
<!-- img -->
<div class="d-flex m-0" style="border-bottom: 1px solid #e5e5e5 !important;">
<div class="mr-3">
<h3
style="font-size: 2rem !important; font-weight: 800 !important; color: #ffffff !important; background-color: #AC1015 !important; padding: 1rem !important; width: 70px !important; height: 75px !important;">
01</h3>
</div>
<div>
<h3 style="font-size: 1.7rem !important; font-weight: 600 !important;">
Adding user to the View Cost Price group
</h3>
<p
style="color: #212529 !important; font-size: 1.3rem !important; font-weight: 300 !important;">
User will see the product cost price only if he is added in this group.
</p>
</div>
</div>
<img src="./images/screen1.png" class="img-responsive border"
style="margin-top: -15px !important; margin-top: 1rem !important; margin-bottom: 4rem !important;">
<!-- endo of img -->
<!-- img -->
<div class="d-flex m-0" style="border-bottom: 1px solid #e5e5e5 !important;">
<div class="mr-3">
<h3
style="font-size: 2rem !important; font-weight: 800 !important; color: #ffffff !important; background-color: #AC1015 !important; padding: 1rem !important; width: 70px !important; height: 75px !important;">
02</h3>
</div>
<div>
<h3 style="font-size: 1.7rem !important; font-weight: 600 !important;">
Product View for users not in the Group
</h3>
<p
style="color: #212529 !important; font-size: 1.3rem !important; font-weight: 300 !important;">
Product form view without cost price.
</p>
</div>
</div>
<img src="./images/screen3.png" class="img-responsive border"
style="margin-top: -15px !important; margin-top: 1rem !important; margin-bottom: 4rem !important;">
<!-- endo of img -->
<div class="d-flex m-0" style="border-bottom: 1px solid #e5e5e5 !important;">
<div class="mr-3">
<h3
style="font-size: 2rem !important; font-weight: 800 !important; color: #ffffff !important; background-color: #AC1015 !important; padding: 1rem !important; width: 70px !important; height: 75px !important;">
03</h3>
</div>
<div>
<h3 style="font-size: 1.7rem !important; font-weight: 600 !important;">
Product tree view without cost price
</h3>
<p
style="color: #212529 !important; font-size: 1.3rem !important; font-weight: 300 !important;">
Product tree view without cost price.
</p>
</div>
</div>
<img src="./images/screen2.png" class="img-responsive border"
style="margin-top: -15px !important; margin-top: 1rem !important; margin-bottom: 4rem !important;">
<!-- endo of img -->
</div>
</div>
<!-- END OF SCREENSHOTS -->
<!-- SUGGESTED PRODUCTS -->
<div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center"
style="text-align: center; padding: 2.5rem 1rem !important;">
<h2 style="color: #212529 !important;">Suggested Products</h2>
<hr
style="border: 3px solid #AC1015 !important; background-color: #AC1015 !important; width: 80px !important; margin-bottom: 2rem !important;" />
<div id="demo1" class="row carousel slide" 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/dynamic_accounts_report/"
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="./images/modules/dynamic_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="./images/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="./images/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/multiple_reference_per_product/"
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="./images/modules/mulitple-ref_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/shopify_odoo_connector/"
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="./images/modules/shopify_image.png">
</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 d-flex flex-column justify-content-center align-items-center">
<h2 style="color: #212529 !important;">Our Services</h2>
<hr
style="border: 3px solid #AC1015 !important; background-color: #AC1015 !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>
<!-- END OF END OF OUR SERVICES -->
<!-- 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 #AC1015 !important; background-color: #AC1015 !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 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 #AC1015 !important; background-color: #AC1015 !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>

60
hide_cost_price/views/hide_product_cost.xml

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<!-- Product Template Form View -->
<record model="ir.ui.view" id="product_form_hide_cost">
<field name="name">product.template.cost</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='standard_price']" position="attributes">
<attribute name="groups">hide_cost_price.view_cost_price</attribute>
</xpath>
<xpath expr="//field[@name='standard_price']" position="attributes">
<attribute name="groups">hide_cost_price.view_cost_price</attribute>
</xpath>
</field>
</record>
<!-- Product Variant Form View -->
<record model="ir.ui.view" id="product_variant_form_hide_cost">
<field name="name">product.product.cost</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='standard_price']" position="attributes">
<attribute name="groups">hide_cost_price.view_cost_price</attribute>
</xpath>
<xpath expr="//field[@name='standard_price']" position="attributes">
<attribute name="groups">hide_cost_price.view_cost_price</attribute>
</xpath>
</field>
</record>
<!-- Product Template Tree View -->
<record model="ir.ui.view" id="product_tree_hide_cost">
<field name="name">product.template.cost</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='standard_price']" position="attributes">
<attribute name="groups">hide_cost_price.view_cost_price</attribute>
</xpath>
</field>
</record>
<!-- Product Variant Tree View -->
<record model="ir.ui.view" id="product_product_tree_hide_cost">
<field name="name">product.product.cost</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='standard_price']" position="attributes">
<attribute name="groups">hide_cost_price.view_cost_price</attribute>
</xpath>
</field>
</record>
</data>
</odoo>

2
hide_menu_user/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Hide Any Menu User Wise', 'name': 'Hide Any Menu User Wise',
'version': '14.0.1.0.0', 'version': '14.0.1.0.1',
'summary': 'Hide Any Menu Item User Wise', 'summary': 'Hide Any Menu Item User Wise',
'description': 'Hide Any Menu Item User Wise, Hide Menu Items, Hide Menu', 'description': 'Hide Any Menu Item User Wise, Hide Menu Items, Hide Menu',
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',

10
hide_menu_user/models/res_user.py

@ -22,16 +22,16 @@
from odoo import models, fields, api from odoo import models, fields, api
class HideMenuUser(models.Model): class HideMenuUser(models.Model):
_inherit = 'res.users' _inherit = 'res.users'
@api.model @api.model_create_multi
def create(self, vals): def create(self, vals_list):
""" """
Else the menu will be still hidden even after removing from the list Else the menu will be still hidden even after removing from the list
""" """
self.clear_caches() for vals in vals_list:
self.clear_caches()
return super(HideMenuUser, self).create(vals) return super(HideMenuUser, self).create(vals)
def write(self, vals): def write(self, vals):
@ -43,6 +43,7 @@ class HideMenuUser(models.Model):
menu.write({ menu.write({
'restrict_user_ids': [(4, self.id)] 'restrict_user_ids': [(4, self.id)]
}) })
print(res,'resssssssssss')
self.clear_caches() self.clear_caches()
return res return res
@ -61,7 +62,6 @@ class HideMenuUser(models.Model):
'hidden to this user ') 'hidden to this user ')
is_admin = fields.Boolean(compute=_get_is_admin) is_admin = fields.Boolean(compute=_get_is_admin)
class RestrictMenu(models.Model): class RestrictMenu(models.Model):
_inherit = 'ir.ui.menu' _inherit = 'ir.ui.menu'

2
hr_payroll_dashboard/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': "HR Payroll Dashboard", 'name': "HR Payroll Dashboard",
'version': '14.0.1.0.0', 'version': '14.0.1.1.1',
'summary': """HR Payroll Dashboard""", 'summary': """HR Payroll Dashboard""",
'description': """HR Payroll Dashboard""", 'description': """HR Payroll Dashboard""",
'category': 'Human Resource', 'category': 'Human Resource',

394
hr_payroll_dashboard/models/employee.py

@ -47,37 +47,38 @@ class Employee(models.Model):
def get_user_employee_info(self): def get_user_employee_info(self):
"""To get the employee information""" """To get the employee information"""
uid = request.session.uid uid = request.session.uid
employee_id = self.env['hr.employee'].sudo().search([ employee_user_id = self.env['hr.employee'].sudo().search([
('user_id', '=', uid)], limit=1) ('user_id', '=', uid)
], limit=1)
employee = self.env['hr.employee'].sudo().search_read([ employee = self.env['hr.employee'].sudo().search_read([
('user_id', '=', uid)], limit=1) ('user_id', '=', uid)], limit=1)
attendance_count = self.env['hr.attendance'].sudo().search( attendance_count = self.env['hr.attendance'].sudo().search(
[('employee_id', '=', employee_id.id), [('employee_id', '=', employee_user_id.id),
('attendance_date', '=', date.today())]) ('attendance_date', '=', date.today())])
manager_attendance_count = self.env['hr.attendance'].sudo().search( manager_attendance_count = self.env['hr.attendance'].sudo().search(
[('attendance_date', '=', date.today())]) [('attendance_date', '=', date.today())])
leave_request_count = self.env['hr.leave'].sudo().search( leave_request_count = self.env['hr.leave'].sudo().search(
[('employee_id', '=', employee_id.id), [('employee_id', '=', employee_user_id.id),
('request_date_from', '=', date.today())]) ('request_date_from', '=', date.today())])
manager_leave_request = self.env['hr.leave'].sudo().search( manager_leave_request = self.env['hr.leave'].sudo().search(
[('request_date_from', '=', date.today())]) [('request_date_from', '=', date.today())])
employee_contracts = self.env['hr.contract'].sudo().search([ employee_contracts = self.env['hr.contract'].sudo().search([
('employee_id', '=', employee_id.id)]) ('employee_id', '=', employee_user_id.id)])
payslips = self.env['hr.payslip'].sudo().search([ payslips = self.env['hr.payslip'].sudo().search([
('employee_id', '=', employee_id.id)]) ('employee_id', '=', employee_user_id.id)])
salary_rules = self.env['hr.salary.rule'].sudo().search([]) salary_rules = self.env['hr.salary.rule'].sudo().search([])
salary_structures = self.env['hr.payroll.structure'].sudo().search([]) salary_structures = self.env['hr.payroll.structure'].sudo().search([])
salary_rule_count = len(salary_rules) salary_rule_count = len(salary_rules)
salary_structure_count = len(salary_structures) salary_structure_count = len(salary_structures)
emp_leave = len(manager_leave_request) if employee_id.is_manager \ emp_leave = len(manager_leave_request) if employee_user_id.is_manager \
else len(leave_request_count) else len(leave_request_count)
payslip_count = len(payslips) if not employee_id.is_manager \ payslip_count = len(payslips) if not employee_user_id.is_manager \
else len(self.env['hr.payslip'].sudo().search([])) else len(self.env['hr.payslip'].sudo().search([]))
emp_contracts_count = len(employee_contracts) \ emp_contracts_count = len(employee_contracts) \
if not employee_id.is_manager else len( if not employee_user_id.is_manager else len(
self.env['hr.contract'].sudo().search([])) self.env['hr.contract'].sudo().search([]))
attendance_today = len(manager_attendance_count) \ attendance_today = len(manager_attendance_count) \
if employee_id.is_manager else len(attendance_count) if employee_user_id.is_manager else len(attendance_count)
if employee: if employee:
data = { data = {
'emp_timesheets': attendance_today, 'emp_timesheets': attendance_today,
@ -128,20 +129,34 @@ class Employee(models.Model):
@api.model @api.model
def get_department_leave(self): def get_department_leave(self):
"""return department wise leave details""" """return department wise leave details"""
employee = False
month_list = [] month_list = []
graph_result = [] graph_result = []
uid = request.session.uid uid = request.session.uid
employee = self.env['hr.employee'].sudo().search_read([ employee_user = self.env['hr.employee'].sudo().search_read([
('user_id', '=', uid)], limit=1) ('user_id', '=', uid)
], limit=1)
employees = self.env['hr.employee'].sudo().search_read([], limit=1)
if employee_user:
employee = self.env['hr.employee'].sudo().search_read([
('user_id', '=', uid)], limit=1)
employee_id = self.env['hr.employee'].browse(
employee[0]['id'])
elif employees:
employee = self.env['hr.employee'].sudo().search_read([], limit=1)
employee_id = self.env['hr.employee'].browse(
employee[0]['id'])
for i in range(5, -1, -1): for i in range(5, -1, -1):
last_month = datetime.now() - relativedelta(months=i) last_month = datetime.now() - relativedelta(months=i)
text = format(last_month, '%B %Y') text = format(last_month, '%B %Y')
month_list.append(text) month_list.append(text)
self.env.cr.execute("""select id, name from hr_department self.env.cr.execute("""select id, name from hr_department
where active=True""") where active=True""")
departments = self.env.cr.dictfetchall() departments = self.env.cr.dictfetchall()
department_list = [x['name'] for x in departments] department_list = [x['name'] for x in departments]
for month in month_list: for month in month_list:
leave = {} leave = {}
for dept in departments: for dept in departments:
@ -151,65 +166,81 @@ class Employee(models.Model):
'leave': leave 'leave': leave
} }
graph_result.append(vals) graph_result.append(vals)
employee_id = self.env['hr.employee'].browse(employee[0]['id'])
sql = """
SELECT h.id, h.employee_id,h.department_id
, extract('month' FROM y)::int AS leave_month
, to_char(y, 'Month YYYY') as month_year
, GREATEST(y , h.date_from) AS date_from
, LEAST (y + interval '1 month', h.date_to) AS date_to
FROM (select * from hr_leave where state = 'validate') h
, generate_series(date_trunc('month', date_from::timestamp)
, date_trunc('month', date_to::timestamp)
, interval '1 month') y
where date_trunc('month', GREATEST(y , h.date_from)) >=
date_trunc('month', now()) - interval '6 month' and
date_trunc('month', GREATEST(y , h.date_from)) <=
date_trunc('month', now())
and h.department_id is not null
"""
self.env.cr.execute(sql)
results = self.env.cr.dictfetchall()
leave_lines = []
for line in results:
employee = self.browse(line['employee_id'])
from_dt = fields.Datetime.from_string(line['date_from'])
to_dt = fields.Datetime.from_string(line['date_to'])
days = employee.get_work_days_dashboard(from_dt, to_dt)
line['days'] = days
vals = {
'department': line['department_id'],
'l_month': line['month_year'],
'days': days
}
leave_lines.append(vals)
if leave_lines:
df = pd.DataFrame(leave_lines)
rf = df.groupby(['l_month', 'department']).sum()
result_lines = rf.to_dict('index')
for month in month_list:
for line in result_lines:
if month.replace(' ', '') == line[0].replace(' ', ''):
match = list(filter(lambda d: d['l_month'] in [month],
graph_result))[0]['leave']
dept_name = self.env['hr.department'].browse(
line[1]).name
if match:
match[dept_name] = result_lines[line]['days']
for result in graph_result:
result['l_month'] = result['l_month'].split(' ')[:1][0].strip()[:3] \
+ " " + result['l_month'].split(' ')[1:2][0]
return graph_result, department_list
if employee:
sql = """
SELECT h.id, h.employee_id,h.department_id
, extract('month' FROM y)::int AS leave_month
, to_char(y, 'Month YYYY') as month_year
, GREATEST(y , h.date_from) AS date_from
, LEAST (y + interval '1 month', h.date_to) AS date_to
FROM (select * from hr_leave where state = 'validate') h
, generate_series(date_trunc('month', date_from::timestamp)
, date_trunc('month', date_to::timestamp)
, interval '1 month') y
where date_trunc('month', GREATEST(y , h.date_from)) >=
date_trunc('month', now()) - interval '6 month' and
date_trunc('month', GREATEST(y , h.date_from)) <=
date_trunc('month', now())
and h.department_id is not null
"""
self.env.cr.execute(sql)
results = self.env.cr.dictfetchall()
leave_lines = []
for line in results:
employee = self.browse(line['employee_id'])
from_dt = fields.Datetime.from_string(line['date_from'])
to_dt = fields.Datetime.from_string(line['date_to'])
days = employee.get_work_days_dashboard(from_dt, to_dt)
line['days'] = days
vals = {
'department': line['department_id'],
'l_month': line['month_year'],
'days': days
}
leave_lines.append(vals)
if leave_lines:
df = pd.DataFrame(leave_lines)
rf = df.groupby(['l_month', 'department']).sum()
result_lines = rf.to_dict('index')
for month in month_list:
for line in result_lines:
if month.replace(' ', '') == line[0].replace(' ', ''):
match = list(filter(
lambda d: d['l_month'] in [month],
graph_result))[0]['leave']
dept_name = self.env['hr.department'].browse(
line[1]).name
if match:
match[dept_name] = result_lines[line]['days']
for result in graph_result:
result['l_month'] = result[
'l_month'
].split(' ')[:1][0].strip()[:3] + " " +\
result['l_month'].split(' ')[1:2][0]
return graph_result, department_list
else:
return False
@api.model @api.model
def get_employee_expense(self): def get_employee_expense(self):
"""return employee expense details""" """return employee expense details"""
month_list = [] month_list = []
graph_result = [] graph_result = []
uid = request.session.uid uid = request.session.uid
employee = self.env['hr.employee'].sudo().search_read([ employee = False
('user_id', '=', uid)], limit=1) employee_user = self.env['hr.employee'].sudo().search_read([
('user_id', '=', uid)
], limit=1)
employees = self.env['hr.employee'].sudo().search_read([], limit=1)
if employee_user:
employee = self.env['hr.employee'].sudo().search_read([
('user_id', '=', uid)
], limit=1)
elif employees:
employees = self.env['hr.employee'].sudo().search_read([], limit=1)
for i in range(5, -1, -1): for i in range(5, -1, -1):
last_month = datetime.now() - relativedelta(months=i) last_month = datetime.now() - relativedelta(months=i)
@ -228,47 +259,50 @@ class Employee(models.Model):
'leave': leave 'leave': leave
} }
graph_result.append(vals) graph_result.append(vals)
employee_id = self.env['hr.employee'].browse(employee[0]['id']) if employee:
employee_id = self.env['hr.employee'].browse(employee[0]['id'])
sql = """
SELECT h.id, h.employee_id,h.date, sql = """
extract('month' FROM h.date)::int AS leave_month, SELECT h.id, h.employee_id,h.date,
to_char(h.date, 'Month YYYY') as month_year extract('month' FROM h.date)::int AS leave_month,
FROM (select * from hr_expense where state = 'approved') h to_char(h.date, 'Month YYYY') as month_year
""" FROM (select * from hr_expense where state = 'approved') h
self.env.cr.execute(sql, (employee[0]['id'],)) """
self.env.cr.execute(sql, (employee[0]['id'],))
results = self.env.cr.dictfetchall() results = self.env.cr.dictfetchall()
leave_lines = [] leave_lines = []
for line in results: for line in results:
employee = self.browse(line['employee_id']) employee = self.browse(line['employee_id'])
from_dt = fields.Datetime.from_string(line['date']) from_dt = fields.Datetime.from_string(line['date'])
to_dt = fields.Datetime.from_string(line['date']) to_dt = fields.Datetime.from_string(line['date'])
days = employee.get_work_days_dashboard(from_dt, to_dt) days = employee.get_work_days_dashboard(from_dt, to_dt)
line['days'] = days line['days'] = days
vals = { vals = {
'department': line['employee_id'], 'department': line['employee_id'],
'l_month': line['month_year'], 'l_month': line['month_year'],
'days': days 'days': days
} }
leave_lines.append(vals) leave_lines.append(vals)
if leave_lines: if leave_lines:
df = pd.DataFrame(leave_lines) df = pd.DataFrame(leave_lines)
rf = df.groupby(['l_month', 'department']).sum() rf = df.groupby(['l_month', 'department']).sum()
result_lines = rf.to_dict('index') result_lines = rf.to_dict('index')
for month in month_list: for month in month_list:
for line in result_lines: for line in result_lines:
if month.replace(' ', '') == line[0].replace(' ', ''): if month.replace(' ', '') == line[0].replace(' ', ''):
match = list(filter(lambda d: d['l_month'] in [month], match = list(filter(lambda d: d['l_month'] in [month],
graph_result))[0]['leave'] graph_result))[0]['leave']
dept_name = self.env['hr.department'].browse( dept_name = self.env['hr.department'].browse(
line[1]).name line[1]).name
if match: if match:
match[dept_name] = result_lines[line]['days'] match[dept_name] = result_lines[line]['days']
for result in graph_result: for result in graph_result:
result['l_month'] = result['l_month'].split(' ')[:1][0].strip()[:3] \ result['l_month'] = result['l_month'].split(' ')[:1][0].strip()[:3] \
+ " " + result['l_month'].split(' ')[1:2][0] + " " + result['l_month'].split(' ')[1:2][0]
return graph_result, department_list return graph_result, department_list
else:
return False
@api.model @api.model
def employee_leave_trend(self): def employee_leave_trend(self):
@ -281,8 +315,19 @@ class Employee(models.Model):
text = format(last_month, '%B %Y') text = format(last_month, '%B %Y')
month_list.append(text) month_list.append(text)
uid = request.session.uid uid = request.session.uid
employee = self.env['hr.employee'].sudo().search_read([ employee = False
('user_id', '=', uid)], limit=1) employee_user = self.env['hr.employee'].sudo().search_read([
('user_id', '=', uid)
], limit=1)
employees = self.env['hr.employee'].sudo().search_read([], limit=1)
if employee_user:
employee = self.env['hr.employee'].sudo().search_read([
('user_id', '=', uid)
], limit=1)
elif employees:
employee = self.env['hr.employee'].sudo().search_read([], limit=1)
for month in month_list: for month in month_list:
vals = { vals = {
'l_month': month, 'l_month': month,
@ -305,32 +350,35 @@ class Employee(models.Model):
date_trunc('month', now()) date_trunc('month', now())
and h.employee_id = %s and h.employee_id = %s
""" """
self.env.cr.execute(sql, (employee[0]['id'],)) if employee:
results = self.env.cr.dictfetchall() self.env.cr.execute(sql, (employee[0]['id'],))
for line in results: results = self.env.cr.dictfetchall()
employee = self.browse(line['employee_id']) for line in results:
from_dt = fields.Datetime.from_string(line['date_from']) employee = self.browse(line['employee_id'])
to_dt = fields.Datetime.from_string(line['date_to']) from_dt = fields.Datetime.from_string(line['date_from'])
days = employee.get_work_days_dashboard(from_dt, to_dt) to_dt = fields.Datetime.from_string(line['date_to'])
line['days'] = days days = employee.get_work_days_dashboard(from_dt, to_dt)
vals = { line['days'] = days
'l_month': line['month_year'], vals = {
'days': days 'l_month': line['month_year'],
} 'days': days
leave_lines.append(vals) }
if leave_lines: leave_lines.append(vals)
df = pd.DataFrame(leave_lines) if leave_lines:
rf = df.groupby(['l_month']).sum() df = pd.DataFrame(leave_lines)
result_lines = rf.to_dict('index') rf = df.groupby(['l_month']).sum()
for line in result_lines: result_lines = rf.to_dict('index')
match = list(filter(lambda d: d['l_month'].replace( for line in result_lines:
' ', '') == line.replace(' ', ''), graph_result)) match = list(filter(lambda d: d['l_month'].replace(
if match: ' ', '') == line.replace(' ', ''), graph_result))
match[0]['leave'] = result_lines[line]['days'] if match:
for result in graph_result: match[0]['leave'] = result_lines[line]['days']
result['l_month'] = result['l_month'].split(' ')[:1][0].strip()[:3] \ for result in graph_result:
+ " " + result['l_month'].split(' ')[1:2][0] result['l_month'] = result['l_month'].split(' ')[:1][0].strip()[:3] \
return graph_result + " " + result['l_month'].split(' ')[1:2][0]
return graph_result
else:
return False
class Contract(models.Model): class Contract(models.Model):
@ -383,47 +431,63 @@ class HrExpense(models.Model):
last_month = datetime.now() - relativedelta(months=i) last_month = datetime.now() - relativedelta(months=i)
text = format(last_month, '%B %Y') text = format(last_month, '%B %Y')
month_list.append(text) month_list.append(text)
for month in month_list: for month in month_list:
vals = { vals = {
'l_month': month, 'l_month': month,
'count': 0 'count': 0
} }
approved_trend.append(vals) approved_trend.append(vals)
uid = request.session.uid uid = request.session.uid
employee = self.env['hr.employee'].sudo().search_read([ employee = False
('user_id', '=', uid)], limit=1) employee_user = self.env['hr.employee'].sudo().search_read([
employee_id = self.env['hr.employee'].browse(employee[0]['id']) ('user_id', '=', uid)
if not employee_id.is_manager: ], limit=1)
sql = ('''select to_char(date, 'Month YYYY') as l_month, employees = self.env['hr.employee'].sudo().search_read([], limit=1)
count(id) from hr_expense
WHERE date BETWEEN CURRENT_DATE - INTERVAL '12 months' if employee_user:
AND CURRENT_DATE + interval '1 month - 1 day' employee = self.env['hr.employee'].sudo().search_read([
AND hr_expense.employee_id = %s ('user_id', '=', uid)
group by l_month''') ], limit=1)
self.env.cr.execute(sql, (employee[0]['id'],)) elif employees:
employee = self.env['hr.employee'].sudo().search_read([], limit=1)
if employee:
employee_id = self.env['hr.employee'].browse(employee[0]['id'])
if not employee_id.is_manager:
sql = ('''select to_char(date, 'Month YYYY') as l_month,
count(id) from hr_expense
WHERE date BETWEEN CURRENT_DATE - INTERVAL '12 months'
AND CURRENT_DATE + interval '1 month - 1 day'
AND hr_expense.employee_id = %s
group by l_month''')
self.env.cr.execute(sql, (employee[0]['id'],))
else:
sql = ('''select to_char(date, 'Month YYYY') as l_month,
count(id) from hr_expense WHERE date
BETWEEN CURRENT_DATE - INTERVAL
'12 months' AND CURRENT_DATE + interval '1 month - 1 day'
group by l_month''')
self.env.cr.execute(sql)
approved_data = cr.fetchall()
for line in approved_data:
match = list(filter(lambda d: d['l_month'].replace(
' ', '') == line[0].replace(' ', ''), approved_trend))
if match:
match[0]['count'] = line[1]
for expense in approved_trend:
expense['l_month'] = expense[
'l_month'].split(' ')[:1][0].strip()[:3]
graph_result = [{
'values': approved_trend
}]
return graph_result
else: else:
sql = ('''select to_char(date, 'Month YYYY') as l_month, return False
count(id) from hr_expense WHERE date
BETWEEN CURRENT_DATE - INTERVAL
'12 months' AND CURRENT_DATE + interval '1 month - 1 day'
group by l_month''')
self.env.cr.execute(sql)
approved_data = cr.fetchall()
for line in approved_data:
match = list(filter(lambda d: d['l_month'].replace(
' ', '') == line[0].replace(' ', ''), approved_trend))
if match:
match[0]['count'] = line[1]
for expense in approved_trend:
expense['l_month'] = expense[
'l_month'].split(' ')[:1][0].strip()[:3]
graph_result = [{
'values': approved_trend
}]
return graph_result
class HrAttendance(models.Model): class HrAttendance(models.Model):

880
hr_payroll_dashboard/static/src/js/hr_payroll_dashboard.js

@ -223,80 +223,80 @@ var PayrollDashboard = AbstractAction.extend({
model: "hr.expense", model: "hr.expense",
method: "get_employee_expense", method: "get_employee_expense",
}).then(function (data) { }).then(function (data) {
data.forEach(function(d) { if(data){
d.values.forEach(function(d) { data.forEach(function(d) {
d.l_month = d.l_month; d.values.forEach(function(d) {
d.count = +d.count; d.l_month = d.l_month;
}); d.count = +d.count;
}); });
var margin = {top: 30, right: 10, bottom: 30, left: 30}, });
width = 400 - margin.left - margin.right, var margin = {top: 30, right: 10, bottom: 30, left: 30},
height = 250 - margin.top - margin.bottom; width = 400 - margin.left - margin.right,
height = 250 - margin.top - margin.bottom;
// Set the ranges
var x = d3.scale.ordinal() // Set the ranges
.rangeRoundBands([0, width], 1); var x = d3.scale.ordinal()
.rangeRoundBands([0, width], 1);
var y = d3.scale.linear()
.range([height, 0]); var y = d3.scale.linear()
.range([height, 0]);
// Define the axes
var xAxis = d3.svg.axis().scale(x) // Define the axes
.orient("bottom"); var xAxis = d3.svg.axis().scale(x)
.orient("bottom");
var yAxis = d3.svg.axis().scale(y)
.orient("left").ticks(5); var yAxis = d3.svg.axis().scale(y)
.orient("left").ticks(5);
x.domain(data[0].values.map(function(d) { return d.l_month; }));
y.domain([0, d3.max(data[0].values, d => d.count)]) x.domain(data[0].values.map(function(d) { return d.l_month; }));
y.domain([0, d3.max(data[0].values, d => d.count)])
var svg = d3.select(elem[0]).append("svg")
.attr("width", width + margin.left + margin.right) var svg = d3.select(elem[0]).append("svg")
.attr("height", height + margin.top + margin.bottom) .attr("width", width + margin.left + margin.right)
.append("g") .attr("height", height + margin.top + margin.bottom)
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); .append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
// Add the X Axis
svg.append("g") // Add the X Axis
.attr("class", "x axis") svg.append("g")
.attr("transform", "translate(0," + height + ")") .attr("class", "x axis")
.call(xAxis); .attr("transform", "translate(0," + height + ")")
.call(xAxis);
// Add the Y Axis
svg.append("g") // Add the Y Axis
.attr("class", "y axis") svg.append("g")
.call(yAxis); .attr("class", "y axis")
.call(yAxis);
var line = d3.svg.line()
.x(function(d) {return x(d.l_month); }) var line = d3.svg.line()
.y(function(d) {return y(d.count); }); .x(function(d) {return x(d.l_month); })
.y(function(d) {return y(d.count); });
let lines = svg.append('g')
.attr('class', 'lines'); let lines = svg.append('g')
.attr('class', 'lines');
lines.selectAll('.line-group')
.data(data).enter() lines.selectAll('.line-group')
.append('g') .data(data).enter()
.attr('class', 'line-group') .append('g')
.append('path') .attr('class', 'line-group')
.attr('class', 'line') .append('path')
.attr('d', function(d) { return line(d.values); }) .attr('class', 'line')
.style('stroke', (d, i) => color(i)); .attr('d', function(d) { return line(d.values); })
.style('stroke', (d, i) => color(i));
lines.selectAll("circle-group")
.data(data).enter() lines.selectAll("circle-group")
.append("g") .data(data).enter()
.selectAll("circle") .append("g")
.data(function(d) { return d.values;}).enter() .selectAll("circle")
.append("g") .data(function(d) { return d.values;}).enter()
.attr("class", "circle") .append("g")
.append("circle") .attr("class", "circle")
.attr("cx", function(d) { return x(d.l_month)}) .append("circle")
.attr("cy", function(d) { return y(d.count)}) .attr("cx", function(d) { return x(d.l_month)})
.attr("r", 3); .attr("cy", function(d) { return y(d.count)})
.attr("r", 3);
}
}); });
}, },
@ -309,212 +309,214 @@ var PayrollDashboard = AbstractAction.extend({
model: "hr.employee", model: "hr.employee",
method: "get_department_leave", method: "get_department_leave",
}).then(function (data) { }).then(function (data) {
var fData = data[0]; if (data){
var dept = data[1]; var fData = data[0];
var id = self.$('.leave_graph')[0]; var dept = data[1];
var barColor = '#ff618a'; var id = self.$('.leave_graph')[0];
fData.forEach(function(d){ var barColor = '#ff618a';
var total = 0; fData.forEach(function(d){
for (var dpt in dept){ var total = 0;
total += d.leave[dept[dpt]]; for (var dpt in dept){
} total += d.leave[dept[dpt]];
d.total=total; }
}); d.total=total;
});
// function to handle histogram.
function histoGram(fD){ // function to handle histogram.
var hG={}, hGDim = {t: 60, r: 0, b: 30, l: 0}; function histoGram(fD){
hGDim.w = 350 - hGDim.l - hGDim.r, var hG={}, hGDim = {t: 60, r: 0, b: 30, l: 0};
hGDim.h = 200 - hGDim.t - hGDim.b; hGDim.w = 350 - hGDim.l - hGDim.r,
hGDim.h = 200 - hGDim.t - hGDim.b;
//create svg for histogram.
var hGsvg = d3.select(id).append("svg") //create svg for histogram.
.attr("width", hGDim.w + hGDim.l + hGDim.r) var hGsvg = d3.select(id).append("svg")
.attr("height", hGDim.h + hGDim.t + hGDim.b).append("g") .attr("width", hGDim.w + hGDim.l + hGDim.r)
.attr("transform", "translate(" + hGDim.l + "," + hGDim.t + ")"); .attr("height", hGDim.h + hGDim.t + hGDim.b).append("g")
.attr("transform", "translate(" + hGDim.l + "," + hGDim.t + ")");
// create function for x-axis mapping.
var x = d3.scale.ordinal().rangeRoundBands([0, hGDim.w], 0.1) // create function for x-axis mapping.
.domain(fD.map(function(d) { return d[0]; })); var x = d3.scale.ordinal().rangeRoundBands([0, hGDim.w], 0.1)
.domain(fD.map(function(d) { return d[0]; }));
// Add x-axis to the histogram svg.
hGsvg.append("g").attr("class", "x axis") // Add x-axis to the histogram svg.
.attr("transform", "translate(0," + hGDim.h + ")") hGsvg.append("g").attr("class", "x axis")
.call(d3.svg.axis().scale(x).orient("bottom")); .attr("transform", "translate(0," + hGDim.h + ")")
.call(d3.svg.axis().scale(x).orient("bottom"));
// Create function for y-axis map.
var y = d3.scale.linear().range([hGDim.h, 0]) // Create function for y-axis map.
.domain([0, d3.max(fD, function(d) { return d[1]; })]); var y = d3.scale.linear().range([hGDim.h, 0])
.domain([0, d3.max(fD, function(d) { return d[1]; })]);
// Create bars for histogram to contain rectangles and freq labels.
var bars = hGsvg.selectAll(".bar").data(fD).enter() // Create bars for histogram to contain rectangles and freq labels.
.append("g").attr("class", "bar"); var bars = hGsvg.selectAll(".bar").data(fD).enter()
.append("g").attr("class", "bar");
//create the rectangles.
bars.append("rect") //create the rectangles.
.attr("x", function(d) { return x(d[0]); }) bars.append("rect")
.attr("y", function(d) { return y(d[1]); }) .attr("x", function(d) { return x(d[0]); })
.attr("width", x.rangeBand()) .attr("y", function(d) { return y(d[1]); })
.attr("height", function(d) { return hGDim.h - y(d[1]); }) .attr("width", x.rangeBand())
.attr('fill',barColor)
.on("mouseover",mouseover)// mouseover is defined below.
.on("mouseout",mouseout);// mouseout is defined below.
//Create the frequency labels above the rectangles.
bars.append("text").text(function(d){ return d3.format(",")(d[1])})
.attr("x", function(d) { return x(d[0])+x.rangeBand()/2; })
.attr("y", function(d) { return y(d[1])-5; })
.attr("text-anchor", "middle");
function mouseover(d){ // utility function to be called on mouseover.
// filter for selected state.
var st = fData.filter(function(s){ return s.l_month == d[0];})[0],
nD = d3.keys(st.leave).map(function(s){ return {type:s, leave:st.leave[s]};});
// call update functions of pie-chart and legend.
pC.update(nD);
leg.update(nD);
}
function mouseout(d){ // utility function to be called on mouseout.
// reset the pie-chart and legend.
pC.update(tF);
leg.update(tF);
}
// create function to update the bars. This will be used by pie-chart.
hG.update = function(nD, color){
// update the domain of the y-axis map to reflect change in frequencies.
y.domain([0, d3.max(nD, function(d) { return d[1]; })]);
// Attach the new data to the bars.
var bars = hGsvg.selectAll(".bar").data(nD);
// transition the height and color of rectangles.
bars.select("rect").transition().duration(500)
.attr("y", function(d) {return y(d[1]); })
.attr("height", function(d) { return hGDim.h - y(d[1]); }) .attr("height", function(d) { return hGDim.h - y(d[1]); })
.attr("fill", color); .attr('fill',barColor)
.on("mouseover",mouseover)// mouseover is defined below.
// transition the frequency labels location and change value. .on("mouseout",mouseout);// mouseout is defined below.
bars.select("text").transition().duration(500)
.text(function(d){ return d3.format(",")(d[1])}) //Create the frequency labels above the rectangles.
.attr("y", function(d) {return y(d[1])-5; }); bars.append("text").text(function(d){ return d3.format(",")(d[1])})
.attr("x", function(d) { return x(d[0])+x.rangeBand()/2; })
.attr("y", function(d) { return y(d[1])-5; })
.attr("text-anchor", "middle");
function mouseover(d){ // utility function to be called on mouseover.
// filter for selected state.
var st = fData.filter(function(s){ return s.l_month == d[0];})[0],
nD = d3.keys(st.leave).map(function(s){ return {type:s, leave:st.leave[s]};});
// call update functions of pie-chart and legend.
pC.update(nD);
leg.update(nD);
}
function mouseout(d){ // utility function to be called on mouseout.
// reset the pie-chart and legend.
pC.update(tF);
leg.update(tF);
}
// create function to update the bars. This will be used by pie-chart.
hG.update = function(nD, color){
// update the domain of the y-axis map to reflect change in frequencies.
y.domain([0, d3.max(nD, function(d) { return d[1]; })]);
// Attach the new data to the bars.
var bars = hGsvg.selectAll(".bar").data(nD);
// transition the height and color of rectangles.
bars.select("rect").transition().duration(500)
.attr("y", function(d) {return y(d[1]); })
.attr("height", function(d) { return hGDim.h - y(d[1]); })
.attr("fill", color);
// transition the frequency labels location and change value.
bars.select("text").transition().duration(500)
.text(function(d){ return d3.format(",")(d[1])})
.attr("y", function(d) {return y(d[1])-5; });
}
return hG;
} }
return hG;
}
// function to handle pieChart.
function pieChart(pD){
var pC ={}, pieDim ={w:250, h: 250};
pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;
// create svg for pie chart.
var piesvg = d3.select(id).append("svg")
.attr("width", pieDim.w).attr("height", pieDim.h).append("g")
.attr("transform", "translate("+pieDim.w/2+","+pieDim.h/2+")");
// create function to draw the arcs of the pie slices.
var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);
// create a function to compute the pie slice angles. // function to handle pieChart.
var pie = d3.layout.pie().sort(null).value(function(d) { return d.leave; }); function pieChart(pD){
var pC ={}, pieDim ={w:250, h: 250};
// Draw the pie slices. pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;
piesvg.selectAll("path").data(pie(pD)).enter().append("path").attr("d", arc)
.each(function(d) { this._current = d; }) // create svg for pie chart.
.attr("fill", function(d, i){return color(i);}) var piesvg = d3.select(id).append("svg")
.on("mouseover",mouseover).on("mouseout",mouseout); .attr("width", pieDim.w).attr("height", pieDim.h).append("g")
.attr("transform", "translate("+pieDim.w/2+","+pieDim.h/2+")");
// create function to update pie-chart. This will be used by histogram.
pC.update = function(nD){ // create function to draw the arcs of the pie slices.
piesvg.selectAll("path").data(pie(nD)).transition().duration(500) var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);
.attrTween("d", arcTween);
} // create a function to compute the pie slice angles.
// Utility function to be called on mouseover a pie slice. var pie = d3.layout.pie().sort(null).value(function(d) { return d.leave; });
function mouseover(d, i){
// call the update function of histogram with new data. // Draw the pie slices.
hG.update(fData.map(function(v){ piesvg.selectAll("path").data(pie(pD)).enter().append("path").attr("d", arc)
return [v.l_month,v.leave[d.data.type]];}),color(i)); .each(function(d) { this._current = d; })
.attr("fill", function(d, i){return color(i);})
.on("mouseover",mouseover).on("mouseout",mouseout);
// create function to update pie-chart. This will be used by histogram.
pC.update = function(nD){
piesvg.selectAll("path").data(pie(nD)).transition().duration(500)
.attrTween("d", arcTween);
}
// Utility function to be called on mouseover a pie slice.
function mouseover(d, i){
// call the update function of histogram with new data.
hG.update(fData.map(function(v){
return [v.l_month,v.leave[d.data.type]];}),color(i));
}
//Utility function to be called on mouseout a pie slice.
function mouseout(d){
// call the update function of histogram with all data.
hG.update(fData.map(function(v){
return [v.l_month,v.total];}), barColor);
}
// Animating the pie-slice requiring a custom function which specifies
// how the intermediate paths should be drawn.
function arcTween(a) {
var i = d3.interpolate(this._current, a);
this._current = i(0);
return function(t) { return arc(i(t)); };
}
return pC;
} }
//Utility function to be called on mouseout a pie slice.
function mouseout(d){
// call the update function of histogram with all data.
hG.update(fData.map(function(v){
return [v.l_month,v.total];}), barColor);
} // function to handle legend.
// Animating the pie-slice requiring a custom function which specifies function legend(lD){
// how the intermediate paths should be drawn. var leg = {};
function arcTween(a) {
var i = d3.interpolate(this._current, a);
this._current = i(0);
return function(t) { return arc(i(t)); };
}
return pC;
}
// function to handle legend. // create table for legend.
function legend(lD){ var legend = d3.select(id).append("table").attr('class','legend');
var leg = {};
// create table for legend. // create one row per segment.
var legend = d3.select(id).append("table").attr('class','legend'); var tr = legend.append("tbody").selectAll("tr").data(lD).enter().append("tr");
// create one row per segment. // create the first column for each segment.
var tr = legend.append("tbody").selectAll("tr").data(lD).enter().append("tr"); tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect")
.attr("width", '16').attr("height", '16')
.attr("fill", function(d, i){return color(i);})
// create the first column for each segment. // create the second column for each segment.
tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect") tr.append("td").text(function(d){ return d.type;});
.attr("width", '16').attr("height", '16')
.attr("fill", function(d, i){return color(i);})
// create the second column for each segment. // create the third column for each segment.
tr.append("td").text(function(d){ return d.type;}); tr.append("td").attr("class",'legendFreq')
.text(function(d){ return d.l_month;});
// create the third column for each segment. // create the fourth column for each segment.
tr.append("td").attr("class",'legendFreq') tr.append("td").attr("class",'legendPerc')
.text(function(d){ return d.l_month;}); .text(function(d){ return getLegend(d,lD);});
// create the fourth column for each segment. // Utility function to be used to update the legend.
tr.append("td").attr("class",'legendPerc') leg.update = function(nD){
.text(function(d){ return getLegend(d,lD);}); // update the data attached to the row elements.
var l = legend.select("tbody").selectAll("tr").data(nD);
// Utility function to be used to update the legend. // update the frequencies.
leg.update = function(nD){ l.select(".legendFreq").text(function(d){ return d3.format(",")(d.leave);});
// update the data attached to the row elements.
var l = legend.select("tbody").selectAll("tr").data(nD);
// update the frequencies. // update the percentage column.
l.select(".legendFreq").text(function(d){ return d3.format(",")(d.leave);}); l.select(".legendPerc").text(function(d){ return getLegend(d,nD);});
}
// update the percentage column. function getLegend(d,aD){ // Utility function to compute percentage.
l.select(".legendPerc").text(function(d){ return getLegend(d,nD);}); var perc = (d.leave/d3.sum(aD.map(function(v){ return v.leave; })));
} if (isNaN(perc)){
return d3.format("%")(0);
}
else{
return d3.format("%")(d.leave/d3.sum(aD.map(function(v){ return v.leave; })));
}
}
function getLegend(d,aD){ // Utility function to compute percentage. return leg;
var perc = (d.leave/d3.sum(aD.map(function(v){ return v.leave; })));
if (isNaN(perc)){
return d3.format("%")(0);
}
else{
return d3.format("%")(d.leave/d3.sum(aD.map(function(v){ return v.leave; })));
}
} }
// calculate total frequency by segment for all state.
var tF = dept.map(function(d){
return {type:d, leave: d3.sum(fData.map(function(t){ return t.leave[d];}))};
});
return leg; // calculate total frequency by state for all segment.
} var sF = fData.map(function(d){return [d.l_month,d.total];});
// calculate total frequency by segment for all state.
var tF = dept.map(function(d){
return {type:d, leave: d3.sum(fData.map(function(t){ return t.leave[d];}))};
});
// calculate total frequency by state for all segment.
var sF = fData.map(function(d){return [d.l_month,d.total];});
var hG = histoGram(sF), // create the histogram. var hG = histoGram(sF), // create the histogram.
pC = pieChart(tF), // create the pie-chart. pC = pieChart(tF), // create the pie-chart.
leg= legend(tF); // create the legend. leg= legend(tF); // create the legend.
}
}); });
}, },
render_graphs: function(){ render_graphs: function(){
@ -543,36 +545,37 @@ var PayrollDashboard = AbstractAction.extend({
method: "get_employee_time_off", method: "get_employee_time_off",
}).then(function (data) { }).then(function (data) {
var segColor = {}; if (data){
var vis = d3.select(elem[0]).append("svg:svg").data([data]).attr("width", w).attr("height", h).append("svg:g").attr("transform", "translate(" + r + "," + r + ")"); var segColor = {};
var pie = d3.layout.pie().value(function(d){return d.value;}); var vis = d3.select(elem[0]).append("svg:svg").data([data]).attr("width", w).attr("height", h).append("svg:g").attr("transform", "translate(" + r + "," + r + ")");
var arc = d3.svg.arc().outerRadius(r); var pie = d3.layout.pie().value(function(d){return d.value;});
var arcs = vis.selectAll("g.slice").data(pie).enter().append("svg:g").attr("class", "slice"); var arc = d3.svg.arc().outerRadius(r);
arcs.append("svg:path") var arcs = vis.selectAll("g.slice").data(pie).enter().append("svg:g").attr("class", "slice");
.attr("fill", function(d, i){ arcs.append("svg:path")
return color(i); .attr("fill", function(d, i){
}) return color(i);
.attr("d", function (d) { })
return arc(d); .attr("d", function (d) {
}); return arc(d);
});
var legend = d3.select(elem[0]).append("table").attr('class','legend');
var legend = d3.select(elem[0]).append("table").attr('class','legend');
// create one row per segment.
var tr = legend.append("tbody").selectAll("tr").data(data).enter().append("tr"); // create one row per segment.
var tr = legend.append("tbody").selectAll("tr").data(data).enter().append("tr");
// create the first column for each segment.
tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect") // create the first column for each segment.
.attr("width", '16').attr("height", '16') tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect")
.attr("fill",function(d, i){ return color(i) }); .attr("width", '16').attr("height", '16')
.attr("fill",function(d, i){ return color(i) });
// create the second column for each segment.
tr.append("td").attr("style","font-weight: bold;").text(function(d){ return d.label;}); // create the second column for each segment.
tr.append("td").attr("style","font-weight: bold;").text(function(d){ return d.label;});
// create the third column for each segment.
tr.append("td").attr("class",'legendFreq').attr("style","border: 5px solid transparent; font-weight: bold;") // create the third column for each segment.
.text(function(d){ return d.value;}); tr.append("td").attr("class",'legendFreq').attr("style","border: 5px solid transparent; font-weight: bold;")
.text(function(d){ return d.value;});
}
}); });
}, },
@ -590,35 +593,37 @@ var PayrollDashboard = AbstractAction.extend({
model: "hr.payslip", model: "hr.payslip",
method: "get_employee_payslips", method: "get_employee_payslips",
}).then(function (data) { }).then(function (data) {
var segColor = {}; if(data){
var vis = d3.select(elem[0]).append("svg:svg").data([data]).attr("width", w).attr("height", h).append("svg:g").attr("transform", "translate(" + r + "," + r + ")"); var segColor = {};
var pie = d3.layout.pie().value(function(d){return d.value;}); var vis = d3.select(elem[0]).append("svg:svg").data([data]).attr("width", w).attr("height", h).append("svg:g").attr("transform", "translate(" + r + "," + r + ")");
var arc = d3.svg.arc().outerRadius(r); var pie = d3.layout.pie().value(function(d){return d.value;});
var arcs = vis.selectAll("g.slice").data(pie).enter().append("svg:g").attr("class", "slice"); var arc = d3.svg.arc().outerRadius(r);
arcs.append("svg:path") var arcs = vis.selectAll("g.slice").data(pie).enter().append("svg:g").attr("class", "slice");
.attr("fill", function(d, i){ arcs.append("svg:path")
return color(i); .attr("fill", function(d, i){
}) return color(i);
.attr("d", function (d) { })
return arc(d); .attr("d", function (d) {
}); return arc(d);
});
var legend = d3.select(elem[0]).append("table").attr('class','legend');
var legend = d3.select(elem[0]).append("table").attr('class','legend');
// create one row per segment.
var tr = legend.append("tbody").selectAll("tr").data(data).enter().append("tr"); // create one row per segment.
var tr = legend.append("tbody").selectAll("tr").data(data).enter().append("tr");
// create the first column for each segment.
tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect") // create the first column for each segment.
.attr("width", '16').attr("height", '16') tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect")
.attr("fill",function(d, i){ return color(i) }); .attr("width", '16').attr("height", '16')
.attr("fill",function(d, i){ return color(i) });
// create the second column for each segment.
tr.append("td").attr("style","font-weight: bold;").text(function(d){ return d.label;}); // create the second column for each segment.
tr.append("td").attr("style","font-weight: bold;").text(function(d){ return d.label;});
// create the third column for each segment.
tr.append("td").attr("class",'legendFreq').attr("style","border: 5px solid transparent; font-weight: bold;") // create the third column for each segment.
.text(function(d){ return d.value;}); tr.append("td").attr("class",'legendFreq').attr("style","border: 5px solid transparent; font-weight: bold;")
.text(function(d){ return d.value;});
}
}); });
}, },
@ -636,35 +641,37 @@ var PayrollDashboard = AbstractAction.extend({
model: "hr.contract", model: "hr.contract",
method: "get_employee_contract", method: "get_employee_contract",
}).then(function (data) { }).then(function (data) {
var segColor = {}; if(data){
var vis = d3.select(elem[0]).append("svg:svg").data([data]).attr("width", w).attr("height", h).append("svg:g").attr("transform", "translate(" + r + "," + r + ")"); var segColor = {};
var pie = d3.layout.pie().value(function(d){return d.value;}); var vis = d3.select(elem[0]).append("svg:svg").data([data]).attr("width", w).attr("height", h).append("svg:g").attr("transform", "translate(" + r + "," + r + ")");
var arc = d3.svg.arc().outerRadius(r); var pie = d3.layout.pie().value(function(d){return d.value;});
var arcs = vis.selectAll("g.slice").data(pie).enter().append("svg:g").attr("class", "slice"); var arc = d3.svg.arc().outerRadius(r);
arcs.append("svg:path") var arcs = vis.selectAll("g.slice").data(pie).enter().append("svg:g").attr("class", "slice");
.attr("fill", function(d, i){ arcs.append("svg:path")
return color(i); .attr("fill", function(d, i){
}) return color(i);
.attr("d", function (d) { })
return arc(d); .attr("d", function (d) {
}); return arc(d);
});
var legend = d3.select(elem[0]).append("table").attr('class','legend');
var legend = d3.select(elem[0]).append("table").attr('class','legend');
// create one row per segment.
var tr = legend.append("tbody").selectAll("tr").data(data).enter().append("tr"); // create one row per segment.
var tr = legend.append("tbody").selectAll("tr").data(data).enter().append("tr");
// create the first column for each segment.
tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect") // create the first column for each segment.
.attr("width", '16').attr("height", '16') tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect")
.attr("fill",function(d, i){ return color(i) }); .attr("width", '16').attr("height", '16')
.attr("fill",function(d, i){ return color(i) });
// create the second column for each segment.
tr.append("td").attr("style","font-weight: bold;").text(function(d){ return d.label;}); // create the second column for each segment.
tr.append("td").attr("style","font-weight: bold;").text(function(d){ return d.label;});
// create the third column for each segment.
tr.append("td").attr("class",'legendFreq').attr("style","border: 5px solid transparent; font-weight: bold;") // create the third column for each segment.
.text(function(d){ return d.value;}); tr.append("td").attr("class",'legendFreq').attr("style","border: 5px solid transparent; font-weight: bold;")
.text(function(d){ return d.value;});
}
}); });
}, },
@ -674,93 +681,94 @@ var PayrollDashboard = AbstractAction.extend({
model: "hr.employee", model: "hr.employee",
method: "employee_leave_trend", method: "employee_leave_trend",
}).then(function (data) { }).then(function (data) {
var elem = self.$('.leave_trend'); if(data){
var margin = {top: 30, right: 20, bottom: 30, left: 80}, var elem = self.$('.leave_trend');
width = 500 - margin.left - margin.right, var margin = {top: 30, right: 20, bottom: 30, left: 80},
height = 250 - margin.top - margin.bottom; width = 500 - margin.left - margin.right,
height = 250 - margin.top - margin.bottom;
// Set the ranges
var x = d3.scale.ordinal() // Set the ranges
.rangeRoundBands([0, width], 1); var x = d3.scale.ordinal()
.rangeRoundBands([0, width], 1);
var y = d3.scale.linear()
.range([height, 0]); var y = d3.scale.linear()
.range([height, 0]);
// Define the axes
var xAxis = d3.svg.axis().scale(x) // Define the axes
.orient("bottom"); var xAxis = d3.svg.axis().scale(x)
.orient("bottom");
var yAxis = d3.svg.axis().scale(y)
.orient("left").ticks(5); var yAxis = d3.svg.axis().scale(y)
.orient("left").ticks(5);
var valueline = d3.svg.line()
.x(function(d) { return x(d.l_month); }) var valueline = d3.svg.line()
.y(function(d) { return y(d.leave); }); .x(function(d) { return x(d.l_month); })
.y(function(d) { return y(d.leave); });
var svg = d3.select(elem[0]).append("svg")
.attr("width", width + margin.left + margin.right) var svg = d3.select(elem[0]).append("svg")
.attr("height", height + margin.top + margin.bottom) .attr("width", width + margin.left + margin.right)
.append("g") .attr("height", height + margin.top + margin.bottom)
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); .append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
x.domain(data.map(function(d) { return d.l_month; }));
y.domain([0, d3.max(data, function(d) { return d.leave; })]); x.domain(data.map(function(d) { return d.l_month; }));
y.domain([0, d3.max(data, function(d) { return d.leave; })]);
// Add the X Axis
svg.append("g") // Add the X Axis
.attr("class", "x axis") svg.append("g")
.attr("transform", "translate(0," + height + ")") .attr("class", "x axis")
.call(xAxis); .attr("transform", "translate(0," + height + ")")
.call(xAxis);
// Add the Y Axis
svg.append("g") // Add the Y Axis
.attr("class", "y axis") svg.append("g")
.call(yAxis); .attr("class", "y axis")
.call(yAxis);
svg.append("path")
.attr("class", "line") svg.append("path")
.attr("d", valueline(data)); .attr("class", "line")
.attr("d", valueline(data));
// Add the scatterplot
svg.selectAll("dot") // Add the scatterplot
.data(data) svg.selectAll("dot")
.enter().append("circle") .data(data)
.attr("r", 3) .enter().append("circle")
.attr("cx", function(d) { return x(d.l_month); }) .attr("r", 3)
.attr("cy", function(d) { return y(d.leave); }) .attr("cx", function(d) { return x(d.l_month); })
// .on('mouseover', function() { d3.select(this).transition().duration(500).ease("elastic").attr('r', 3 * 2) }) .attr("cy", function(d) { return y(d.leave); })
// .on('mouseout', function() { d3.select(this).transition().duration(500).ease("in-out").attr('r', 3) }); // .on('mouseover', function() { d3.select(this).transition().duration(500).ease("elastic").attr('r', 3 * 2) })
.on("mouseover", function() { tooltip.style("display", null); // .on('mouseout', function() { d3.select(this).transition().duration(500).ease("in-out").attr('r', 3) });
d3.select(this).transition().duration(500).ease("elastic").attr('r', 3 * 2) .on("mouseover", function() { tooltip.style("display", null);
}) d3.select(this).transition().duration(500).ease("elastic").attr('r', 3 * 2)
.on("mouseout", function() { tooltip.style("display", "none"); })
d3.select(this).transition().duration(500).ease("in-out").attr('r', 3) .on("mouseout", function() { tooltip.style("display", "none");
}) d3.select(this).transition().duration(500).ease("in-out").attr('r', 3)
.on("mousemove", function(d) { })
var xPosition = d3.mouse(this)[0] - 15; .on("mousemove", function(d) {
var yPosition = d3.mouse(this)[1] - 25; var xPosition = d3.mouse(this)[0] - 15;
tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")"); var yPosition = d3.mouse(this)[1] - 25;
tooltip.select("text").text(d.leave); tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")");
}); tooltip.select("text").text(d.leave);
});
var tooltip = svg.append("g")
.attr("class", "tooltip") var tooltip = svg.append("g")
.style("display", "none"); .attr("class", "tooltip")
.style("display", "none");
tooltip.append("rect")
.attr("width", 30) tooltip.append("rect")
.attr("height", 20) .attr("width", 30)
.attr("fill", "black") .attr("height", 20)
.style("opacity", 0.5); .attr("fill", "black")
.style("opacity", 0.5);
tooltip.append("text")
.attr("x", 15) tooltip.append("text")
.attr("dy", "1.2em") .attr("x", 15)
.style("text-anchor", "middle") .attr("dy", "1.2em")
.attr("font-size", "12px") .style("text-anchor", "middle")
.attr("font-weight", "bold"); .attr("font-size", "12px")
.attr("font-weight", "bold");
}
}); });
}, },

22
hr_payroll_dashboard/static/src/xml/payroll_dashboard.xml

@ -6,6 +6,20 @@
</div> </div>
</div> </div>
</t> </t>
<t t-name="EmployeeWarning">
<div class="row" style="margin-top:1%;margin-left:40%;">
<div class="col-md-12 ">
<div>
<div class="rounded mx-auto d-block">
<div>
<p style="color:red;">Error : Could not find employee linked to user</p>
<p style="color:red;">Please contact system admin for the setup</p>
</div>
</div>
</div>
</div>
</div>
</t>
<t t-name="EmployeeDetails"> <t t-name="EmployeeDetails">
<link rel="stylesheet" <link rel="stylesheet"
href="/hr_payroll_dashboard/static/src/css/dashboard.css"/> href="/hr_payroll_dashboard/static/src/css/dashboard.css"/>
@ -83,7 +97,7 @@
<div class="oh-card-body"> <div class="oh-card-body">
<div class="stat-widget-one"> <div class="stat-widget-one">
<div class="stat-icon" style="background:#FCF030"> <div class="stat-icon" style="background:#FCF030">
<i class='fa fa-money'></i> <i class='fa fa-money'/>
</div> </div>
<div class="stat-content"> <div class="stat-content">
<div class="stat-head">Salary Rules</div> <div class="stat-head">Salary Rules</div>
@ -100,7 +114,7 @@
<div class="oh-card-body"> <div class="oh-card-body">
<div class="stat-widget-one"> <div class="stat-widget-one">
<div class="stat-icon" style="background:#FFA742"> <div class="stat-icon" style="background:#FFA742">
<i class='fa fa-money'></i> <i class='fa fa-money'/>
</div> </div>
<div class="stat-content"> <div class="stat-content">
<div class="stat-head">Salary Structures</div> <div class="stat-head">Salary Structures</div>
@ -175,8 +189,8 @@
</t> </t>
<t t-name="PayrollManagerDashboard"> <t t-name="PayrollManagerDashboard">
<br></br> <br/>
<br></br> <br/>
<div class="row" style="margin:0px;"> <div class="row" style="margin:0px;">
<div class="col-md-4" id="col-graph"> <div class="col-md-4" id="col-graph">
<div class="card"> <div class="card">

44
insta_feed_snippet/README.rst

@ -0,0 +1,44 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
Insta Feed Snippet
===================
Insta Feed Snippet
Installation
============
- www.odoo.com/documentation/15.0/setup/install.html
- Install our custom addon
Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__
Credits
-------
* Developer:
vishnu@cybrosys.info
Version 14.0.1.0.0:
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
==========
.. 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>`__

2
insta_feed_snippet/__init__.py

@ -0,0 +1,2 @@
from . import models
from . import controllers

44
insta_feed_snippet/__manifest__.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2022-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': 'Instagram Feed Snippet',
'version': '14.0.1.0.0',
'summary': 'Instagram Feed Snippet',
'description': """Instagram Feed Snippet""",
'category': 'Website',
'author': "Cybrosys Techno Solutions",
'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',
'license': 'LGPL-3',
'depends': ['base', 'product', 'website', 'website_sale', 'sale'],
'data': ['security/ir.model.access.csv',
'views/insta_post.xml',
'views/insta_profile.xml',
'views/snippet_structure_inherit.xml',
'views/website.xml'
],
'installable': True,
'application': True,
'auto_install': False,
}

1
insta_feed_snippet/controllers/__init__.py

@ -0,0 +1 @@
from . import main

30
insta_feed_snippet/controllers/main.py

@ -0,0 +1,30 @@
from odoo import http
from odoo.http import request
import time
class DashbaordCarousel(http.Controller):
@http.route('/get_dashbaord_carousel', auth="public", type='json')
def get_dashbaord_carousel(self):
events_per_slide = 3
records = request.env['insta.post'].sudo().search(
[])
records_grouped = []
record_list = []
for index, record in enumerate(records, 1):
record_list.append(record)
if index % events_per_slide == 0:
records_grouped.append(record_list)
record_list = []
if any(record_list):
records_grouped.append(record_list)
values = {
"objects": records_grouped,
"events_per_slide": events_per_slide,
"num_slides": len(records_grouped),
"uniqueId": "pc-%d" % int(time.time() * 1000),
}
print(len(records_grouped))
response = http.Response(
template='insta_feed_snippet.s_carousel_template_items', qcontext=values)
return response.render()

7
insta_feed_snippet/doc/RELEASE_NOTES.md

@ -0,0 +1,7 @@
## Module <insta_feed_snippet>
#### 09.11.2022
#### Version 14.0.1.0.0
#### ADD
Initial Commit

2
insta_feed_snippet/models/__init__.py

@ -0,0 +1,2 @@
from . import insta_profile
from . import insta_post

27
insta_feed_snippet/models/insta_post.py

@ -0,0 +1,27 @@
from odoo import models, fields, api, _
import requests
from odoo.exceptions import UserError
class InstaPost(models.Model):
_name = 'insta.post'
name = fields.Char(string="Media ID")
caption = fields.Char("Caption")
post_image = fields.Binary(string='Post Image', attachment=True)
profile_id = fields.Many2one('insta.profile')
def action_update_post(self, access_token):
url = 'https://graph.facebook.com/v15.0/%s?fields=id,caption,comments_count,is_comment_enabled,like_count,media_product_type,media_type,media_url,owner,permalink,thumbnail_url,timestamp,username&access_token=%s' % (
self.name, access_token)
media_content = requests.get(url, timeout=5).json()
if not media_content.get('error'):
if media_content.get('caption'):
self.write({
'caption': media_content['caption'],
})
else:
raise UserError(_('%s', media_content['error']['message']))

81
insta_feed_snippet/models/insta_profile.py

@ -0,0 +1,81 @@
import base64
from odoo import models, fields, api, _
import requests
from odoo.exceptions import UserError
class InstaProfile(models.Model):
_name = 'insta.profile'
name = fields.Char(string="Name", readonly=True)
access_token = fields.Text("Access Token")
username = fields.Char('Username', readonly=True)
account_id = fields.Char('Account ID', readonly=True)
profile_image_url = fields.Binary(attachment=True)
def action_fetch(self):
url = 'https://graph.facebook.com/v15.0/me/accounts?access_token=%s' % self.access_token
page = requests.get(url)
page_content = page.json()
if not page_content.get('error'):
if page_content['data'][0]['id']:
url = 'https://graph.facebook.com/v14.0/%s?fields=instagram_business_account&access_token=%s' % (
page_content['data'][0]['id'], self.access_token)
business_account = requests.get(url)
instagram_business_account = business_account.json()['instagram_business_account']['id']
url = 'https://graph.facebook.com/v15.0/%s?fields=name,username,biography,website,followers_count,follows_count,media_count,profile_picture_url&access_token=%s' % (
instagram_business_account, self.access_token)
val = requests.get(url)
content = val.json()
if content.get('name'):
self.name = content['name']
if content.get('username'):
self.username = content['username']
if content.get('id'):
self.account_id = content['id']
if content.get('profile_picture_url'):
img = base64.b64encode(requests.get(content['profile_picture_url']).content)
self.profile_image_url = img
else:
raise UserError(_('%s', page_content['error']['message']))
def action_get_post(self):
url = 'https://graph.facebook.com/v15.0/%s/media?access_token=%s' % (self.account_id, self.access_token)
content = requests.get(url, timeout=5).json()
if not content.get('error'):
post_list = []
records = self.env['insta.post'].search([])
for post in records:
post_list.append(post.name)
if content.get('data'):
for vals in content['data']:
if vals['id'] not in post_list:
url = 'https://graph.facebook.com/v14.0/%s?fields=id,caption,comments_count,is_comment_enabled,like_count,media_product_type,media_type,media_url,owner,permalink,thumbnail_url,timestamp,username&access_token=%s' % (
vals['id'], self.access_token)
media_content = requests.get(url, timeout=5).json()
if media_content.get('media_type'):
if media_content['media_type'] == 'IMAGE':
res = self.env['insta.post'].create({
'name': media_content['id'],
'profile_id':self.id,
})
image_data = base64.b64encode(requests.get(media_content['media_url']).content)
res.write({
'post_image': image_data,
})
if media_content.get('caption'):
res.write({
'caption': media_content['caption'],
})
else:
record = self.env['insta.post'].search([('name', '=', vals['id'])])
record.action_update_post(self.access_token)
else:
raise UserError(_('%s', content['error']['message']))

4
insta_feed_snippet/security/ir.model.access.csv

@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
insta_profile_id,insta.profile.name,model_insta_profile,,1,1,1,1
insta_post_id,insta.post.name,model_insta_post,,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 insta_profile_id insta.profile.name model_insta_profile 1 1 1 1
3 insta_post_id insta.post.name model_insta_post 1 1 1 1

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

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

Loading…
Cancel
Save