[MERGE] Merge project and caladav improverment
bzr revid: sbh@tinyerp.com-20110117124514-q13c62rmhby7zvqr
This commit is contained in:
@@ -237,7 +237,8 @@ class user_preference(osv.osv_memory):
|
||||
'collection' :fields.many2one('document.directory', "Calendar Collection", required=True, domain = [('calendar_collection', '=', True)]),
|
||||
'calendar' :fields.many2one('basic.calendar', 'Calendar', required=True),
|
||||
'service': fields.selection([('webdav','CalDAV')], "Services"),
|
||||
'device' : fields.selection([('other', 'Other'), ('iphone', 'iPhone'), ('android', 'Android based device'),('thunderbird', 'Sunbird/Thunderbird'), ('evolution','Evolution')], "Software/Devices")
|
||||
'device' : fields.selection([('other', 'Other'), ('iphone', 'iPhone'), ('android', 'Android based device'),('thunderbird', 'Sunbird/Thunderbird'), ('evolution','Evolution')], "Software/Devices"),
|
||||
'doc_link':fields.char('Caldav Documentation', size="264", help="The link to Caldav Online Documentation.", readonly=True),
|
||||
}
|
||||
|
||||
def _get_default_calendar(self, cr, uid, context):
|
||||
@@ -260,7 +261,8 @@ class user_preference(osv.osv_memory):
|
||||
'service': 'webdav',
|
||||
'collection' : _get_default_collection,
|
||||
'calendar' : _get_default_calendar,
|
||||
'device' : 'other'
|
||||
'device' : 'other',
|
||||
'doc_link' : 'http://doc.openerp.com/'
|
||||
}
|
||||
|
||||
def open_window(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<field name="calendar" colspan="4" width="250" domain="[('collection_id','=', collection)]" readonly="1"/>
|
||||
<field name="device" colspan="4" width="250" />
|
||||
<separator colspan="4"/>
|
||||
<field name="doc_link" widget="url"/>
|
||||
<group col="4" colspan="4">
|
||||
<label string="" colspan="2"/>
|
||||
<button special="cancel" string="_Cancel" icon="gtk-cancel"/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<form string="Import ICS">
|
||||
<group colspan="4" >
|
||||
<separator string="Select ICS file"/>
|
||||
<field name="file_path" colspan="4" width="300" nolabel="1"/>
|
||||
<field name="file_path" colspan="4" width="500" nolabel="1"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
|
||||
@@ -364,7 +364,12 @@ def Phase_%d():
|
||||
# Allocating Memory for the required Project and Pahses and Resources
|
||||
exec(func_str)
|
||||
Phase = eval('Phase_%d' % phase.id)
|
||||
phase = Task.BalancedProject(Phase)
|
||||
phase = None
|
||||
try:
|
||||
phase = Task.BalancedProject(Phase)
|
||||
except :
|
||||
raise osv.except_osv(_('Error !'),_('Phase Scheduling is not possible.\nProject should have the Start date and member for scheduling.'))
|
||||
|
||||
|
||||
for task_id in task_ids:
|
||||
task = eval("phase.Task_%d" % task_id)
|
||||
@@ -510,7 +515,8 @@ def Project_%d():
|
||||
try:
|
||||
project = Task.BalancedProject(Project)
|
||||
except :
|
||||
raise osv.except_osv(_('Error !'),_('Invalid resource allocation, Phase Scheduling is not possible.\nPlease check project member resource.'))
|
||||
raise osv.except_osv(_('Error !'),_('Phase Scheduling is not possible.\nProject should have the Start date and member for scheduling.'))
|
||||
|
||||
for phase_id in phase_ids:
|
||||
act_phase = phase_pool.browse(cr, uid, phase_id, context=context)
|
||||
resources = act_phase.resource_ids
|
||||
@@ -573,7 +579,10 @@ def Project_%d():
|
||||
#Creating resources using the member of the Project
|
||||
u_ids = [i.id for i in project.members]
|
||||
resource_objs = resource_pool.generate_resources(cr, uid, u_ids, calendar_id, context=context)
|
||||
start_date = datetime.strftime((datetime.strptime(start_date, "%Y-%m-%d")), "%Y-%m-%d")
|
||||
try:
|
||||
start_date = datetime.strftime((datetime.strptime(start_date, "%Y-%m-%d")), "%Y-%m-%d")
|
||||
except:
|
||||
raise osv.except_osv(_('Error !'),_('Task Scheduling is not possible.\nProject should have the Start date for scheduling.'))
|
||||
func_str = ''
|
||||
start = start_date
|
||||
minimum_time_unit = 1
|
||||
@@ -634,7 +643,12 @@ def Project_%d():
|
||||
# Allocating Memory for the required Project and Pahses and Resources
|
||||
exec(func_str)
|
||||
Project = eval('Project_%d' % project.id)
|
||||
project = Task.BalancedProject(Project)
|
||||
project = None
|
||||
try:
|
||||
project = Task.BalancedProject(Project)
|
||||
except :
|
||||
raise osv.except_osv(_('Error !'),_('Phase Scheduling is not possible.\nProject should have the Start date and member for scheduling.'))
|
||||
|
||||
for task_id in task_ids:
|
||||
task = eval("project.Task_%d" % task_id)
|
||||
start_date = task.start.to_datetime()
|
||||
|
||||
Reference in New Issue
Block a user