[FIX] mail_activity_done: several fixes
This commit is contained in:
parent
d698bba14a
commit
9e44958f98
@ -2,7 +2,7 @@
|
|||||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||||
{
|
{
|
||||||
"name": "Mail Activity Done",
|
"name": "Mail Activity Done",
|
||||||
"version": "12.0.1.0.0",
|
"version": "12.0.1.1.0",
|
||||||
"author": "Eficent,"
|
"author": "Eficent,"
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
|
@ -14,7 +14,7 @@ class MailActivity(models.Model):
|
|||||||
'Completed Date', index=True, readonly=True,
|
'Completed Date', index=True, readonly=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.depends('done')
|
@api.depends('date_deadline', 'done')
|
||||||
def _compute_state(self):
|
def _compute_state(self):
|
||||||
super(MailActivity, self)._compute_state()
|
super(MailActivity, self)._compute_state()
|
||||||
for record in self.filtered(lambda activity: activity.done):
|
for record in self.filtered(lambda activity: activity.done):
|
||||||
|
@ -7,7 +7,7 @@ class ResUsers(models.Model):
|
|||||||
_inherit = 'res.users'
|
_inherit = 'res.users'
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def activity_user_count(self):
|
def systray_get_activities(self):
|
||||||
# Here we totally override the method. Not very nice, but
|
# Here we totally override the method. Not very nice, but
|
||||||
# we should perhaps ask Odoo to add a hook here.
|
# we should perhaps ask Odoo to add a hook here.
|
||||||
query = """SELECT m.id, count(*), act.res_model as model,
|
query = """SELECT m.id, count(*), act.res_model as model,
|
||||||
|
@ -29,7 +29,7 @@ class TestMailActivityDoneMethods(TransactionCase):
|
|||||||
self.act1.done = True
|
self.act1.done = True
|
||||||
self.assertEquals(self.act1.state, 'done')
|
self.assertEquals(self.act1.state, 'done')
|
||||||
|
|
||||||
def test_activity_user_count(self):
|
def test_systray_get_activities(self):
|
||||||
act_count = self.employee.sudo(self.employee).activity_user_count()
|
act_count = self.employee.sudo(self.employee).systray_get_activities()
|
||||||
self.assertEqual(len(act_count), 1,
|
self.assertEqual(len(act_count), 1,
|
||||||
"Number of activities should be equal to one")
|
"Number of activities should be equal to one")
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<attribute name="domain">[('date_deadline', '=', context_today().strftime('%Y-%m-%d')), ('done', '!=', True)]</attribute>
|
<attribute name="domain">[('date_deadline', '=', context_today().strftime('%Y-%m-%d')), ('done', '!=', True)]</attribute>
|
||||||
</filter>
|
</filter>
|
||||||
<filter name="activities_upcoming_all" position="attributes">
|
<filter name="activities_upcoming_all" position="attributes">
|
||||||
<attribute name="domain">[('activity_ids.date_deadline', '>', context_today().strftime('%Y-%m-%d')), ('done', '!=', True)]</attribute>
|
<attribute name="domain">[('date_deadline', '>', context_today().strftime('%Y-%m-%d')), ('done', '!=', True)]</attribute>
|
||||||
</filter>
|
</filter>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
Loading…
Reference in New Issue
Block a user