[FIX] crm.meeting: 'duration' is no longer readonly
[FIX] base_calendar: bug when trying to set 'allday' bzr revid: olt@tinyerp.com-20101022131812-1wmx8crh6cdlhodt
This commit is contained in:
parent
2d4c23ef0d
commit
d5d6e2ff0e
|
@ -954,10 +954,8 @@ class calendar_event(osv.osv):
|
|||
value['duration'] = duration
|
||||
|
||||
if allday: # For all day event
|
||||
value = {
|
||||
'duration': 24
|
||||
}
|
||||
duration = 0.0
|
||||
value = {'duration': 24}
|
||||
duration = 24.0
|
||||
|
||||
start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S")
|
||||
if end_date and not duration:
|
||||
|
@ -968,7 +966,7 @@ class calendar_event(osv.osv):
|
|||
elif not end_date:
|
||||
end = start + timedelta(hours=duration)
|
||||
value['date_deadline'] = end.strftime("%Y-%m-%d %H:%M:%S")
|
||||
elif end_date and duration:
|
||||
elif end_date and duration and not allday:
|
||||
# we have both, keep them synchronized:
|
||||
# set duration based on end_date (arbitrary decision: this avoid
|
||||
# getting dates like 06:31:48 instead of 06:32:00)
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<field name="date" string="Start Date" required="1"
|
||||
on_change="onchange_dates(date,duration,False,allday)" />
|
||||
<field name="duration" widget="float_time"
|
||||
on_change="onchange_dates(date,duration,False,allday)" readonly="1" />
|
||||
on_change="onchange_dates(date,duration,False,allday)" />
|
||||
<field name="date_deadline" string="End Date" required="1"
|
||||
on_change="onchange_dates(date,False,date_deadline)" />
|
||||
<field name="location" />
|
||||
|
|
Loading…
Reference in New Issue