[IMP] sale, purchase, hr_timesheet_sheet, hr_holidays, event, crm_meeting: fixed, improved and cleaned needaction_domain_get.
bzr revid: tde@openerp.com-20121220100005-d0r0se41fx83w38c
This commit is contained in:
parent
fa36ac76ee
commit
d737a7f098
|
@ -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)
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue