-
-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.0][ADD][mail_activity_team] #330
Conversation
@mreficent Can you please add tests? |
@mreficent We also need a button in the team that counts how many mail activities meet the model and members of the team, but have no team assigned. The user should be able to click this button to start a wizard that should update, for these activities, the new team. |
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" | ||
access_mail_activity_team_all,mail.activity.team.all,model_mail_activity_team,,1,0,0,0 | ||
access_mail_activity_team_user,mail.activity.team.user,model_mail_activity_team,base.group_user,1,1,0,0 | ||
access_mail_activity_team_system_user,mail.activity.team.system.user,model_mail_activity_team,base.group_system_user,1,1,1,1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base.group_system_user does not exist use instead base.group_system
<record id="mail_activity_rule_my_team" model="ir.rule"> | ||
<field name="name">mail.activity: user: my team</field> | ||
<field name="model_id" ref="mail.model_mail_activity"/> | ||
<field name="domain_force">['|', '&'('team_id', '=', False),('user_id', '=', user.id),('team_id', '=', user.team_ids.ids)]</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="domain_force">['|', '&'('team_id', '=', False),('user_id', '=', user.id),('team_id', '=', user.team_ids.ids)]</field> | |
<field name="domain_force">["|", ('team_id', 'in', user.activity_team_ids.ids), "&", ('team_id', '=', False), ('user_id', '=', user.id)]</field> |
<field name="name"/> | ||
</group> | ||
<group name="models"> | ||
<field name="res_model_ids" widget="many2many_tags"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="res_model_ids" widget="many2many_tags"/> | |
<field name="res_model_ids" widget="many2many_tags" | |
options="{'no_create': True, 'no_open': True}"/> |
|
||
name = fields.Char(string='Name', required=True, translate=True) | ||
active = fields.Boolean(string='Active', default=True) | ||
res_model_ids = fields.Many2many('ir.model', string='Used models') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mreficent can you check how it would be possible to add a domain here that only shows the models that inherit the activity.mixin? Otherwise it is very confusing for the user to see all models here, most of which do not allow to add activities.
6c3bbf1
to
92da1e7
Compare
The |
_inherit = "mail.activity" | ||
|
||
def _get_default_team_id(self): | ||
res_model = self.env.context.get('default_res_model', False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it matter if you get False
or None
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dict.get
returns None
if the key doesn't exist and you didn't pass another default. So to rephrase: What's the , False)
part good for?
if team.res_model_ids: | ||
domain.append(('res_model_id', 'in', team.res_model_ids.ids)) | ||
team.count_missing_activities = len( | ||
activity_model.search(domain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass count=True
instead of using len
on the results
default=0, | ||
) | ||
|
||
def action_missing_activities(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function name sounds a bit misleading, shouldn't it be something like assign_team_to_unassigned_activities
?
92da1e7
to
8f47f02
Compare
@hbrunn changes done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="arch" type="xml"> | ||
<data> | ||
<field name="signature" position="before"> | ||
<field name="activity_team_ids" widget="many2many_tags"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you test in local, you see that the label is displayed. Maybe it's not displayed due to another module of the repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's due to mail_digest
module
that's how it works now. but I will improve it |
yes, after removing the user and selecting a team, the first time no team show up. |
7501f48
to
180ca02
Compare
180ca02
to
2043e3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting module!
However, I miss the filter My teams activities on the dashboard. This way, I know which activities are assigned to my team.
Also, If only one member of the team exists, you should assign it automatically.
ade4bef
to
cf57f33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
37ee943
to
3da7001
Compare
3da7001
to
de777d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
merge? 🤔 |
This module adds the possibility to assign teams to activities.
Usage
To set up new teams:
#. Go to Settings / Activate developer mode
#. Go to Settings / Technical / Email / Activity Teams
#. Create a new Team and assign (optionally) the models in which it will
be used, and the members of the team.
You can also assign a user to Activity teams going to
Settings / Users & Companies / Users, and in the Preferences tab, field
Activity Teams.
When you create a new activity the application will propose the user's
assigned team.
You can report on the activities assigned to a team going to
Dashboards / Activities, and then filter by a specific team or group by
teams.