[IMP] mail, base: add out of office status to user.

This status can be edited by user in preferences, indicates if user
is available or not.
This commit is contained in:
XavierDo
2019-02-07 08:54:33 +00:00
parent 07a261db71
commit b60224c41c
3 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -38,6 +38,7 @@ class Users(models.Model):
moderation_channel_ids = fields.Many2many(
'mail.channel', 'mail_channel_moderator_rel',
string='Moderated channels')
out_of_office_message = fields.Char(string='Out of Office Message')
@api.depends('moderation_channel_ids.moderation', 'moderation_channel_ids.moderator_ids')
@api.multi
@@ -74,10 +75,10 @@ GROUP BY channel_moderator.res_users_id""", [tuple(self.ids)])
init_res = super(Users, self).__init__(pool, cr)
# duplicate list to avoid modifying the original reference
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
type(self).SELF_WRITEABLE_FIELDS.extend(['notification_type'])
type(self).SELF_WRITEABLE_FIELDS.extend(['notification_type', 'out_of_office_message'])
# duplicate list to avoid modifying the original reference
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
type(self).SELF_READABLE_FIELDS.extend(['notification_type'])
type(self).SELF_READABLE_FIELDS.extend(['notification_type', 'out_of_office_message'])
return init_res
@api.model
+5 -1
View File
@@ -12,6 +12,11 @@
<field name="email" position="before">
<field name="notification_type" widget="radio" readonly="0"/>
</field>
<xpath expr="//group[@name='signature']" position="after">
<group string="Out of office" name="out of office">
<field name="out_of_office_message" readonly="0"/>
</group>
</xpath>
</data>
</field>
</record>
@@ -33,6 +38,5 @@
</data>
</field>
</record>
</data>
</odoo>
+1 -1
View File
@@ -354,7 +354,7 @@
</group>
<group name="preference_contact"></group>
</group>
<group>
<group name="signature">
<field name="signature" readonly="0"/>
</group>
<footer>