[IMP]: crm: Improvement in meeting for removing dependency from crm.case
bzr revid: rpa@tinyerp.com-20100503125901-of7z6oa4oannqg39
This commit is contained in:
parent
ee4052bc1a
commit
8ecd574c3a
|
@ -1101,7 +1101,9 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
'end_date': fields.date('Repeat Until'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel',\
|
||||
'event_id', 'attendee_id', 'Attendees'),
|
||||
'allday': fields.boolean('All Day')
|
||||
'allday': fields.boolean('All Day'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to \
|
||||
true, it will allow you to hide the event alarm information without removing it.")
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
@ -1110,6 +1112,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
'freq': lambda *x: 'None',
|
||||
'select1': lambda *x: 'date',
|
||||
'interval': lambda *x: 1,
|
||||
'active': lambda *x: 1,
|
||||
}
|
||||
|
||||
def open_event(self, cr, uid, ids, context=None):
|
||||
|
@ -1404,6 +1407,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
event_id = base_calendar_id2real_id(event_id)
|
||||
if not event_id in new_ids:
|
||||
new_ids.append(event_id)
|
||||
|
||||
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
|
||||
if vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'):
|
||||
alarm_obj = self.pool.get('res.alarm')
|
||||
|
|
|
@ -19,12 +19,11 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import crm
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta
|
||||
from tools.translate import _
|
||||
from base_calendar import base_calendar
|
||||
from datetime import datetime, timedelta
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
import time
|
||||
|
||||
|
||||
class crm_phonecall(osv.osv):
|
||||
|
@ -43,10 +42,15 @@ class crm_meeting(osv.osv):
|
|||
|
||||
_columns = {
|
||||
# From crm.case
|
||||
'name': fields.char('Summary', size=124, required=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
|
||||
domain="[('partner_id','=',partner_id)]"),
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
|
||||
select=True, help='Sales team to which Case belongs to.\
|
||||
Define Responsible user and Email account for mail gateway.'),
|
||||
'email_from': fields.char('Email', size=128, help="These people will receive email."),
|
||||
|
||||
# Meeting fields
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Meeting Type', \
|
||||
domain="[('object_id.model', '=', 'crm.meeting')]", \
|
||||
|
@ -108,7 +112,79 @@ class crm_meeting(osv.osv):
|
|||
}
|
||||
|
||||
return value
|
||||
|
||||
# From crm.case
|
||||
|
||||
def case_close(self, cr, uid, ids, *args):
|
||||
"""Closes Case
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of case Ids
|
||||
@param *args: Tuple Value for additional Params
|
||||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self._history(cr, uid, cases, _('Close'))
|
||||
self.write(cr, uid, ids, {'state': 'done',
|
||||
'date_closed': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
})
|
||||
#
|
||||
# We use the cache of cases to keep the old case state
|
||||
#
|
||||
self._action(cr, uid, cases, 'done')
|
||||
return True
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""Opens Case
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of case Ids
|
||||
@param *args: Tuple Value for additional Params
|
||||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, cases, _('Open'))
|
||||
|
||||
for case in cases:
|
||||
data = {'state': 'open', 'active': True}
|
||||
if not case.user_id:
|
||||
data['user_id'] = uid
|
||||
self.write(cr, uid, case.id, data)
|
||||
self._action(cr, uid, cases, 'open')
|
||||
return True
|
||||
|
||||
def case_cancel(self, cr, uid, ids, *args):
|
||||
"""Cancels Case
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of case Ids
|
||||
@param *args: Tuple Value for additional Params
|
||||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self._history(cr, uid, cases, _('Cancel'))
|
||||
self.write(cr, uid, ids, {'state': 'cancel',
|
||||
'active': True})
|
||||
self._action(cr, uid, cases, 'cancel')
|
||||
return True
|
||||
|
||||
def case_reset(self, cr, uid, ids, *args):
|
||||
"""Resets case as draft
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of case Ids
|
||||
@param *args: Tuple Value for additional Params
|
||||
"""
|
||||
cases = self.browse(cr, uid, ids)
|
||||
cases[0].state # to fill the browse record cache
|
||||
self._history(cr, uid, cases, _('Draft'))
|
||||
self.write(cr, uid, ids, {'state': 'draft', 'active': True})
|
||||
self._action(cr, uid, cases, 'draft')
|
||||
return True
|
||||
|
||||
crm_meeting()
|
||||
|
||||
class calendar_attendee(osv.osv):
|
||||
|
|
|
@ -132,6 +132,9 @@
|
|||
<button name="case_close" string="Done"
|
||||
states="open" type="object"
|
||||
icon="gtk-jump-to" />
|
||||
<button name="case_reset" string="Reset to Unconfirmed"
|
||||
states="open,done,cancel" type="object"
|
||||
icon="gtk-convert" />
|
||||
<button name="case_open" string="Confirm"
|
||||
states="draft" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
|
@ -214,7 +217,7 @@
|
|||
<field name="date" string="Meeting Date" />
|
||||
<field name="duration" />
|
||||
<field name="user_id" />
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue