@ -0,0 +1,53 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
All in One Multi Followers |
||||
|
========================== |
||||
|
The module is used to add or remove the multi followers in the whole odoo model |
||||
|
by dynamic actions. If you want to set multiple followers in your model, |
||||
|
it is helpful to select multiple followers when clicking the action. |
||||
|
After adding or removing the followers, it will affect the model. |
||||
|
So in this way, you can add or remove multiple followers |
||||
|
from the whole odoo quickly. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configurations needed |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Affero General Public License v3.0 (AGPL v3) |
||||
|
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer : (V18) Nivedhya T, |
||||
|
(V17) Ajith V , |
||||
|
(V16) Junaidul Ansar M , |
||||
|
Contact: odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-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 AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import models |
||||
|
from . import wizard |
@ -0,0 +1,51 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-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 AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
{ |
||||
|
'name': 'All in One Multi Followers', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Extra Tools', |
||||
|
'summary': 'The module used to add or remove the multi followers in the ' |
||||
|
'whole odoo models by dynamic actions.', |
||||
|
'description': ' The module used to add or remove the multi followers in ' |
||||
|
'the whole odoo models by dynamic actions.If you want to set' |
||||
|
' a multi followers in your model this is helpful you to ' |
||||
|
'select the multi followers when clicking the action. ' |
||||
|
'After adding or removing the followers it will affect' |
||||
|
' the model. So in this way you can add or remove multiple' |
||||
|
' followers in the whole odoo quickly.', |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['base'], |
||||
|
'data': [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'views/multi_follower_views.xml', |
||||
|
'views/res_config_settings_views.xml', |
||||
|
'wizard/follower_adding_removing_views.xml', |
||||
|
], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'application': False, |
||||
|
'auto_install': False |
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
## Module <all_in_one_multi_followers> |
||||
|
|
||||
|
#### 23.06.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
|
||||
|
- Initial Commit All in One Multi Followers. |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-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 AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from . import multi_follower |
@ -0,0 +1,205 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-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 AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################### |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class MultiFollower(models.Model): |
||||
|
"""Creating multi follower creation model""" |
||||
|
_name = 'multi.follower' |
||||
|
_description = 'Multi Follower' |
||||
|
_rec_name = 'action_name' |
||||
|
|
||||
|
action_name = fields.Char(string="Action Name", |
||||
|
help='This is the action name. So this name is ' |
||||
|
'visible under the the appropriate' |
||||
|
' model action.', |
||||
|
required=True) |
||||
|
applied_to_ids = fields.Many2many('ir.model', |
||||
|
string='Applied To', |
||||
|
help='Select the model in which you ' |
||||
|
'want to apply this action.', |
||||
|
required=True) |
||||
|
enabled_value = fields.Boolean(string="Create Action", |
||||
|
help="Enabling and hiding the " |
||||
|
"create action button.", |
||||
|
default=True, |
||||
|
copy=False) |
||||
|
created_action_names = fields.Char(string="Created Action Names", |
||||
|
compute="_compute_created_action_names", |
||||
|
help='If the name is visible to the line' |
||||
|
' its created the action. If its ' |
||||
|
'not its deleted the action.') |
||||
|
states = fields.Selection([('draft', 'Draft'), |
||||
|
('running', 'Running'), ('cancel', 'Cancelled')], |
||||
|
string='State', help='State of the action', |
||||
|
default="draft", copy=False) |
||||
|
window_action_ids = fields.Many2many('ir.actions.act_window', |
||||
|
string="Window Actions", |
||||
|
helps="Related Window Actions") |
||||
|
|
||||
|
@api.depends('action_name') |
||||
|
def _compute_created_action_names(self): |
||||
|
""" |
||||
|
Computes and updates the `created_action_names` field with the names |
||||
|
of the actions that have been created for the current follower. |
||||
|
|
||||
|
This method depends on the `action_name` field and is triggered when |
||||
|
the `action_name` is modified. It retrieves the window actions associated |
||||
|
with the current follower and stores their names as a comma-separated |
||||
|
string in the `created_action_names` field. |
||||
|
|
||||
|
Key Steps: |
||||
|
1. For each follower record, it searches for window actions (`ir.actions.act_window`) |
||||
|
that match the action IDs in `follower.window_action_ids`. |
||||
|
2. The names of the found actions are extracted using `mapped('name')` |
||||
|
and joined into a single string, separated by commas. |
||||
|
3. The resulting string is stored in the `created_action_names` field |
||||
|
for display purposes. |
||||
|
|
||||
|
Returns: |
||||
|
None |
||||
|
""" |
||||
|
for follower in self: |
||||
|
actions = self.env['ir.actions.act_window'].search( |
||||
|
[('id', 'in', follower.window_action_ids.ids)]) |
||||
|
follower.created_action_names = ', '.join(actions.mapped('name')) |
||||
|
|
||||
|
def action_create(self): |
||||
|
""" |
||||
|
Creates a new action in the selected model when the 'Add Action' button |
||||
|
is clicked. |
||||
|
|
||||
|
This method performs the following tasks: |
||||
|
1. Disables the `enabled_value` field and sets the `states` field to 'running'. |
||||
|
2. Loops through the `applied_to_ids` (the models to which the action will |
||||
|
be applied) and creates a new window action (`ir.actions.act_window`) |
||||
|
for each model. |
||||
|
3. The newly created window action is associated with the |
||||
|
'follower.adding.removing' model and its corresponding form view. |
||||
|
4. The created window action is linked to the current record by adding it |
||||
|
to the `window_action_ids` field. |
||||
|
5. Once the actions are created, it reloads the client interface to reflect |
||||
|
the changes. |
||||
|
|
||||
|
Returns: |
||||
|
dict: A dictionary to trigger a client action that reloads the current view |
||||
|
to reflect the newly created actions. |
||||
|
|
||||
|
Key Fields: |
||||
|
- `enabled_value`: Set to `False` to indicate the action creation process is |
||||
|
ongoing. |
||||
|
- `states`: Updated to 'running' to show the action is in progress. |
||||
|
- `action_name`: The name used for the new actions. |
||||
|
- `applied_to_ids`: The models to which the new actions are applied. |
||||
|
- `window_action_ids`: Updated to include the newly created window actions. |
||||
|
|
||||
|
Returns: |
||||
|
A reload action to refresh the view. |
||||
|
""" |
||||
|
self.enabled_value = False |
||||
|
self.states = 'running' |
||||
|
# Check if action_name has changed and update existing actions |
||||
|
for model_id in self.applied_to_ids: |
||||
|
res = self.env['ir.actions.act_window'].create({ |
||||
|
'name': self.action_name, |
||||
|
'res_model': 'follower.adding.removing', |
||||
|
'type': 'ir.actions.act_window', |
||||
|
'view_mode': 'form', |
||||
|
'binding_model_id': model_id.id, |
||||
|
'target': 'new', |
||||
|
'view_id': self.env.ref( |
||||
|
'all_in_one_multi_followers.' |
||||
|
'follower_adding_removing_view_form').id, |
||||
|
'binding_view_types': 'list' |
||||
|
}) |
||||
|
self.window_action_ids += res |
||||
|
return { |
||||
|
'type': 'ir.actions.client', |
||||
|
'tag': 'reload', |
||||
|
} |
||||
|
|
||||
|
def action_unlink(self): |
||||
|
""" |
||||
|
Removes the contextual actions created for server actions. |
||||
|
|
||||
|
This method performs the following tasks: |
||||
|
1. Sets the `states` field to 'cancel', indicating that the action removal |
||||
|
process is in progress or has been completed. |
||||
|
2. Deletes all window actions associated with the current record by unlinking |
||||
|
them through the `window_action_ids` field. |
||||
|
3. Clears the `window_action_ids` field by setting it to `False`. |
||||
|
4. Resets the `enabled_value` field to `True`, enabling the functionality for |
||||
|
future use. |
||||
|
5. Returns an action to reload the client interface to reflect the removal of |
||||
|
the actions. |
||||
|
|
||||
|
Returns: |
||||
|
dict: A dictionary to trigger a client action that reloads the current view |
||||
|
to reflect the removal of the actions. |
||||
|
|
||||
|
Key Fields: |
||||
|
- `states`: Updated to 'cancel' to indicate that the action removal is |
||||
|
completed or in progress. |
||||
|
- `window_action_ids`: Unlinked (deleted) to remove the associated actions. |
||||
|
- `enabled_value`: Set to `True` to re-enable the functionality for adding |
||||
|
actions in the future. |
||||
|
|
||||
|
Returns: |
||||
|
A reload action to refresh the view. |
||||
|
""" |
||||
|
self.states = 'cancel' |
||||
|
self.window_action_ids.unlink() |
||||
|
self.window_action_ids = False |
||||
|
self.enabled_value = True |
||||
|
return { |
||||
|
'type': 'ir.actions.client', |
||||
|
'tag': 'reload', |
||||
|
} |
||||
|
|
||||
|
def unlink(self): |
||||
|
""" |
||||
|
Overrides the unlink method to remove associated active actions before |
||||
|
deleting the record. |
||||
|
|
||||
|
This method performs the following tasks: |
||||
|
1. Iterates over each record in the current recordset (`self`). |
||||
|
2. For each record, it calls the `action_unlink` method to remove any |
||||
|
active actions associated with that record. |
||||
|
3. After removing the active actions, it proceeds to call the original |
||||
|
`unlink` method from the parent class to delete the record itself. |
||||
|
|
||||
|
Key Steps: |
||||
|
- Ensures that all associated active actions are properly cleaned up |
||||
|
before the record is deleted. |
||||
|
- Maintains the integrity of related actions by explicitly handling their |
||||
|
removal. |
||||
|
|
||||
|
Returns: |
||||
|
None |
||||
|
|
||||
|
Note: |
||||
|
- This method should be used when you want to ensure that any associated |
||||
|
actions are removed before the record is deleted from the database. |
||||
|
""" |
||||
|
for rec in self: |
||||
|
rec.action_unlink() |
||||
|
super().unlink() |
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 776 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 89 KiB |