[IMP] change in yml
authorKuldeep Joshi (OpenERP) <kjo@tinyerp.com>
Fri, 8 Jun 2012 08:41:41 +0000 (14:11 +0530)
committerKuldeep Joshi (OpenERP) <kjo@tinyerp.com>
Fri, 8 Jun 2012 08:41:41 +0000 (14:11 +0530)
bzr revid: kjo@tinyerp.com-20120608084141-yoguolq375aaz5eg

addons/hr/hr.py
addons/hr/hr_view.xml
addons/hr/test/open2recruit2close_job.yml

index 9133bc3..7f2b358 100644 (file)
@@ -135,6 +135,10 @@ class hr_job(osv.osv):
         return True
 
     def job_open(self, cr, uid, ids, *args):
+        self.write(cr, uid, ids, {'state': 'open', 'no_of_recruitment': 0})
+        return True
+
+    def job_done(self, cr, uid, ids, *args):
         self.write(cr, uid, ids, {'state': 'done', 'no_of_recruitment': 0})
         return True
 
index 70a903b..97b4370 100644 (file)
                 <form layout="manual">
                 <header>
                     <button name="job_recruitement" string="In Recruitement" states="open" type="object"/>
-                    <button name="job_open" string="Recruitment Done" states="recruit" type="object"/>
+                    <button name="job_done" string="Recruitment Done" states="recruit" type="object"/>
                     <field name="state" widget="statusbar" statusbar_visible="recruit,open"/>
                 </header>
                 <sheet string="Job" layout="auto">
index 0f14828..9ed5b2b 100644 (file)
   !python {model: hr.employee}: |
     self.write(cr, uid, [ref('employee_niv')], {'job_id':ref('job_developer')})
 -
-  Now I dont want to recruit new employee for this position. so I mark it as Old.
+  Now I dont want to recruit new employee for this position. so I mark it as Done.
 -
   !python {model: hr.job}: |
-    self.job_old(cr, uid, [ref('job_developer')])
+    self.job_done(cr, uid, [ref('job_developer')])
 -
   I check 'state' and number of 'Expected in Recruitment' after closing the Job position.
 -
-  !assert {model: hr.job, id: job_developer, string: Job position is in 'old' state and no_of_recruitment = 0}:
-    - state == 'old'
+  !assert {model: hr.job, id: job_developer, string: Job position is in 'done' state and no_of_recruitment = 0}:
+    - state == 'done'
     - no_of_recruitment == 0