[IMP]project_* : Improve the statements
authorDBR (OpenERP) <dbr@tinyerp.com>
Wed, 7 Sep 2011 09:36:59 +0000 (15:06 +0530)
committerDBR (OpenERP) <dbr@tinyerp.com>
Wed, 7 Sep 2011 09:36:59 +0000 (15:06 +0530)
bzr revid: dbr@tinyerp.com-20110907093659-iwkovt45beo4pzl5

addons/project_mrp/test/project_task_procurement.yml
addons/project_planning/test/planning_states.yml
addons/project_planning/test/project_planning_report.yml
addons/project_retro_planning/test/deadline_change.yml
addons/project_scrum/test/project_scrum_report.yml
addons/project_scrum/test/scrum_sprint_test.yml
addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml

index 70efa44..e78681b 100644 (file)
@@ -1,5 +1,5 @@
 -
-  In order to test project_mrp module with OpenERP I want to create sale orders 
+  In order to test project_mrp module with OpenERP I want to create sale orders
   with product type 'service' so when procurement runs one task is created.
 -
   I create record for a service type product.
@@ -15,9 +15,9 @@
     uom_id: product.uom_day
     uom_po_id: product.uom_day
     warranty: 0.0
-- 
+-
   I create a sale order for product Partners Training which has type 'Service'.
-- 
+-
   !record {model: sale.order, id: sale_order_so0}:
     date_order: !eval time.strftime('%Y-%m-%d')
     invoice_quantity: order
 -
   !python {model: project.task}: |
     order_obj = self.pool.get('sale.order')
-    order = order_obj.browse(cr, uid, ref('sale_order_so0')) 
-    task_id = self.search(cr, uid, [('name','like', order.name)]) 
+    order = order_obj.browse(cr, uid, ref('sale_order_so0'))
+    task_id = self.search(cr, uid, [('name','like', order.name)])
     assert task_id, 'No Task is created!'
 -
   Now I am Closing the Created Task Vis Procurment .
 -
   !python {model: project.task}: |
     order_obj = self.pool.get('sale.order')
-    order = order_obj.browse(cr, uid, ref('sale_order_so0')) 
+    order = order_obj.browse(cr, uid, ref('sale_order_so0'))
     task_id = self.search(cr, uid, [('name','like', order.name)])
     if task_id:
       self.do_close(cr, uid, task_id)
index 5c9cf71..8814167 100644 (file)
@@ -1,6 +1,6 @@
-- 
-  Create a analytic planning 'Project Planning'
-- 
+-
+  I create a analytic planning 'Project Planning'.
+-
   !record {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0}:
     business_days: 20
     date_from: !eval time.strftime('%Y-%m-%d')
@@ -8,11 +8,11 @@
     name: Project Planning
     state: draft
     user_id: base.user_demo
-    
-    
-- 
-  Open the 'Project Planning'
-- 
+
+
+-
+  Open the 'Project Planning'.
+-
   !python {model: report_account_analytic.planning}: |
     self.action_open(cr, uid, [ref("report_account_analytic_planning_projectplanning0")],
       {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")],
       ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
       1, "project_id": False, "department_id": False, })
 -
-   Check if 'Project Planning' in open state
+   I check if 'Project Planning' in open state.
 -
-   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}:     
+   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}:
      - state == "open"
 
-- 
-  Cancel the 'Project Planning'
-- 
+-
+  I cancel the 'Project Planning'.
+-
   !python {model: report_account_analytic.planning}: |
     self.action_cancel(cr, uid, [ref("report_account_analytic_planning_projectplanning0")],
       {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")],
       ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
       1, "project_id": False, "department_id": False, })
 -
-   Check if 'Project Planning' in cancel state
+   I check if 'Project Planning' in cancel state.
+-
+   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in cancel state}:
+     - state == "cancel"
+
+-
+  Reopen the 'Project Planning'.
 -
-   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in cancel state}:     
-     - state == "cancel"    
-    
-- 
-  Reopen the 'Project Planning'
-- 
   !python {model: report_account_analytic.planning}: |
     self.action_draft(cr, uid, [ref("report_account_analytic_planning_projectplanning0")],
       {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")],
       ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
       1, "project_id": False, "department_id": False, })
 -
-   Check if 'Project Planning' in draft state
+   I check if 'Project Planning' in draft state.
+-
+   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in draft state}:
+     - state == "draft"
+
+-
+  Open the 'Project Planning'.
 -
-   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in draft state}:     
-     - state == "draft"   
-    
-- 
-  Open the 'Project Planning'
-- 
   !python {model: report_account_analytic.planning}: |
     self.action_open(cr, uid, [ref("report_account_analytic_planning_projectplanning0")],
       {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")],
       ref("project_planning.menu_report_account_analytic_planning"), "search_default_user_id":
       1, "project_id": False, "department_id": False, })
 -
-   Check if 'Project Planning' in open state
+   I check if 'Project Planning' in open state.
+-
+   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}:
+     - state == "open"
+
+-
+  I close the 'Project Planning'.
 -
-   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in open state}:     
-     - state == "open"    
-    
-- 
-  Close the 'Project Planning'
-- 
   !python {model: report_account_analytic.planning}: |
     self.action_done(cr, uid, [ref("report_account_analytic_planning_projectplanning0")],
       {"lang": "en_US", "active_ids": [ref("project_planning.menu_report_account_analytic_planning")],
     name = 'Project Planning'
     self._get_total_planned(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], name, args={},context=None)
     self._get_total_free(cr, uid, [ref("report_account_analytic_planning_projectplanning0")], name, args={},context=None)
-- 
-  Create analytic planning report
-- 
+-
+  I create analytic planning report.
+-
   !record {model: report_account_analytic.planning.line, id: report_account_analytic_planning_line}:
     planning_id : report_account_analytic_planning_projectplanning0
     amount : 100
     amount_unit : product.product_uom_unit
-- 
-  Create account analytic report for planning 'Project Planning'
-- 
+-
+  I create account analytic report for planning 'Project Planning'.
+-
   !python {model: report_account_analytic.planning.line}: |
     self.name_get(cr, uid, [ref("report_account_analytic_planning_line")],context=None)
-- 
+-
   Add project line id in project task report.
-- 
+-
   !record {model: project.task, id: report_account_analytic_planning_line}:
     planning_line_id: report_account_analytic_planning_line
-- 
-  Now, search palnning for the task
-- 
+-
+  Now, search palnning for the task.
+-
   !python {model: project.task}: |
     context.update({'planning' : ref("report_account_analytic_planning_projectplanning0")})
     self.search(cr, uid, args={}, offset=0, limit=None, order=None, context=context, count=False)
 
 -
-   Check if 'Project Planning' in done state
+   I check if 'Project Planning' in done state.
 -
-   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}:     
-     - state == "done"     
+   !assert {model: report_account_analytic.planning, id: report_account_analytic_planning_projectplanning0, string: Planning in done state}:
+     - state == "done"
index a7597af..6342036 100644 (file)
@@ -1,8 +1,8 @@
 -
-  In order to test the PDF reports defined on a Project Planning, we will print Project Planning Report
+  In order to test the PDF reports defined on a Project Planning, we will print Project Planning Report.
 -
   !python {model: report_account_analytic.planning}: |
     import netsvc, tools, os
     (data, format) = netsvc.LocalService('report.report_account_analytic.planning.print').create(cr, uid, [ref('project_planning.project_plannning_1')], {}, {})
     if tools.config['test_report_directory']:
-        file(os.path.join(tools.config['test_report_directory'], 'project_planning-project_planning_report'+format), 'wb+').write(data)
\ No newline at end of file
+        file(os.path.join(tools.config['test_report_directory'], 'project_planning-project_planning_report'+format), 'wb+').write(data)
index 33f7d44..7d182e3 100644 (file)
@@ -1,13 +1,13 @@
-- 
-  Create project 'Retro Planning'
-- 
+-
+  I create project 'Retro Planning'.
+-
   !record {model: project.project, id: project_project_retroplanning0}:
     company_id: base.main_company
     date: !eval time.strftime('%Y-%m-%d')
     name: Retro Planning
-- 
-  Create task 'Plan all projects'
-- 
+-
+  I create task 'Plan all projects'.
+-
   !record {model: project.task, id: project_task_planallprojects0}:
     date_deadline: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,6)"
     date_end: !eval "'%s-%s-%s %s:%s:%s' %(datetime.now().year,datetime.now().month,3,datetime.now().hour,datetime.now().minute,datetime.now().second)"
index d7c5b43..e4bd785 100644 (file)
@@ -4,15 +4,15 @@
   !record {model: res.users, id: base.user_root}:
     user_email: admin@openerp.com
 -
-  Test project template feature
+  Test project template feature.
 -
-  Create project 'OpenERP Training Programme'
+  I create project 'OpenERP Training Programme'.
 -
   !record {model: project.project, id: project_project_0}:
     company_id: base.main_company
     name: OpenERP Training Test
 -
-  In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report
+  In order to test the PDF reports defined on a Project Scrum, we will print Project Scrum Sprint Burndown Report.
 -
   !python {model: project.scrum.sprint}: |
     import netsvc, tools, os
@@ -21,7 +21,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)
 -
-  Creating 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
     self.name_search(cr, uid, name='test', args=None, operator='ilike', context=None, limit=100)
     self.button_draft(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
 -
-  Click on Open Button.
+  I click on Open Button.
 -
   !python {model: project.scrum.product.backlog}: |
     self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
 -
-  Click on Pending Button.
+  I click on Pending Button.
 -
   !python {model: project.scrum.product.backlog}: |
     self.button_pending(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
 -
-  Click on Open Button.
+  I click on Open Button.
 -
   !python {model: project.scrum.product.backlog}: |
     self.button_open(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
 -
-  Creating a project.scrum.meeting record.
+  I create a project.scrum.meeting record.
 -
   !record {model: project.scrum.meeting, id: project_scrum_meeting_0}:
     date: !eval time.strftime('%Y-%m-%d')
     sprint_id: project_scrum.scrum_sprint_0
 -
-  In order to test the Scrum meeting
+  In order to test the Scrum meeting.
 -
   !python {model: project.scrum.meeting}: |
     try:
     except:
       pass
 -
-  Creating a project.scrum.email record.
+  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
+  Send project scrum email.
 -
   !python {model: project.scrum.email}: |
     fields={
     except:
       pass
 -
-  Creating first scrum backlog for merge the record.
+  I create first scrum backlog for merge the record.
 -
   !record {model: project.scrum.backlog.merge, id: project_scrum_backlog_merge1}:
     project_id: project_project_0
 -
-  Creating second scrum backlog for merge the record.
+  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
     except:
         pass
 -
-  In order to test the project_scrum_backlog_create_task wizard
+  In order to test the project_scrum_backlog_create_task wizard.
 -
   !record {model: project.scrum.backlog.create.task, id: project_scrum_backlog_task0}:
     user_id: base.user_root
 -
-  Set project as project template
+  Set project as project template.
 -
   !python {model: project.scrum.backlog.create.task}: |
     context['active_ids'] = [ref("project_scrum_backlog_task0")]
     self.do_create(cr, uid, [ref("project_scrum_backlog_task0")],context)
 
 -
-  Creating a ScrumProduct Backlog Record.
+  I create a ScrumProduct Backlog Record.
 -
   !record {model: project.scrum.product.backlog, id: project_scrum_product_demobacklog0}:
     effective_hours: 0.0
     sequence: 0.0
 
 -
-  Creating a postpone.wizard record.
-- 
+  I create a postpone.wizard record.
+-
   !record {model: postpone.wizard, id: postpone_wizard_0}:
     {}
 -
   !python {model: postpone.wizard}: |
     context['active_ids'] = [ref("project_scrum_product_demobacklog0")]
     context['active_id'] = [ref("postpone_wizard_0")]
-    self.button_postpone( cr, uid, [ref("postpone_wizard_0")], context=context)     
+    self.button_postpone( cr, uid, [ref("postpone_wizard_0")], context=context)
 -
-  Click on Postpone Button.
+  I click on Postpone Button.
 -
   !python {model: project.scrum.product.backlog}: |
     self.button_postpone(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
 -
-  Click on Close Button.
+  I click on Close Button.
 -
   !python {model: project.scrum.product.backlog}: |
     self.button_close(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
 -
-  Click on Cancel Button.
+  I click on Cancel Button.
 -
   !python {model: project.scrum.product.backlog}: |
     self.button_cancel(cr, uid, [ref("project_scrum_product_backlog0")],context=None)
 -
-  Create a backlog sprint
-- 
+  I create a backlog sprint.
+-
   !record {model: project.scrum.backlog.assign.sprint, id: project_scrum_backlog_assign_sprint}:
     {}
 -
index 083c2fa..5ed0c92 100644 (file)
@@ -1,5 +1,5 @@
 -
-  Creating a Scrum Sprint Record
+  I create a Scrum Sprint Record.
 -
   !record {model: project.scrum.sprint, id: project_scrum_sprint_testsprint0}:
     date_start: !eval time.strftime('%Y-%m-01')
     scrum_master_id: base.user_admin
     state: draft
 -
-  I am copying the "Demo Sprint" Sprint
+  I am copying the "Demo Sprint" Sprint.
 -
   !python {model: project.scrum.sprint}: |
     self.copy(cr, uid, ref("project_scrum_sprint_testsprint0"))
 -
-  I am changing the Project of the "Demo Sprint" Sprint
+  I am changing the Project of the "Demo Sprint" Sprint.
 -
   !python {model: project.scrum.sprint}: |
     self.onchange_project_id(cr, uid, [ref("project_scrum_sprint_testsprint0")], ref("project.project_project_9"))
 
 -
-  I am Opeing the "Demo Sprint" Sprint
+  I am Opeing the "Demo Sprint" Sprint.
 -
   !python {model: project.scrum.sprint}: |
     self.button_open(cr, uid, [ref("project_scrum_sprint_testsprint0")])
 
 -
-  I am Setting the "Demo Sprint" Sprint to Pending
+  I am Setting the "Demo Sprint" Sprint to Pending.
 -
   !python {model: project.scrum.sprint}: |
     self.button_pending(cr, uid, [ref("project_scrum_sprint_testsprint0")])
index a8a4bae..bc2827f 100644 (file)
@@ -1,5 +1,5 @@
 -
-  Create a user 'HR Manager'
+  I create a user 'HR Manager'.
 -
   !record {model: res.users, id: res_users_hrmanager0}:
     company_id: base.main_company
@@ -11,7 +11,7 @@
       - base.group_hr_manager
 
 -
-  Create a product with type service used to specify employees designation
+  I create a product with type service used to specify employees designation.
 -
   !record {model: product.product, id: product_product_hrmanger0}:
     categ_id: product.product_category_services
@@ -30,7 +30,7 @@
     weight_net: 0.0
 
 -
-  Create an analytic journal for employees timesheet
+  I create an analytic journal for employees timesheet.
 -
   !record {model: account.analytic.journal, id: account_analytic_journal_hrtimesheet0}:
     company_id: base.main_company
@@ -38,7 +38,7 @@
     type: general
 
 -
-  Create an employee 'HR Manager' for user 'HR Manager'
+  I create an employee 'HR Manager' for user 'HR Manager'.
 -
   !record {model: hr.employee, id: hr_employee_hrmanager0}:
     name: HR Manager
@@ -47,7 +47,7 @@
     journal_id: account_analytic_journal_hrtimesheet0
 
 -
-  Create a timesheet sheet for HR manager
+  I create a timesheet sheet for HR manager.
 -
   !record {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0}:
     date_current: !eval time.strftime('%Y-05-%d')
     employee_id : 'hr_employee_hrmanager0'
 
 -
-  Create a project 'Timesheet Management'
+  I create a project 'Timesheet Management'.
 -
   !record {model: project.project, id: project_project_timesheetmanagement0}:
     company_id: base.main_company
     name: Timesheet Management
     
 -
-  Change the partner to the realted project
+  I change the partner to the realted project.
 -
   !python {model: project.project}: |
     self.onchange_partner_id(cr, uid, [ref('project_project_timesheetmanagement0')], part=False, context=None)
 
 -
-  Create a task 'Get all timesheet records'
+  I create a task 'Get all timesheet records'.
 -
   !record {model: project.task, id: project_task_getalltimesheetrecords0}:
     date_start: !eval time.strftime('%Y-05-%d %H:%M:%S')
@@ -84,7 +84,7 @@
     user_id: res_users_hrmanager0
 
 -
-  Open the task
+  Open the task.
 -
   !python {model: project.task}: |
     self.do_open(cr, uid, [ref("project_task_getalltimesheetrecords0")], {"lang":
@@ -94,7 +94,7 @@
     self.write(cr, uid, [ref('project_task_getalltimesheetrecords0')], {'name': 'Get all timesheet records','project_id': ref('project_project_timesheetmanagement0'),'user_id': ref('res_users_hrmanager0')},context)
 
 -
-  Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager
+  Make a work task entry 'Get work calendar of all employees' of 10 hours done by HR manager.
 -
   !record {model: project.task, id: project_task_getalltimesheetrecords0}:
     work_ids:
         name: Get work calendar of all employees
         user_id: res_users_hrmanager0
 -
-  Creating a project.task.work record
+  I create a project.task.work record.
 -
   !record {model: project.task.work, id: project_task_work_test0}:
     company_id: base.main_company
     task_id: project_task_getalltimesheetrecords0
     user_id: res_users_hrmanager0
 -
-  Add the work details
+  Add the work details.
 -
   !python {model: project.task.work}: |
     import time
     self.write(cr, uid, [ref('project_task_work_test0')], vals,context)
     self.unlink(cr, uid, [ref('project_task_work_test0')])
 -
-  Check for timesheet_ids in HR manager's timesheet
+  I check for timesheet_ids in HR manager's timesheet.
 -
   !assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_sheetforhrmanager0, string: After hr manager's work task, length of timesheet line of current timesheet must be greater then 1}:
      - len(timesheet_ids) > 0
 -
-  Unlink the task
+  Unlink the task.
 -
   !python {model: project.task}: |
     self.unlink(cr, uid, [ref("project_task_getalltimesheetrecords0")])