[IMP] mail: app specific notifications

This commit is contained in:
Denis Ledoux 2014-09-17 14:23:02 +02:00
parent 47c3205229
commit 58c1963c9a
2 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,7 @@
<field name="interval_number">1</field>
<field name="interval_type">weeks</field>
<field name="numbercall">-1</field>
<field name="nextcall" eval="(DateTime.now() + timedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S')" />
<field eval="False" name="doall" />
<field eval="'publisher_warranty.contract'" name="model" />
<field eval="'update_notification'" name="function" />

View File

@ -36,6 +36,8 @@ class publisher_warranty_contract(AbstractModel):
nbr_share_users = user_count([("share", "=", True)])
nbr_active_share_users = user_count([("share", "=", True), ("login_date", ">=", limit_date_str)])
user = Users.browse(cr, uid, uid)
domain = [('application', '=', True), ('state', 'in', ['installed', 'to upgrade', 'to remove'])]
apps = self.pool['ir.module.module'].search_read(cr, uid, domain, ['name'])
web_base_url = get_param('web.base.url')
msg = {
@ -49,6 +51,7 @@ class publisher_warranty_contract(AbstractModel):
"version": release.version,
"language": user.lang,
"web_base_url": web_base_url,
"apps": [app['name'] for app in apps],
}
msg.update(self.pool.get("res.company").read(cr, uid, [1], ["name", "email", "phone"])[0])
return msg