[IMP,FIX] calendar, recurrent meeting now work correctlty, Finally grep -Rn -A 2 -B 2 --include=*.py print .
bzr revid: tfr@openerp.com-20110118223502-ws1rruwjrajv1xwz
This commit is contained in:
parent
9e1c88525b
commit
4de0ca454d
|
@ -29,11 +29,7 @@ import pytz
|
|||
import re
|
||||
import time
|
||||
import tools
|
||||
import logging
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
import pprint
|
||||
pp = pprint.PrettyPrinter(indent=4)
|
||||
|
||||
months = {
|
||||
1: "January", 2: "February", 3: "March", 4: "April", \
|
||||
|
@ -1406,9 +1402,6 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
offset, limit, order, context, count)
|
||||
|
||||
res = self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
|
||||
print "search"
|
||||
print args
|
||||
print res
|
||||
return res
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
|
||||
|
@ -1430,34 +1423,20 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
select = ids
|
||||
new_ids = []
|
||||
res = False
|
||||
print "write"
|
||||
print select
|
||||
for event_id in select:
|
||||
real_event_id = base_calendar_id2real_id(event_id)
|
||||
|
||||
|
||||
pp.pprint(vals)
|
||||
|
||||
real_event_id = base_calendar_id2real_id(event_id)
|
||||
|
||||
event = self.browse(cr,uid, event_id, context=context)
|
||||
if('edit_all' in vals):
|
||||
edit_all = vals['edit_all']
|
||||
else:
|
||||
edit_all = event.edit_all or not event.recurrency
|
||||
|
||||
print "edit_all"
|
||||
print edit_all
|
||||
|
||||
|
||||
if edit_all:
|
||||
print "on edit all"
|
||||
else:
|
||||
|
||||
if not edit_all:
|
||||
data = self.read(cr, uid, event_id, ['date', 'date_deadline', \
|
||||
'rrule', 'duration'])
|
||||
if data.get('rrule'):
|
||||
data.update({
|
||||
'recurrent_uid': real_event_id,
|
||||
'recurrent_id': data.get('date'),
|
||||
'rrule_type': 'none',
|
||||
'rrule': ''
|
||||
})
|
||||
|
@ -1467,7 +1446,6 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
context.update({'active_id': new_id, 'active_ids': [new_id]})
|
||||
continue
|
||||
if not real_event_id in new_ids:
|
||||
print "quand est-ce qu'on est là"
|
||||
new_ids.append(real_event_id)
|
||||
|
||||
if vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
|
||||
|
@ -1539,12 +1517,12 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
if fields and 'duration' not in fields:
|
||||
fields.append('duration')
|
||||
|
||||
print select
|
||||
|
||||
for base_calendar_id, real_id in select:
|
||||
#REVET: Revision ID: olt@tinyerp.com-20100924131709-cqsd1ut234ni6txn
|
||||
res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, load=load)
|
||||
print "test"
|
||||
print res
|
||||
if not res:
|
||||
res = {}
|
||||
ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0)
|
||||
if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
|
||||
res['date'] = ls[1]
|
||||
|
@ -1582,11 +1560,10 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
@param context: A standard dictionary for contextual values
|
||||
@return: True
|
||||
"""
|
||||
print ids
|
||||
res = False
|
||||
for event_datas in self.read(cr, uid, ids, ['date', 'rrule', 'exdate', 'edit_all'], context=context):
|
||||
event_id = event_datas['id']
|
||||
edit_all = event_datas['edit_all']
|
||||
edit_all = event_datas.get('edit_all', False)
|
||||
if isinstance(event_id, (int, long)):
|
||||
res = super(calendar_event, self).unlink(cr, uid, event_id, context=context)
|
||||
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
|
||||
|
@ -1599,7 +1576,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
date_new = time.strftime("%Y%m%dT%H%M%S", \
|
||||
time.strptime(date_new, "%Y%m%d%H%M%S"))
|
||||
exdate = (event_datas['exdate'] and (event_datas['exdate'] + ',') or '') + date_new
|
||||
res = self.write(cr, uid, [event_id], {'exdate': exdate})
|
||||
res = super(calendar_event, self).write(cr, uid, [event_id], {'exdate': exdate})
|
||||
else:
|
||||
res = super(calendar_event, self).unlink(cr, uid, [event_id], context=context)
|
||||
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
|
||||
|
@ -1634,9 +1611,6 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
|
|||
alarm_obj = self.pool.get('res.alarm')
|
||||
alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)
|
||||
records = self.browse(cr, uid, [res], context=context)
|
||||
print "create"
|
||||
print real_id2base_calendar_id(records[0].id, records[0].date)
|
||||
|
||||
return real_id2base_calendar_id(records[0].id, records[0].date)
|
||||
|
||||
def do_tentative(self, cr, uid, ids, context=None, *args):
|
||||
|
|
|
@ -240,7 +240,7 @@
|
|||
<field name="location" />
|
||||
<field name="alarm_id" string="Reminder"
|
||||
widget="selection" />
|
||||
<group colspan="2" col="4" >
|
||||
<group colspan="2" col="4" attrs="{'readonly': [('state','=','done')]}">
|
||||
<field name="recurrency"/>
|
||||
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
|
||||
on_change="onchange_edit_all(rrule_type,edit_all)"/>
|
||||
|
@ -344,7 +344,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Recurrency Option" attrs="{'invisible':[('recurrency','=',False)]}">
|
||||
<page string="Recurrency Option" attrs="{'invisible': [('recurrency','=',False)]}">
|
||||
<group col="4" colspan="4" name="rrule">
|
||||
<group col="4" colspan="4">
|
||||
<field name="rrule_type" string="Recurrency period"
|
||||
|
|
|
@ -75,8 +75,8 @@ class crm_meeting(crm_case, osv.osv):
|
|||
size=16, readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
'active': lambda *a: 1,
|
||||
'state': 'draft',
|
||||
'active': 1,
|
||||
'user_id': lambda self, cr, uid, ctx: uid,
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Recurrency Option" attrs="{'invisible': [('recurrency','=',False)], 'readonly': [ ('state','=','done')]}">
|
||||
<page string="Recurrency Option" attrs="{'invisible': [('recurrency','=',False)], 'readonly': [('state','=','done')}">
|
||||
<group col="4" colspan="4" name="rrule">
|
||||
<group col="4" colspan="4">
|
||||
<field name="rrule_type" string="Recurrency period" />
|
||||
|
|
|
@ -126,7 +126,7 @@ class hr_holidays(osv.osv):
|
|||
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True),
|
||||
'case_id': fields.many2one('crm.meeting', 'Meeting'),
|
||||
'case_id': fields.char('Meeting', size=64),
|
||||
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone"),
|
||||
'parent_id': fields.many2one('hr.holidays', 'Parent'),
|
||||
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
|
||||
|
@ -290,7 +290,7 @@ class hr_holidays(osv.osv):
|
|||
for record in self.browse(cr, uid, ids):
|
||||
# Delete the meeting
|
||||
if record.case_id:
|
||||
obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
|
||||
obj_crm_meeting.unlink(cr, uid, [record.case_id])
|
||||
|
||||
# If a category that created several holidays, cancel all related
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
|
Loading…
Reference in New Issue