[IMP]project_* : Improve the code

bzr revid: dbr@tinyerp.com-20110916114403-umbfkuhovq9z9qha
This commit is contained in:
DBR (OpenERP)
2011-09-16 17:14:03 +05:30
parent 2f5fca4698
commit 87232b309f
4 changed files with 37 additions and 65 deletions
+1 -25
View File
@@ -479,31 +479,7 @@
}
self.create(cr, uid, vals, context=None)
self.unlink(cr, uid, [ref('account_analytic_account0')])
-
I close the project task.
-
!record {model: project.task.close, id: project_task_close_0}:
manager_warn : True
partner_warn : False
manager_email : 'info@mycustomer.com'
partner_email : 'info@myinfobid.com'
description : Description
-
I send Warn Message by Email to Manager and Customer.
-
!python {model: project.task.close}: |
fields = {
'manager_warn' : True,
'partner_warn' : False,
'manager_email' : 'info@mycustomer.com',
'partner_email' : 'info@myinfobid.com',
'description' : 'Description'
}
self.default_get(cr, uid, fields, context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")})
try:
self.send(cr, uid, [ref('project_task_close_0')], context={"active_ids":[ref("project_task_technicaltraining0")],"active_id": ref("project_task_technicaltraining0")})
except :
pass
-
I check for remaining hours.
-
@@ -236,4 +236,3 @@
-
!assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in done state}:
- state == "open"
-
@@ -1,15 +1,9 @@
-
I create a mailgate message record.
-
!record {model: mailgate.message, id: project_mailgate_message1}:
partner_id: base.res_partner_asus
-
I create a project task.
-
!record {model: project.task, id: project_task_mailgate1}:
date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: Technical Training
#message_ids: project_mailgate_message1
user_id: base.user_root
planned_hours: 30.0
remaining_hours: 30.0
@@ -25,11 +19,6 @@
-
!python {model: project.task}: |
self.do_open(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')})
-
Execute the message followers.
-
!python {model: project.task}: |
self.message_followers(cr, uid, [ref('project_task_mailgate1')], {'active_id':ref('project_task_mailgate1')})
-
Keep task in pending state.
-
@@ -11,6 +11,12 @@
!record {model: project.project, id: project_project_0}:
company_id: base.main_company
name: OpenERP Training Test
-
I create project 'Functional Programme'.
-
!record {model: project.project, id: project_project_1}:
company_id: base.main_company
name: Functional Test
-
In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report.
-
@@ -21,7 +27,7 @@
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'project_scrum-project_scrum_sprint_burndown.'+format), 'wb+').write(data)
-
I create a project.scrum.product.backlog record.
I create a project scrum product backlog record.
-
!record {model: project.scrum.product.backlog, id: project_scrum_product_backlog0}:
effective_hours: 0.0
@@ -30,6 +36,28 @@
project_id: project_project_0
sequence: 0.0
state: draft
-
Now, I create another two project scrum product backlog record for the merging purpose.
-
I create "Test_merge_bklg1" project scrum product backlog record.
-
!record {model: project.scrum.product.backlog, id: project_scrum_product_backlog1}:
effective_hours: 0.0
expected_hours: 0.0
name: test_merge_bklg1
project_id: project_project_0
sequence: 0.0
state: draft
-
I create "Test_merge_bklg2" project scrum product backlog record.
-
!record {model: project.scrum.product.backlog, id: project_scrum_product_backlog2}:
effective_hours: 0.0
expected_hours: 0.0
name: test_merge_bklg2
project_id: project_project_1
sequence: 0.0
state: draft
-
In order to test the Product Backlog.
-
@@ -66,26 +94,6 @@
self.button_send_product_owner(cr, uid, [ref("project_scrum_meeting_0")],context=None)
except:
pass
-
I create a project.scrum.email record.
-
!record {model: project.scrum.email, id: project_scrum_email_0}:
subject: Subject
message: test message
-
Send project scrum email.
-
!python {model: project.scrum.email}: |
fields={
'subject': 'Subject',
'message': 'test message'
}
context.update({'active_ids':[ref('project_scrum_meeting_0')],'active_id':ref('project_scrum_meeting_0')})
self.default_get(cr, uid, fields, context)
try:
self.button_send_scrum_email(cr, uid, [ref("project_scrum_email_0")],context)
except:
pass
-
I create first scrum backlog for merge the record.
-
@@ -95,17 +103,17 @@
I create second scrum backlog for merge the record.
-
!record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge2}:
project_id: project_project_0
project_id: project_project_1
-
Set project scrum backlog merge.
-
!python {model: project.scrum.backlog.merge}: |
context['active_ids'] = [ref("project_scrum_backlog_merge1"),ref("project_scrum_backlog_merge2")]
context['active_id'] = [ref("project_scrum_backlog_merge1")]
try:
self.check_backlogs(cr, uid, [ref("project_scrum_backlog_merge2")],context)
except:
pass
context.update({
'active_model': 'project.scrum.product.backlog',
'active_ids': [ref("project_scrum_product_backlog1"),ref("project_scrum_product_backlog2")],
'active_id': ref("project_scrum_product_backlog1")})
self.check_backlogs(cr, uid, [ref("project_scrum_product_backlog1"),ref("project_scrum_product_backlog2")],context)
self.do_merge(cr, uid, [ref('project_scrum_backlog_merge1'),ref('project_scrum_backlog_merge2')], context)
-
In order to test the project_scrum_backlog_create_task wizard.
-