[IMP] improvement in code
bzr revid: tpa@tinyerp.com-20111209073004-ll1y70suz5oo0yv5
This commit is contained in:
@@ -63,6 +63,7 @@ Dashboard for project members that includes:
|
||||
'test':[
|
||||
'test/project_process.yml',
|
||||
'test/task_process.yml',
|
||||
'test/project_demo.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
||||
@@ -111,6 +111,7 @@ class project(osv.osv):
|
||||
if task.project_id: result[task.project_id.id] = True
|
||||
return result.keys()
|
||||
|
||||
#dead code
|
||||
def _get_project_work(self, cr, uid, ids, context=None):
|
||||
result = {}
|
||||
for work in self.pool.get('project.task.work').browse(cr, uid, ids, context=context):
|
||||
@@ -357,7 +358,7 @@ def Project():
|
||||
working_days = %s
|
||||
resource = %s
|
||||
""" % (
|
||||
project.id,
|
||||
project.id,
|
||||
project.date_start, working_days,
|
||||
'|'.join(['User_'+str(x) for x in puids])
|
||||
)
|
||||
@@ -1016,7 +1017,7 @@ class account_analytic_account(osv.osv):
|
||||
if vals.get('child_ids', False) and context.get('analytic_project_copy', False):
|
||||
vals['child_ids'] = []
|
||||
return super(account_analytic_account, self).create(cr, uid, vals, context=context)
|
||||
|
||||
|
||||
def unlink(self, cr, uid, ids, *args, **kwargs):
|
||||
project_obj = self.pool.get('project.project')
|
||||
analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)])
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
-
|
||||
!record {model: project.project, id: project_integrate_openerp, view: False}:
|
||||
partner_id: base.res_partner_agrolait
|
||||
-
|
||||
!record {model: project.task, id: project_task_1, view: False}:
|
||||
remaining_hours: 10.00
|
||||
-
|
||||
!record {model: project.task, id: project_task_1, view: False}:
|
||||
planned_hours: 10.00
|
||||
-
|
||||
!record {model: project.task, id: project_task_1, view: False}:
|
||||
project_id: project_integrate_openerp
|
||||
@@ -17,8 +17,7 @@
|
||||
I check project details after convert from template.
|
||||
-
|
||||
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be active}:
|
||||
- state == "open"
|
||||
|
||||
- state == "open"
|
||||
-
|
||||
I put project in pending.
|
||||
-
|
||||
@@ -28,7 +27,7 @@
|
||||
I check state after put in pending.
|
||||
-
|
||||
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be in pending state}:
|
||||
- state == "pending"
|
||||
- state == "pending"
|
||||
-
|
||||
I re-open the project.
|
||||
-
|
||||
@@ -38,7 +37,7 @@
|
||||
I check state after reopen.
|
||||
-
|
||||
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be open.}:
|
||||
- state == "open"
|
||||
- state == "open"
|
||||
-
|
||||
I close the project.
|
||||
-
|
||||
@@ -48,7 +47,7 @@
|
||||
I check state after closed.
|
||||
-
|
||||
!assert {model: project.project, id: project_integrate_openerp, severity: error, string: Project should be close.}:
|
||||
- state == "close"
|
||||
- state == "close"
|
||||
-
|
||||
I set project into template.
|
||||
-
|
||||
@@ -59,8 +58,13 @@
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.schedule_tasks(cr, uid, [ref("project_integrate_openerp")], context=context)
|
||||
-
|
||||
I set copy the tasks of project.
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.template_copy(cr, uid, ref("project_integrate_openerp"))
|
||||
-
|
||||
I cancel Project.
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
self.set_cancel(cr, uid, [ref("project_project_9")])
|
||||
self.set_cancel(cr, uid, [ref("project_project_9")])
|
||||
@@ -39,6 +39,11 @@
|
||||
-
|
||||
!record {model: project.task.reevaluate, id: reevaluate_id}:
|
||||
remaining_hours : 120
|
||||
-
|
||||
I chnge the stage of task to next stage
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.prev_type(cr, uid, [ref("project_task_1")])
|
||||
-
|
||||
I reevaluate task with remaining hours.
|
||||
-
|
||||
@@ -49,11 +54,16 @@
|
||||
-
|
||||
!assert {model: project.task, id: project_task_1, severity: error, string: task should be reevaluated}:
|
||||
- remaining_hours == 120.0
|
||||
-
|
||||
I chnge the stage of task to next stage
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.next_type(cr, uid, [ref("project_task_1")])
|
||||
-
|
||||
I close the task.
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.do_close(cr, uid, [ref("project_task_1")])
|
||||
self.action_close(cr, uid, [ref("project_task_1")])
|
||||
-
|
||||
I check state after closed.
|
||||
-
|
||||
@@ -63,6 +73,4 @@
|
||||
I cancel Task.
|
||||
-
|
||||
!python {model: project.task}: |
|
||||
self.do_cancel(cr, uid, [ref("project_task_2")])
|
||||
|
||||
|
||||
self.do_cancel(cr, uid, [ref("project_task_2")])
|
||||
Reference in New Issue
Block a user