diff options
| author | Damien Bouvy <dbo@odoo.com> | 2015-11-10 11:16:43 +0100 |
|---|---|---|
| committer | Damien Bouvy <dbo@odoo.com> | 2015-11-17 13:01:09 +0100 |
| commit | 608b2f7fbaf9eeb90e6e9b6f3b6ee2a86794e271 (patch) | |
| tree | eabb51d94863c9361d155a18ab4b821e17ba3844 /addons | |
| parent | 65d0faca4d1d8f84db33f307a4367ec13c7037ee (diff) | |
[IMP] mail: update notifications sends/receove Odoo Enterprise information
Our servers now accept contract codes and answers with expiration date and expiration reason.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mail/models/update.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/mail/models/update.py b/addons/mail/models/update.py index e700feff0df..c988611daa3 100644 --- a/addons/mail/models/update.py +++ b/addons/mail/models/update.py @@ -39,6 +39,8 @@ class publisher_warranty_contract(AbstractModel): domain = [('application', '=', True), ('state', 'in', ['installed', 'to upgrade', 'to remove'])] apps = self.pool['ir.module.module'].search_read(cr, SUPERUSER_ID, domain, ['name']) + enterprise_code = get_param('database.enterprise_code') + web_base_url = get_param('web.base.url') msg = { "dbuuid": dbuuid, @@ -52,6 +54,7 @@ class publisher_warranty_contract(AbstractModel): "language": user.lang, "web_base_url": web_base_url, "apps": [app['name'] for app in apps], + "enterprise_code": enterprise_code, } msg.update(self.pool.get("res.company").read(cr, uid, [1], ["name", "email", "phone"])[0]) return msg @@ -102,6 +105,11 @@ class publisher_warranty_contract(AbstractModel): poster.message_post(body=message, subtype='mt_comment', partner_ids=[user.partner_id.id]) except Exception: pass + if result.get('enterprise_info'): + # Update expiration date + self.pool['ir.config_parameter'].set_param(cr, uid, 'database.expiration_date', result.get('enterprise_info').get('expiration_date')) + self.pool['ir.config_parameter'].set_param(cr, uid, 'database.expiration_reason', result.get('enterprise_info').get('expiration_reason')) + except Exception: if cron_mode: return False # we don't want to see any stack trace in cron |
