forked from osbzr/gooderp_addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'osbzr/master'
- Loading branch information
Showing
15 changed files
with
147 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
import test_staff_hire |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<openerp> | ||
<data> | ||
<!--招聘申请--> | ||
<record id="hire_lucy" model="hire.applicant"> | ||
<field name="partner_name">Lucy</field> | ||
<field name="partner_mobile">18899996666</field> | ||
<field name='job_id' ref='staff.staff_job_1'/> | ||
<field name="salary_proposed">3000</field> | ||
</record> | ||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
from odoo.tests.common import TransactionCase | ||
from odoo.exceptions import UserError | ||
|
||
|
||
class TestHireApplicant(TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestHireApplicant, self).setUp() | ||
self.hire = self.env.ref('staff_hire.hire_lucy') | ||
|
||
def test_default_stage_id(self): | ||
'''返回阶段的默认值''' | ||
hire = self.env['hire.applicant'].create({ | ||
'partner_name': u'小赵', | ||
'partner_mobile': '188188188', | ||
'job_id': self.env.ref('staff.staff_job_1').id, | ||
}) | ||
|
||
def test_onchange_job_id(self): | ||
'''选择职位,带出部门、负责人及阶段''' | ||
self.hire.onchange_job_id() | ||
self.assertTrue(self.hire.department_id, self.env.ref('staff.department_1')) | ||
|
||
def test_create_employee_from_applicant(self): | ||
'''创建员工''' | ||
self.hire.create_employee_from_applicant() | ||
self.assertTrue(self.hire.staff_id.name, 'Lucy') | ||
self.hire.action_get_created_employee() | ||
# 期望薪资未输入时应报错 | ||
hire = self.hire.copy() | ||
hire.salary_proposed = 0 | ||
with self.assertRaises(UserError): | ||
hire.create_employee_from_applicant() | ||
|
||
def test_action_get_created_employee(self): | ||
'''跳到新创建的员工界面''' | ||
self.hire.create_employee_from_applicant() | ||
action = self.hire.action_get_created_employee() | ||
self.assertTrue(action['res_id'], self.hire.staff_id.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
import test_out | ||
import test_tax_invoice_out |
Binary file not shown.
File renamed without changes.