Skip to content
Snippets Groups Projects
Commit 58c1963c authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[IMP] mail: app specific notifications

parent 47c32052
No related branches found
No related tags found
No related merge requests found
......@@ -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" />
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment