-
-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by yajo
- Loading branch information
Showing
11 changed files
with
174 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,11 @@ Contributors | |
|
||
- Son Ho [email protected] | ||
|
||
- [Camptocamp] (https://camptocamp.com): | ||
|
||
- Vincent Van Rossem [email protected] | ||
- Italo Lopes [email protected] | ||
|
||
Other credits | ||
------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import wizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
- Raf Ven | ||
- [Trobz] (https://trobz.com): | ||
- Son Ho <[email protected]> | ||
- [Camptocamp] (https://camptocamp.com): | ||
- Vincent Van Rossem <[email protected]> | ||
- Italo Lopes <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,10 @@ | |
|
||
/* | ||
:Author: David Goodger ([email protected]) | ||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ | ||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ | ||
:Copyright: This stylesheet has been placed in the public domain. | ||
Default cascading style sheet for the HTML output of Docutils. | ||
Despite the name, some widely supported CSS2 features are used. | ||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to | ||
customize this style sheet. | ||
|
@@ -275,7 +274,7 @@ | |
margin-left: 2em ; | ||
margin-right: 2em } | ||
|
||
pre.code .ln { color: gray; } /* line numbers */ | ||
pre.code .ln { color: grey; } /* line numbers */ | ||
pre.code, code { background-color: #eeeeee } | ||
pre.code .comment, code .comment { color: #5C6576 } | ||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } | ||
|
@@ -301,7 +300,7 @@ | |
span.pre { | ||
white-space: pre } | ||
|
||
span.problematic, pre.problematic { | ||
span.problematic { | ||
color: red } | ||
|
||
span.section-subtitle { | ||
|
@@ -447,6 +446,11 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2> | |
<li>Son Ho <a class="reference external" href="mailto:sonhd@trobz.com">sonhd@trobz.com</a></li> | ||
</ul> | ||
</li> | ||
<li>[Camptocamp] (<a class="reference external" href="https://camptocamp.com">https://camptocamp.com</a>):<ul> | ||
<li>Vincent Van Rossem <a class="reference external" href="mailto:vincent.vanrossem@camptocamp.com">vincent.vanrossem@camptocamp.com</a></li> | ||
<li>Italo Lopes <a class="reference external" href="mailto:italo.lopes@camptocamp.com">italo.lopes@camptocamp.com</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="section" id="other-credits"> | ||
|
@@ -457,9 +461,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2> | |
<div class="section" id="maintainers"> | ||
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2> | ||
<p>This module is maintained by the OCA.</p> | ||
<a class="reference external image-reference" href="https://odoo-community.org"> | ||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /> | ||
</a> | ||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> | ||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use.</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates xml:space="preserve"> | ||
|
||
<t | ||
t-name="mail_activity_team.Activity" | ||
t-inherit="mail.Activity" | ||
t-inherit-mode="extension" | ||
> | ||
<xpath | ||
expr="//div/div[hasclass('o-mail-Activity-sidebar')]/img" | ||
position="attributes" | ||
> | ||
<attribute name="t-if">activity.user_id</attribute> | ||
</xpath> | ||
<xpath | ||
expr="//div/div/div[hasclass('o-mail-Activity-info')]/span[hasclass('o-mail-Activity-user')]" | ||
position="attributes" | ||
> | ||
<attribute name="t-if">activity.user_id</attribute> | ||
</xpath> | ||
|
||
</t> | ||
|
||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import mail_activity_schedule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class MailActivitySchedule(models.TransientModel): | ||
_inherit = "mail.activity.schedule" | ||
|
||
activity_team_user_id = fields.Many2one( | ||
string="Team user", related="activity_user_id", store=True, readonly=False | ||
) | ||
activity_team_id = fields.Many2one( | ||
"mail.activity.team", | ||
"Team assigned to", | ||
compute="_compute_activity_team_id", | ||
store=True, | ||
readonly=False, | ||
) | ||
|
||
@api.depends("activity_type_id") | ||
def _compute_activity_team_id(self): | ||
for scheduler in self: | ||
if scheduler.activity_type_id.default_team_id: | ||
scheduler.activity_team_id = scheduler.activity_type_id.default_team_id | ||
elif not scheduler.activity_team_id: | ||
scheduler.activity_team_id = ( | ||
self.env["mail.activity"] | ||
.with_context(default_res_model=self.sudo().res_model_id.model) | ||
._get_default_team_id(user_id=scheduler.activity_team_user_id.id) | ||
) | ||
|
||
@api.onchange("activity_team_id") | ||
def _onchange_activity_team_id(self): | ||
if ( | ||
self.activity_team_id | ||
and self.activity_team_user_id not in self.activity_team_id.member_ids | ||
): | ||
if self.activity_team_id.user_id: | ||
new_user_id = self.activity_team_id.user_id | ||
elif len(self.activity_team_id.member_ids) == 1: | ||
new_user_id = self.activity_team_id.member_ids | ||
else: | ||
new_user_id = self.env["res.users"] | ||
self.activity_team_user_id = new_user_id | ||
self.activity_user_id = new_user_id | ||
|
||
@api.onchange("activity_team_user_id") | ||
def _onchange_activity_team_user_id(self): | ||
if not self.activity_team_user_id or ( | ||
self.activity_team_user_id | ||
and self.activity_team_user_id in self.activity_team_id.member_ids | ||
): | ||
return | ||
self.activity_team_id = ( | ||
self.env["mail.activity"] | ||
.with_context(default_res_model=self.sudo().res_model_id.model) | ||
._get_default_team_id(user_id=self.activity_team_user_id.id) | ||
) | ||
|
||
def _action_schedule_activities(self): | ||
return self._get_applied_on_records().activity_schedule( | ||
activity_type_id=self.activity_type_id.id, | ||
automated=False, | ||
summary=self.summary, | ||
note=self.note, | ||
user_id=self.activity_team_user_id.id, | ||
team_user_id=self.activity_team_user_id.id, | ||
team_id=self.activity_team_id.id, | ||
date_deadline=self.date_deadline, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
|
||
<record id="mail_activity_schedule_view_form" model="ir.ui.view"> | ||
<field name="model">mail.activity.schedule</field> | ||
<field name="inherit_id" ref="mail.mail_activity_schedule_view_form" /> | ||
<field name="arch" type="xml"> | ||
<field name="activity_user_id" position="attributes"> | ||
<attribute name="invisible">activity_team_id</attribute> | ||
<attribute | ||
name="required" | ||
add="and not activity_team_id" | ||
separator=" " | ||
/> | ||
</field> | ||
<field name="activity_user_id" position="after"> | ||
<field name="res_model_id" invisible="1" /> | ||
<field | ||
name="activity_team_user_id" | ||
invisible="not activity_team_id" | ||
domain="[('activity_team_ids', '=', activity_team_id)]" | ||
/> | ||
<field | ||
name="activity_team_id" | ||
options="{'no_create': True, 'no_open': True}" | ||
domain="['|', ('res_model_ids', '=', False), ('res_model_ids', '=', res_model_id)]" | ||
/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
</odoo> |