diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 9c15de00006..ec71b350bd0 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -19,6 +19,8 @@ # ############################################################################## +import time + from openerp.osv import fields, osv from openerp.tools.translate import _ @@ -110,12 +112,11 @@ class crm_meeting(base_state, osv.Model): # ---------------------------------------- # shows events of the day for this user - def needaction_domain_get(self, cr, uid, domain=[], context={}): - return [('date','<=',time.strftime('%Y-%M-%D 23:59:59')), ('date_deadline','>=', time.strftime('%Y-%M-%D 00:00:00')), ('user_id','=',uid)] + def _needaction_domain_get(self, cr, uid, domain=[], context={}): + return [('date', '<=', time.strftime('%Y-%M-%D 23:59:59')), ('date_deadline', '>=', time.strftime('%Y-%M-%D 00:00:00')), ('user_id', '=', uid)] def message_post(self, cr, uid, thread_id, body='', subject=None, type='notification', subtype=None, parent_id=False, attachments=None, context=None, **kwargs): - cal_event_pool = self.pool.get('calendar.event') if isinstance(thread_id, str): thread_id = get_real_ids(thread_id) return super(crm_meeting, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, **kwargs) diff --git a/addons/event/event.py b/addons/event/event.py index 918b7d03925..2eadd7a7d34 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -48,7 +48,7 @@ class event_event(osv.osv): _name = 'event.event' _description = __doc__ _order = 'date_begin' - _inherit = ['mail.thread','ir.needaction_mixin'] + _inherit = ['mail.thread', 'ir.needaction_mixin'] def name_get(self, cr, uid, ids, context=None): if not ids: @@ -289,7 +289,7 @@ class event_registration(osv.osv): """Event Registration""" _name= 'event.registration' _description = __doc__ - _inherit = ['ir.needaction_mixin','mail.thread'] + _inherit = ['mail.thread', 'ir.needaction_mixin'] _columns = { 'id': fields.integer('ID'), 'origin': fields.char('Source Document', size=124,readonly=True,help="Name of the sale order which create the registration"), diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 63df9829aed..cca63e0712e 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -418,7 +418,7 @@ class hr_holidays(osv.osv): # OpenChatter and notifications # ----------------------------- - def needaction_domain_get(self, cr, uid, ids, context=None): + def _needaction_domain_get(self, cr, uid, ids, context=None): emp_obj = self.pool.get('hr.employee') empids = emp_obj.search(cr, uid, [('parent_id.user_id', '=', uid)], context=context) dom = ['&', ('state', '=', 'confirm'), ('employee_id', 'in', empids)] diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index c30ea10c603..7299460554b 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -226,13 +226,15 @@ class hr_timesheet_sheet(osv.osv): # ------------------------------------------------ # OpenChatter methods and notifications # ------------------------------------------------ - + def _needaction_domain_get(self, cr, uid, ids, context=None): emp_obj = self.pool.get('hr.employee') empids = emp_obj.search(cr, uid, [('parent_id.user_id', '=', uid)], context=context) + if not empids: + return False dom = ['&', ('state', '=', 'confirm'), ('employee_id', 'in', empids)] return dom -hr_timesheet_sheet() + class account_analytic_line(osv.osv): _inherit = "account.analytic.line" diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 9a01910cd64..15596566ad2 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -805,13 +805,6 @@ class purchase_order(osv.osv): wf_service.trg_validate(uid, 'purchase.order', old_id, 'purchase_cancel', cr) return orders_info - # -------------------------------------- - # OpenChatter methods and notifications - # -------------------------------------- - - def needaction_domain_get(self, cr, uid, ids, context=None): - return [('state', '=', 'draft')] - class purchase_order_line(osv.osv): def _amount_line(self, cr, uid, ids, prop, arg, context=None): diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 616e1642bf0..314b1b31cb8 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -635,12 +635,6 @@ class sale_order(osv.osv): def action_done(self, cr, uid, ids, context=None): return self.write(cr, uid, ids, {'state': 'done'}, context=context) - # ------------------------------------------------ - # OpenChatter methods and notifications - # ------------------------------------------------ - - def needaction_domain_get(self, cr, uid, ids, context=None): - return [('state', '=', 'draft'), ('user_id', '=', uid)] # TODO add a field price_unit_uos