2018-08-23 01:26:55 +02:00
|
|
|
# Copyright 2018 Eficent <http://www.eficent.com>
|
|
|
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
|
|
|
from odoo import api, fields, models
|
|
|
|
|
|
|
|
|
|
|
|
class MailActivity(models.Model):
|
|
|
|
|
|
|
|
_inherit = 'mail.activity'
|
|
|
|
|
|
|
|
done = fields.Boolean(default=False)
|
|
|
|
state = fields.Selection(selection_add=[
|
|
|
|
('done', 'Done')], compute='_compute_state')
|
|
|
|
date_done = fields.Date(
|
|
|
|
'Completed Date', index=True, readonly=True,
|
|
|
|
)
|
|
|
|
|
2019-03-25 16:10:21 +01:00
|
|
|
@api.depends('date_deadline', 'done')
|
2018-08-23 01:26:55 +02:00
|
|
|
def _compute_state(self):
|
|
|
|
super(MailActivity, self)._compute_state()
|
|
|
|
for record in self.filtered(lambda activity: activity.done):
|
|
|
|
record.state = 'done'
|