[FIX,IMP]:FIX:added missing sequence field in project.project IMP:Changes in tasks and phases according to working calendar of project(Rvo(OpenERP)

bzr revid: nch@tinyerp.com-20100211054646-n12zrnf10x70dryb
This commit is contained in:
nch@tinyerp.com
2010-02-11 11:16:46 +05:30
3 changed files with 11 additions and 8 deletions
+3 -1
View File
@@ -120,6 +120,7 @@ class project(osv.osv):
_columns = {
'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the project without removing it."),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."),
'category_id': fields.many2one('account.analytic.account','Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."),
'priority': fields.integer('Sequence'),
'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team."),
@@ -138,10 +139,11 @@ class project(osv.osv):
# \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'),
'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages'),
}
_order = "sequence"
_defaults = {
'active': lambda *a: True,
'priority': lambda *a: 1,
'sequence': lambda *a: 10,
}
def _check_dates(self, cr, uid, ids):
leave = self.read(cr, uid, ids[0],['date_start','date'])
+3 -4
View File
@@ -155,7 +155,7 @@ class wizard_compute_tasks(wizard.interface):
for no in range(len(resource)):
leaves = []
resource_id = resource_pool.search(cr,uid,[('user_id','=',resource[no].id)])
if resource_id:
if resource_id and wktime_cal:
# Getting list of leaves for specific resource
leaves = leaves_resource(cr,uid,resource_id)
resource_objs.append(classobj(str(resource[no].name),(Resource,),{'__doc__':resource[no].name,'__name__':resource[no].name,'vacation':tuple(leaves)}))
@@ -185,12 +185,11 @@ class wizard_compute_tasks(wizard.interface):
# Creating the project with all the tasks and resources
def Project():
resource = reduce(operator.or_,resource_objs)
title = project.name
start = date_start
resource = reduce(operator.or_,resource_objs)
# If project has calendar
if wktime_cal or leaves:
if wktime_cal:
working_days = wktime_cal
vacation = tuple(leaves)