From 7e1f0bd85f8365556eb021617141f2f98bd7345e Mon Sep 17 00:00:00 2001
From: "nch@tinyerp.com" <>
Date: Tue, 9 Feb 2010 15:50:13 +0530
Subject: [PATCH 1/7] [IMP]:project_gtd view put on_change on planned hrs
bzr revid: nch@tinyerp.com-20100209102013-x931gaqlf8cq5ju1
---
addons/project/project.py | 16 ++++++++--------
addons/project_gtd/project_gtd_view.xml | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/addons/project/project.py b/addons/project/project.py
index 9cd0dc65647..fd0b5bec06e 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -36,7 +36,7 @@ class project_task_type(osv.osv):
'sequence': fields.integer('Sequence'),
}
_order = 'sequence'
-
+
_defaults = {
'sequence': lambda *args: 1
}
@@ -191,7 +191,7 @@ class project(osv.osv):
self.pool.get('project.task').copy(cr, uid, tasks_id, default = {
'project_id': new_id,
'active':True}, context=context)
- child_ids = self.search(cr, uid, [('parent_id','=', proj.id)])
+ child_ids = self.search(cr, uid, [('parent_id','=', proj.id)])
if child_ids:
self.duplicate_template(cr, uid, child_ids, context={'parent_id':new_id})
return result
@@ -204,7 +204,7 @@ class project(osv.osv):
tasks_id = [x[0] for x in cr.fetchall()]
if tasks_id:
self.pool.get('project.task').write(cr, uid, tasks_id, {'active': value}, context)
- child_ids = self.search(cr, uid, [('parent_id','=', proj.id)])
+ child_ids = self.search(cr, uid, [('parent_id','=', proj.id)])
if child_ids:
self.setActive(cr, uid, child_ids, value, context)
return True
@@ -238,7 +238,7 @@ class task(osv.osv):
res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
return res
- def onchange_planned(self, cr, uid, ids, planned, effective, date_start,occupation_rate=0.0):
+ def onchange_planned(self, cr, uid, ids, planned=0.0, effective=0.0, date_start=None,occupation_rate=0.0):
result = {}
for res in self.browse(cr, uid, ids):
if date_start and planned:
@@ -249,7 +249,7 @@ class task(osv.osv):
hrs = (planned)/(occupation_rate)
work_times = self.pool.get('resource.calendar').interval_get(cr, uid, resource_obj.calendar_id.id or False, d, hrs or 0.0, resource_obj.id)
result['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
- result['remaining_hours'] = planned-effective
+ result['remaining_hours'] = planned-effective
return {'value':result}
def _default_project(self, cr, uid, context={}):
@@ -272,7 +272,7 @@ class task(osv.osv):
if task['date_start'] > task['date_end']:
return False
return True
-
+
_columns = {
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the task without removing it."),
'name': fields.char('Task Summary', size=128, required=True),
@@ -534,8 +534,8 @@ class message(osv.osv):
return False
_defaults = {
- 'user_id' : lambda self,cr,uid,ctx : uid,
- 'project_id':_default_project}
+ 'user_id' : lambda self,cr,uid,ctx : uid,
+ 'project_id':_default_project}
message()
diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml
index b6d0d024fe9..e0e4e0f2d06 100644
--- a/addons/project_gtd/project_gtd_view.xml
+++ b/addons/project_gtd/project_gtd_view.xml
@@ -105,7 +105,7 @@
-
+
From b6a1916f2395b9403f19339cbeb96304c8f20c94 Mon Sep 17 00:00:00 2001
From: "rpa (Open ERP)"
Date: Tue, 9 Feb 2010 18:45:21 +0530
Subject: [PATCH 2/7] [IMP]: caldav: Minor improvement for timezone and
attendee invitation
bzr revid: rpa@openerp.co.in-20100209131521-btwk4n0dru2bolmr
---
addons/caldav/caldav.py | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/addons/caldav/caldav.py b/addons/caldav/caldav.py
index f8c30e10478..b3a5229f27e 100644
--- a/addons/caldav/caldav.py
+++ b/addons/caldav/caldav.py
@@ -241,8 +241,7 @@ class invite_attendee_wizard(osv.osv_memory):
})
att_id = att_obj.create(cr, uid, vals)
if model_field:
- obj.write(cr, uid, res_obj.id, {model_field: [(4, att_id)],
- 'state': 'delegated'})
+ obj.write(cr, uid, res_obj.id, {model_field: [(4, att_id)]})
if datas.get('send_mail'):
att_obj._send_mail(cr, uid, [att_id], mail_to, \
@@ -665,13 +664,13 @@ or contains the text to be used for display"""),
mail_to = [alarm.user_id.address_id.email]
for att in alarm.attendee_ids:
mail_to.append(att.user_id.address_id.email)
-
- tools.email_send(
- tools.config.get('email_from', False),
- mail_to,
- sub,
- body
- )
+ if mail_to:
+ tools.email_send(
+ tools.config.get('email_from', False),
+ mail_to,
+ sub,
+ body
+ )
self.write(cr, uid, [alarm.id], {'state':'done'})
return True
@@ -756,12 +755,12 @@ rule or repeating pattern for anexception to a recurrence set"),
def onchange_user_id(self, cr, uid, ids, user_id, *args, **argv):
if not user_id:
- return {'value': {'vtimezone': ''}}
- value = {}
+ return {'value': {'vtimezone': None}}
+ value = {'vtimezone': None}
cr.execute('select context_tz from res_users where id=%s' % (user_id))
- timezone = cr.fetchone()
+ timezone = cr.fetchone()[0]
if timezone:
- value.update({'vtimezone': timezone[0].lower()})
+ value.update({'vtimezone': timezone.lower()})
return {'value': value}
def export_cal(self, cr, uid, ids, context={}):
From 18603858e514c0f2c863c50ffd5bd98076b39dee Mon Sep 17 00:00:00 2001
From: "Harry (Open ERP)"
Date: Tue, 9 Feb 2010 19:16:52 +0530
Subject: [PATCH 3/7] [IMP] user: context_get
bzr revid: hmo@tinyerp.com-20100209134652-528dzv3j73hu3i0h
---
bin/addons/base/base_update.xml | 2 +-
bin/addons/base/res/res_user.py | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bin/addons/base/base_update.xml b/bin/addons/base/base_update.xml
index 275a7278a0c..a033724b3d3 100644
--- a/bin/addons/base/base_update.xml
+++ b/bin/addons/base/base_update.xml
@@ -78,7 +78,7 @@