From 5ec345051cbcb8ca812dcfa6653da421fe8004cb Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Thu, 2 Nov 2023 09:35:54 +0100 Subject: [PATCH 1/3] [FIX] project_assignee : fix image field in portal_form view --- project_assignees/views/portal_template.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_assignees/views/portal_template.xml b/project_assignees/views/portal_template.xml index b0ef75c..36eed1d 100644 --- a/project_assignees/views/portal_template.xml +++ b/project_assignees/views/portal_template.xml @@ -7,7 +7,7 @@
- Contact + Contact Contact
-- 2.49.1 From db6c8216982e7bc318f4e3254d65988868699cea Mon Sep 17 00:00:00 2001 From: Laetitia Da Costa Date: Thu, 16 Nov 2023 11:23:58 +0100 Subject: [PATCH 2/3] [IMP]project_assignees:notify assignees --- project_assignees/__init__.py | 1 + project_assignees/__manifest__.py | 2 +- project_assignees/models/__init__.py | 3 +- project_assignees/models/mail_thread.py | 42 +++++++++++++++++++ project_assignees/models/project_task.py | 2 +- project_followers/__init__.py | 0 project_followers/__manifest__.py | 26 ++++++++++++ .../js/suggested_recipient_info_custom.js | 17 ++++++++ 8 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 project_assignees/models/mail_thread.py create mode 100644 project_followers/__init__.py create mode 100644 project_followers/__manifest__.py create mode 100644 project_followers/static/js/suggested_recipient_info_custom.js diff --git a/project_assignees/__init__.py b/project_assignees/__init__.py index cde864b..9364503 100644 --- a/project_assignees/__init__.py +++ b/project_assignees/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- from . import models +from . import models diff --git a/project_assignees/__manifest__.py b/project_assignees/__manifest__.py index d7b8d1e..46066d1 100644 --- a/project_assignees/__manifest__.py +++ b/project_assignees/__manifest__.py @@ -3,7 +3,7 @@ { "name": "project_assignees", - "version": "14.0.1.1.0", + "version": "14.0.1.2.0", "author": "Elabore", "website": "https://github.com/elabore-coop/project-tools", "maintainer": "Stéphan Sainléger", diff --git a/project_assignees/models/__init__.py b/project_assignees/models/__init__.py index 853e5dd..008af44 100644 --- a/project_assignees/models/__init__.py +++ b/project_assignees/models/__init__.py @@ -1,2 +1,3 @@ -from . import project_task \ No newline at end of file +from . import project_task +from . import mail_thread diff --git a/project_assignees/models/mail_thread.py b/project_assignees/models/mail_thread.py new file mode 100644 index 0000000..fda5423 --- /dev/null +++ b/project_assignees/models/mail_thread.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models + +class MailThread(models.AbstractModel): + _inherit = 'mail.thread' + + def _message_auto_subscribe_followers(self, updated_values, default_subtype_ids): + """ Overrides mail.thread._message_auto_subscribe_followers() only in a project task context. + + In a project task context : user(s) to notify are the assignees (field assignee_ids not user_id) + In other context : use parent _message_auto_subscribe_followers and notify the user identify by the field user_id + + Return a list tuples containing ( + partner ID, + subtype IDs (or False if model-based default subtypes), + QWeb template XML ID for notification (or False is no specific + notification is required), + ), aka partners and their subtype and possible notification to send + using the auto subscription mechanism linked to updated values. + + :param updated_values: see ``_message_auto_subscribe`` + :param default_subtype_ids: coming from ``_get_auto_subscription_subtypes`` + """ + + if self._name == 'project.task' : + results = [] + assignee_ids = updated_values.get('assignee_ids') + if assignee_ids and len(assignee_ids) == 1 and assignee_ids[0][0] == 6: + user_ids = assignee_ids[0][-1] + users = self.env['res.users'].sudo().browse(user_ids) + if users : + for user in users : + try: + if user.active: + results.append((user.partner_id.id, default_subtype_ids, 'mail.message_user_assigned' if user != self.env.user else False)) + except: + pass + return results + else: + return super()._message_auto_subscribe_followers(updated_values, default_subtype_ids) \ No newline at end of file diff --git a/project_assignees/models/project_task.py b/project_assignees/models/project_task.py index 598f2b4..8140799 100644 --- a/project_assignees/models/project_task.py +++ b/project_assignees/models/project_task.py @@ -5,5 +5,5 @@ from odoo import models, fields class Task(models.Model): _inherit = "project.task" - assignee_ids = fields.Many2many('res.users', 'assignee_ids_rel', string='Assignees') + assignee_ids = fields.Many2many('res.users', 'assignee_ids_rel', string='Assignees', tracking=True) diff --git a/project_followers/__init__.py b/project_followers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/project_followers/__manifest__.py b/project_followers/__manifest__.py new file mode 100644 index 0000000..2af4110 --- /dev/null +++ b/project_followers/__manifest__.py @@ -0,0 +1,26 @@ +{ + 'name': 'Project Followers', + 'version': '14.0.1.0.0', + 'description': 'disable partner checked by while sending a message in project task chatter', + 'summary': '', + 'author': '', + 'website': '', + 'license': 'LGPL-3', + 'category': '', + 'depends': [ + 'base','mail' + ], + 'data': [ + '' + ], + 'demo': [ + '' + ], + 'auto_install': False, + 'application': False, + "assets": { + "web.assets_frontend": [ + "project_followers/static/src/js/suggested_recipient_info_custom.js", + ], + }, +} \ No newline at end of file diff --git a/project_followers/static/js/suggested_recipient_info_custom.js b/project_followers/static/js/suggested_recipient_info_custom.js new file mode 100644 index 0000000..fcc8549 --- /dev/null +++ b/project_followers/static/js/suggested_recipient_info_custom.js @@ -0,0 +1,17 @@ +odoo.define('project_followers.suggested_recipient_info_custom', function (require) { + 'use strict'; + + const SuggestedRecipientInfo = require('mail.suggested_recipient_info'); + + SuggestedRecipientInfo.include({ + /** + * @private + * @returns {boolean} + */ + _computeIsSelected: function () { + // Votre code de surcharge ici + // N'oubliez pas d'appeler la fonction d'origine si nécessaire + return this.partner ? this.isSelected : false; + }, + }); +}); \ No newline at end of file -- 2.49.1 From 162b7f46a3c9d81c4ae2e1066a421062e8ce96f3 Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Thu, 16 Nov 2023 15:29:17 +0100 Subject: [PATCH 3/3] [IMP] project_average_acceptable_time : add explanation and precision --- .../__manifest__.py | 2 +- project_average_acceptable_time/i18n/fr.po | 20 +++++++++++++++---- .../views/portal_home_template.xml | 8 ++++++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/project_average_acceptable_time/__manifest__.py b/project_average_acceptable_time/__manifest__.py index e4e95df..e3318d4 100644 --- a/project_average_acceptable_time/__manifest__.py +++ b/project_average_acceptable_time/__manifest__.py @@ -3,7 +3,7 @@ { "name": "project_average_acceptable_time", - "version": "12.0.1.0.0", + "version": "14.0.1.0.0", "author": "Elabore", "website": "https://github.com/elabore-coop/project-tools", "maintainer": "Clément Thomas", diff --git a/project_average_acceptable_time/i18n/fr.po b/project_average_acceptable_time/i18n/fr.po index 12a7e38..bbfdc8e 100644 --- a/project_average_acceptable_time/i18n/fr.po +++ b/project_average_acceptable_time/i18n/fr.po @@ -17,13 +17,19 @@ msgstr "" #. module: project_average_acceptable_time #: model_terms:ir.ui.view,arch_db:project_average_acceptable_time.portal_my_home_average_acceptable_time -msgid "Average acceptable time:" -msgstr "Temps moyen acceptable:" +msgid "Average acceptable time of :" +msgstr "Temps moyen acceptable de :" + +#. module: project_project_view_kanban_inherit_average_acceptable_time +#: model_terms:ir.ui.view,arch_db:project_average_acceptable_time.portal_my_home_average_acceptable_time +msgid "The average acceptable time is the time allowed which does not require validation to start carrying out the task. For example, if you choose 30 min then all tasks not exceeding 30 min can be processed directly without waiting for validation from you." +msgstr "Le temps moyen acceptable est le temps accordé qui ne nécessite pas de validation pour lancer la réalisation de la tâche. Par exemple, si vous choisissez 30min alors, toutes les tâches ne dépassant pas 30 min, peuvent être traitées directement sans attendre une validation de votre part." + #. module: project_average_acceptable_time #: model_terms:ir.ui.view,arch_db:project_average_acceptable_time.portal_my_home_average_acceptable_time -msgid "Average acceptable time" -msgstr "Temps moyen acceptable" +msgid "Average acceptable time of" +msgstr "Temps moyen acceptable de" #. module: project_average_acceptable_time #: model_terms:ir.ui.view,arch_db:project_average_acceptable_time.project_project_view_kanban_inherit_average_acceptable_time @@ -40,7 +46,13 @@ msgstr "Temps moyen acceptable" msgid "Average acceptable time (h)" msgstr "Temps moyen acceptable (h)" +#. module: project_average_acceptable_time +#: model_terms:ir.ui.view,arch_db:project_average_acceptable_time.portal_my_details_average_acceptable_time +msgid "ex : number format should be 0.5 for 30 min (and not 0,5)" +msgstr "ex : le format doit être 0.5 pour 30 min (et pas 0,5)
- Average acceptable time: +
+ Average acceptable time of : + +
@@ -13,12 +16,13 @@
+

ex : number format should be 0.5 for 30 min (and not 0,5)

-- 2.49.1