Browse Source

[FIX] mail_activity_done: several fixes

pull/338/head
mreficent 6 years ago
parent
commit
9d8fc90b9b
  1. 2
      mail_activity_done/__manifest__.py
  2. 2
      mail_activity_done/models/mail_activity.py
  3. 2
      mail_activity_done/models/res_users.py
  4. 4
      mail_activity_done/tests/test_mail_activity_done.py
  5. 2
      mail_activity_done/views/mail_activity_views.xml

2
mail_activity_done/__manifest__.py

@ -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",

2
mail_activity_done/models/mail_activity.py

@ -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):

2
mail_activity_done/models/res_users.py

@ -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,

4
mail_activity_done/tests/test_mail_activity_done.py

@ -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):
act_count = self.employee.sudo(self.employee).activity_user_count()
def test_systray_get_activities(self):
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")

2
mail_activity_done/views/mail_activity_views.xml

@ -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', '&gt;', context_today().strftime('%Y-%m-%d')), ('done', '!=', True)]</attribute>
<attribute name="domain">[('date_deadline', '&gt;', context_today().strftime('%Y-%m-%d')), ('done', '!=', True)]</attribute>
</filter> </filter>
</field> </field>
</record> </record>

Loading…
Cancel
Save