summaryrefslogtreecommitdiff
path: root/addons/project_long_term/project_long_term.py
diff options
context:
space:
mode:
authorjas <jas@tinyerp.com>2010-10-15 17:07:26 +0530
committerjas <jas@tinyerp.com>2010-10-15 17:07:26 +0530
commit57fc970258910e8588cb89b9efbaee7409679ba1 (patch)
treea934a7f777956c019dbd3f4d40f6723fcfca485f /addons/project_long_term/project_long_term.py
parent1eb5f7cc5fff832ed9dcd3d8f40b8489a9f41191 (diff)
parent37583b3bf2d0863cec8b7f446122e8995aeccb64 (diff)
[MERGE] merged with lp:~trunk-dev-addons2
bzr revid: jas@tinyerp.com-20101015113726-whrum35omw7o1t1i
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
-rw-r--r--addons/project_long_term/project_long_term.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index 903dbb3b17e..d6d43f83c5d 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -297,6 +297,7 @@ class project_phase(osv.osv):
if context is None:
context = {}
resource_pool = self.pool.get('resource.resource')
+ resource_allocation_pool = self.pool.get('project.resource.allocation')
uom_pool = self.pool.get('product.uom')
if context is None:
context = {}
@@ -344,7 +345,12 @@ class project_phase(osv.osv):
'date_start': start_date.strftime('%Y-%m-%d'),
'date_end': end_date.strftime('%Y-%m-%d')
}, context=ctx)
-
+ # write dates into Resources Allocation
+ for resource in phase.resource_ids:
+ resource_allocation_pool.write(cr, uid, [resource.id], {
+ 'date_start': start_date.strftime('%Y-%m-%d'),
+ 'date_end': end_date.strftime('%Y-%m-%d')
+ }, context=ctx)
# Recursive call till all the next phases scheduled
for phase in phase.next_phase_ids:
if phase.state in ['draft', 'open', 'pending']:
@@ -396,7 +402,7 @@ class project_resource_allocation(osv.osv):
'user_id': fields.related('resource_id', 'user_id', type='many2one', relation="res.users", string='User'),
'date_start': fields.date('Start Date', help="Starting Date"),
'date_end': fields.date('End Date', help="Ending Date"),
- 'useability': fields.float('Availability', help="Usability of this resource for this project phase in percentage (=50%)"),
+ 'useability': fields.float('Availability', help="Availability of this resource for this project phase in percentage (=50%)"),
}
_defaults = {
'useability': 100,