Browse Source

Jan 17: [FIX] Bug Fixed 'crm_check_approve_limiter'

pull/358/merge
Cybrosys Technologies 3 months ago
parent
commit
63182575bb
  1. 0
      crm_check_approve_limiter/README.rst
  2. 0
      crm_check_approve_limiter/__init__.py
  3. 2
      crm_check_approve_limiter/__manifest__.py
  4. 6
      crm_check_approve_limiter/doc/RELEASE_NOTES.md
  5. 0
      crm_check_approve_limiter/models/__init__.py
  6. 63
      crm_check_approve_limiter/models/crm_lead.py
  7. 1
      crm_check_approve_limiter/models/crm_lead_check_history.py
  8. 0
      crm_check_approve_limiter/models/crm_stage.py
  9. 0
      crm_check_approve_limiter/models/stage_check_list.py
  10. 0
      crm_check_approve_limiter/security/crm_check_approve_limiter_groups.xml
  11. 0
      crm_check_approve_limiter/security/ir.model.access.csv
  12. 0
      crm_check_approve_limiter/static/description/assets/icons/hero.gif
  13. 0
      crm_check_approve_limiter/static/description/assets/modules/1.jpg
  14. 0
      crm_check_approve_limiter/static/description/assets/modules/2.jpg
  15. 0
      crm_check_approve_limiter/static/description/assets/modules/3.jpg
  16. 0
      crm_check_approve_limiter/static/description/assets/modules/4.png
  17. 0
      crm_check_approve_limiter/static/description/assets/modules/5.jpg
  18. 0
      crm_check_approve_limiter/static/description/assets/modules/6.gif
  19. 0
      crm_check_approve_limiter/static/description/assets/screenshots/1.png
  20. 0
      crm_check_approve_limiter/static/description/assets/screenshots/2.png
  21. 0
      crm_check_approve_limiter/static/description/assets/screenshots/3.png
  22. 0
      crm_check_approve_limiter/static/description/assets/screenshots/4.png
  23. 0
      crm_check_approve_limiter/static/description/assets/screenshots/5.png
  24. 0
      crm_check_approve_limiter/static/description/assets/screenshots/6.png
  25. 0
      crm_check_approve_limiter/static/description/assets/screenshots/7.png
  26. 0
      crm_check_approve_limiter/static/description/assets/screenshots/8.png
  27. 0
      crm_check_approve_limiter/static/description/banner.gif
  28. 0
      crm_check_approve_limiter/static/description/icon.png
  29. 0
      crm_check_approve_limiter/static/description/index.html
  30. 0
      crm_check_approve_limiter/views/crm_lead_views.xml
  31. 0
      crm_check_approve_limiter/views/crm_stage_views.xml

0
crm_check_approve_limiter/README.rst

0
crm_check_approve_limiter/__init__.py

2
crm_check_approve_limiter/__manifest__.py

@ -21,7 +21,7 @@
#############################################################################
{
'name': 'CheckList & Approval Process in CRM',
'version': '18.0.1.0.0',
'version': '18.0.1.1.0',
'category': 'CRM',
'summary': 'Manage CRM based on CheckList and Team/Stage and'
'Approval Process to Make Sure Everything Completed In '

6
crm_check_approve_limiter/doc/RELEASE_NOTES.md

@ -4,3 +4,9 @@
#### Version 18.0.1.0.0
#### ADD
- Initial commit for CheckList & Approval Process in CRM
#### 16.01.2025
#### Version 18.0.1.1.0
#### UPDT
- Commit to fix the issue in checklist history creation.

0
crm_check_approve_limiter/models/__init__.py

63
crm_check_approve_limiter/models/crm_lead.py

@ -96,15 +96,18 @@ class CrmLead(models.Model):
and item not in self.check_list_ids:
self.check_list_ids += item
if 'check_list_ids' in vals_set.keys():
group_check = self.env.user. \
has_group('crm_check_approve_limiter.'
'crm_check_approve_manager')
group_check = self.env.user.has_group('crm_check_approve_limiter.crm_check_approve_manager')
user_groups = self.env.user.groups_id
new_ids = self.env['stage.check.list']. \
search([('id', 'in', vals_set['check_list_ids'][-1])])
check_item_id = (self.check_list_ids - new_ids)
check_item2 = (new_ids - self.check_list_ids)
for ch_lst in check_item2:
complete_operations = []
notcomplete_operations = []
for operation in vals_set['check_list_ids']:
if operation[0] == 4: # Add operation
complete_operations.append(operation[1])
elif operation[0] == 3: # Remove operation
notcomplete_operations.append(operation[1])
new_complete_ids = self.env['stage.check.list'].search([('id', 'in', complete_operations)])
new_notcomplete_ids = self.env['stage.check.list'].search([('id', 'in', notcomplete_operations)])
for ch_lst in new_complete_ids:
if (ch_lst.approve_groups_ids and not ch_lst.approve_groups_ids
.filtered(lambda f: f in user_groups) and
not group_check):
@ -114,37 +117,37 @@ class CrmLead(models.Model):
raise ValidationError(f'Only the below specified group'
f' members can complete this task'
f' : {grp_string_t}')
for ch_lst in check_item_id:
for ch_lst in new_notcomplete_ids:
if (ch_lst.approve_groups_ids and not ch_lst.approve_groups_ids
.filtered(
lambda f: f in user_groups) and not group_check):
.filtered(lambda f: f in user_groups) and
not group_check):
grp_string_t = '\n'.join(
map(str, ch_lst.approve_groups_ids.
mapped('full_name')))
raise ValidationError(f'Only the below specified group'
f' members can undo this task'
f' members can complete this task'
f' : {grp_string_t}')
if 'stage_id' not in vals_set.keys() and check_item_id:
for c_item in check_item_id:
if 'stage_id' not in vals_set.keys() and new_complete_ids:
for c_item in new_complete_ids:
vals = {
'lead_id': self.id,
'check_item_id': c_item.id,
'list_action': 'not_complete',
'change_date': datetime.now(),
'user_id': self.env.user.id,
'stage_id': self.stage_id.id
}
'lead_id': self.id,
'check_item_id': c_item.id,
'list_action': 'complete',
'change_date': datetime.now(),
'user_id': self.env.user.id,
'stage_id': self.stage_id.id
}
self.env['crm.lead.check.history'].sudo().create(vals)
elif 'stage_id' not in vals_set.keys() and check_item2:
for c_item in check_item2:
if 'stage_id' not in vals_set.keys() and new_notcomplete_ids:
for c_item in new_notcomplete_ids:
vals = {
'lead_id': self.id,
'check_item_id': c_item.id,
'list_action': 'complete',
'change_date': datetime.now(),
'user_id': self.env.user.id,
'stage_id': self.stage_id.id
}
'lead_id': self.id,
'check_item_id': c_item.id,
'list_action': 'not_complete',
'change_date': datetime.now(),
'user_id': self.env.user.id,
'stage_id': self.stage_id.id
}
self.env['crm.lead.check.history'].sudo().create(vals)
res = super().write(vals_set)
return res

1
crm_check_approve_limiter/models/crm_lead_check_history.py

@ -35,6 +35,7 @@ class CrmLeadCheckHistory(models.Model):
list_action = fields.Selection([('complete', 'Complete'),
('not_complete', 'Not Complete')],
required=True, string="Action",
default='not_complete',
help="Selection field representing "
"the action for the check item.")
user_id = fields.Many2one('res.users', string="User",

0
crm_check_approve_limiter/models/crm_stage.py

0
crm_check_approve_limiter/models/stage_check_list.py

0
crm_check_approve_limiter/security/crm_check_approve_limiter_groups.xml

0
crm_check_approve_limiter/security/ir.model.access.csv

0
crm_check_approve_limiter/static/description/assets/icons/hero.gif

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 278 KiB

0
crm_check_approve_limiter/static/description/assets/modules/1.jpg

Before

Width:  |  Height:  |  Size: 767 KiB

After

Width:  |  Height:  |  Size: 767 KiB

0
crm_check_approve_limiter/static/description/assets/modules/2.jpg

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 138 KiB

0
crm_check_approve_limiter/static/description/assets/modules/3.jpg

Before

Width:  |  Height:  |  Size: 760 KiB

After

Width:  |  Height:  |  Size: 760 KiB

0
crm_check_approve_limiter/static/description/assets/modules/4.png

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

0
crm_check_approve_limiter/static/description/assets/modules/5.jpg

Before

Width:  |  Height:  |  Size: 697 KiB

After

Width:  |  Height:  |  Size: 697 KiB

0
crm_check_approve_limiter/static/description/assets/modules/6.gif

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

0
crm_check_approve_limiter/static/description/assets/screenshots/1.png

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 210 KiB

0
crm_check_approve_limiter/static/description/assets/screenshots/2.png

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

0
crm_check_approve_limiter/static/description/assets/screenshots/3.png

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

0
crm_check_approve_limiter/static/description/assets/screenshots/4.png

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

0
crm_check_approve_limiter/static/description/assets/screenshots/5.png

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

0
crm_check_approve_limiter/static/description/assets/screenshots/6.png

Before

Width:  |  Height:  |  Size: 251 KiB

After

Width:  |  Height:  |  Size: 251 KiB

0
crm_check_approve_limiter/static/description/assets/screenshots/7.png

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 250 KiB

0
crm_check_approve_limiter/static/description/assets/screenshots/8.png

Before

Width:  |  Height:  |  Size: 206 KiB

After

Width:  |  Height:  |  Size: 206 KiB

0
crm_check_approve_limiter/static/description/banner.gif

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

0
crm_check_approve_limiter/static/description/icon.png

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

0
crm_check_approve_limiter/static/description/index.html

0
crm_check_approve_limiter/views/crm_lead_views.xml

0
crm_check_approve_limiter/views/crm_stage_views.xml

Loading…
Cancel
Save