merge
authorpap (openerp) <pap@tinyerp.co.in>
Wed, 21 Jul 2010 08:53:45 +0000 (14:23 +0530)
committerpap (openerp) <pap@tinyerp.co.in>
Wed, 21 Jul 2010 08:53:45 +0000 (14:23 +0530)
bzr revid: pap@tinyerp.co.in-20100721084846-ccj0hs7a9s629xdd
bzr revid: pap@tinyerp.co.in-20100721085345-9wkqd3trnlhizbia

1  2 
addons/account/project/analytic_account_demo.xml
addons/project/test/test_project_delegation.yml

@@@ -2,7 -2,7 +2,7 @@@
  <openerp>
      <data noupdate="1">
          <record id="analytic_root" model="account.analytic.account">
-             <field name="name">OpenERP S.A.</field>
 -            <field name="name">Analytic Chart</field>
++            <field name="name" model="res.company" use="name" search="[('id', '=', 1)]"/>
              <field name="code">0</field>
          </record>
          <record id="analytic_absences" model="account.analytic.account">
index c8c784e,0000000..9747711
mode 100644,000000..100644
--- /dev/null
@@@ -1,185 -1,0 +1,223 @@@
 +-
 +  This scenario tests the delegation process. Closing all the delegated tasks(task delegation at multiple levels) transits the parent task from pending to open state.  
 +- 
 +  Creating a project OpenERP Documentaion
 +- 
 +  !record {model: project.project, id: project_project_openerpdocumentaion0}:
 +    company_id: base.main_company
-     name: OpenERP Documentaion
-     
++    name: OpenERP Documentaion    
 +    
 +- 
 +  Creating a task 'Develop book for Technical and Functional reference'
 +- 
 +  !record {model: project.task, id: project_task_documentation_book}:
 +    name: Develop book for Technical and Functional reference
 +    planned_hours: 20.0
 +    project_id: project_project_openerpdocumentaion0
 +    remaining_hours: 20.0
 +    state: draft
 +    
 +- 
 +  Open the task
 +- 
 +  !python {model: project.task}: |
 +    self.do_open(cr, uid, [ref("project_task_documentation_book")],
 +      {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
 +      "tz": False, "active_id": ref("project.menu_action_view_task"), }) 
++
++- 
++  Creating a task 'Publish the References'
++- 
++  !record {model: project.task, id: project_task_publish_book}:
++    name: Publish the References
++    planned_hours: 10.0
++    project_id: project_project_openerpdocumentaion0
++    remaining_hours: 10.0
++    state: draft
++    
++- 
++  Open the task
++- 
++  !python {model: project.task}: |
++    self.do_open(cr, uid, [ref("project_task_publish_book")],
++      {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
++      "tz": False, "active_id": ref("project.menu_action_view_task"), }) 
++
++- 
++  Creating a project.task.delegate record
++- 
++  !record {model: project.task.delegate, id: project_task_publish_book_delegate}:
++    name: Publish the References
++    new_task_description: aaa
++    planned_hours: 15.0
++    planned_hours_me: 1.0
++    prefix: 'CHECK: Publish the References'
++    state: pending
++    user_id: base.user_demo
++    
++- 
++  Performing an osv_memory action validate on module project.task.delegate
++- 
++  !python {model: project.task.delegate}: |
++    self.validate(cr, uid, [ref("project_task_publish_book_delegate")],
++      {"lang": "en_US", "active_model": "project.task", "tz": False, "record_id":
++      4, "active_ids": [ref("project_task_publish_book")], "active_id": ref("project_task_publish_book"),
++      })
 +      
 +- 
 +  Creating a delegate task 'Prepare a book that gives functional overview of OpenERP' 
 +- 
 +  !record {model: project.task, id: project_task_delegate_openerp_tutorial}:
 +    name: Prepare a book that gives functional overview of OpenERP
 +    planned_hours: 30.0
 +    project_id: project.project_project_openerpdocumentaion0
 +    remaining_hours: 30.0
 +    state: draft
 +    
 +- 
 +  Open the task
 +- 
 +  !python {model: project.task}: |
 +    self.do_open(cr, uid, [ref("project_task_delegate_openerp_tutorial")],
 +      {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
 +      "tz": False, "active_id": ref("project.menu_action_view_task"), })
 +          
 +- 
 +  Creating a delegate task 'Prepare a technical reference for creating your modules'
 +- 
 +  !record {model: project.task, id: project_task_delegate_developer_book}:
 +    name: Prepare a technical reference for creating your modules
 +    planned_hours: 30.0
 +    project_id: project_project_openerpdocumentaion0
 +    remaining_hours: 30.0
 +    state: draft
 + 
 +- 
 +  Open the task
 +- 
 +  !python {model: project.task}: |
 +    self.do_open(cr, uid, [ref("project_task_delegate_developer_book")],
 +      {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
 +      "tz": False, "active_id": ref("project.menu_action_view_task"), })
 +
 +- 
 +  Delegate task 'Develop book for Technical and Functional reference' to these tasks and make it pending
 +- 
 +  !record {model: project.task, id: project_task_documentation_book}:
 +    child_ids:
 +      - project.project_task_delegate_openerp_tutorial
 +      - project.project_task_delegate_developer_book
 +    planned_hours: 20.0
 +    state: pending
 +
 +- 
 +  Creating a delegate task 'Prepare documentation for Module Development'
 +- 
 +  !record {model: project.task, id: project_task_delegate_module_develop}:
 +    name: Prepare documentation for Module Development
 +    planned_hours: 30.0
 +    project_id: project.project_project_openerpdocumentaion0
 +    remaining_hours: 30.0
 +    state: draft
 +    
 +
 +- 
 +  Creating a delegate 'Prepare documentation for Business Process Development'
 +- 
 +  !record {model: project.task, id: project_task_delegate_business_process_develop}:
 +    name: Prepare documentation for Business Process Development
 +    planned_hours: 30.0
 +    project_id: project_project_openerpdocumentaion0
 +    remaining_hours: 30.0
 +    state: draft
 +
 +- 
 +  Delegate task 'Prepare a technical reference for creating your modules' to these tasks and make it pending
 +- 
 +  !record {model: project.task, id: project_task_delegate_developer_book}:
 +    child_ids:
 +      - project.project_task_delegate_module_develop
 +      - project.project_task_delegate_business_process_develop
 +    planned_hours: 20.0
 +    state: pending
 +
 +- 
 +  Open the task
 +- 
 +  !python {model: project.task}: |
 +    self.do_open(cr, uid, [ref("project_task_delegate_module_develop")],
 +      {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
 +      "tz": False, "active_id": ref("project.menu_action_view_task"), })
 +      
 +- 
 +  Open the task
 +- 
 +  !python {model: project.task}: |
 +    self.do_open(cr, uid, [ref("project_task_delegate_business_process_develop")],
 +      {"lang": "en_US", "active_model": "ir.ui.menu", "active_ids": [ref("project.menu_action_view_task")],
 +      "tz": False, "active_id": ref("project.menu_action_view_task"), })      
 +
 +- 
 +  Check if 'Prepare a technical reference for creating your modules' in pending state
 +- 
 +  !assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in pending state}:
 +       - state == "pending"
 +                 
 +- 
 +  Close the child task 'Prepare documentation for Module Development'
 +- 
 +  !python {model: project.task}: |
 +    self.do_close(cr, uid, [ref("project_task_delegate_module_develop")], {"lang": "en_US",
 +      "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
 +      "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
 +      1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
 +      })
 +      
 +- 
 +  Close the child task 'Prepare documentation for Business Process Development'
 +- 
 +  !python {model: project.task}: |
 +    self.do_close(cr, uid, [ref("project_task_delegate_business_process_develop")], {"lang": "en_US",
 +      "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
 +      "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
 +      1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
 +      })
 +      
 +- 
 +  Parent task 'Prepare a technical reference for creating your modules' task must now be in open state
 +- 
 +  !assert {model: project.task, id: project_task_delegate_developer_book, severity: error, string: Task is in done state}:
 +       - state == "open"
 +       
 +      
 +- 
 +  Check if task 'Develop book for Technical and Functional reference' in pending state
 +- 
 +  !assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in pending state}:
 +       - state == "pending"
 +                 
 +- 
 +  Close the child project 'Prepare a technical reference for creating your modules'
 +- 
 +  !python {model: project.task}: |
 +    self.do_close(cr, uid, [ref("project_task_delegate_developer_book")], {"lang": "en_US",
 +      "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
 +      "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
 +      1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
 +      })
 +      
 +- 
 +  Close the child project 'Prepare a book that gives functional overview of OpenERP' 
 +- 
 +  !python {model: project.task}: |
 +    self.do_close(cr, uid, [ref("project_task_delegate_openerp_tutorial")], {"lang": "en_US",
 +      "active_ids": [ref("project.menu_action_view_task")], "tz": False, "active_model":
 +      "ir.ui.menu", "section_id": False, "search_default_project_id": False, "search_default_user_id":
 +      1, "search_default_current": 1, "mail_send": False, "active_id": ref("project.menu_action_view_task"),
 +      })
 +      
 +- 
 +  Parent task 'Develop book for Technical and Functional reference' must be now in open state 
 +- 
 +  !assert {model: project.task, id: project_task_documentation_book, severity: error, string: Task is in done state}:
 +       - state == "open"