From 2156c8368773082f6b685e37d9725dbc696adadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 4 Jan 2013 15:50:30 +0100 Subject: [PATCH] [IMP] hr_holidays: removed 'document created' automatic log, as the request is automatically confirmed, leading to a status update message that is now the first message logged. bzr revid: tde@openerp.com-20130104145030-6t6jtu4chizgs3jk --- addons/hr_holidays/hr_holidays.py | 11 +++++++++-- addons/hr_holidays/hr_holidays_data.xml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index ab078766edc..c7d7867911d 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -283,7 +283,14 @@ class hr_holidays(osv.osv): result['value']['number_of_days_temp'] = 0 return result - + + def create(self, cr, uid, values, context=None): + """ Override to avoid automatic logging of creation """ + if context is None: + context = {} + context = dict(context, mail_create_nolog=True) + return super(hr_holidays, self).create(cr, uid, values, context=context) + def write(self, cr, uid, ids, vals, context=None): check_fnct = self.pool.get('hr.holidays.status').check_access_rights for holiday in self.browse(cr, uid, ids, context=context): @@ -430,7 +437,7 @@ class hr_holidays(osv.osv): def holidays_first_validate_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_post(cr, uid, [obj.id], - _("Request approved, waiting second validation."), context=context) + _("Request approved, waiting second validation."), context=context) class resource_calendar_leaves(osv.osv): _inherit = "resource.calendar.leaves" diff --git a/addons/hr_holidays/hr_holidays_data.xml b/addons/hr_holidays/hr_holidays_data.xml index 365423427c5..2b370f08821 100644 --- a/addons/hr_holidays/hr_holidays_data.xml +++ b/addons/hr_holidays/hr_holidays_data.xml @@ -49,7 +49,7 @@ To Approve hr.holidays - Request confirmed, waiting confirmation + Request created and waiting confirmation Approved