[IMP] hr,hr_timesheet:add one func _no_of_expected_employees ans change string analytic account

bzr revid: aag@tinyerp.co.in-20110311122345-g1ufdl0i4ogzwbe2
This commit is contained in:
aag (OpenERP) 2011-03-11 17:53:45 +05:30
parent 924c9639c5
commit 7cb99c6031
2 changed files with 9 additions and 2 deletions

View File

@ -89,6 +89,13 @@ class hr_job(osv.osv):
for job in self.browse(cr, uid, ids, context=context):
res[job.id] = job.expected_employees - job.no_of_employee
return res
def _no_of_expected_employees(self, cr, uid, ids, name, value, arg, context=None):
if context is None:
context = {}
job =self.browse(cr, uid, ids, context=context)
result = value + job.no_of_employee
return self.write(cr,uid, ids, {'expected_employees': result}, context=context)
_name = "hr.job"
_description = "Job Description"
@ -96,7 +103,7 @@ class hr_job(osv.osv):
'name': fields.char('Job Name', size=128, required=True, select=True),
'expected_employees': fields.integer('Expected Employees', help='Required number of Employees in total for that job.'),
'no_of_employee': fields.function(_no_of_employee, method=True, string="No of Employee", help='Number of employee with that job.'),
'no_of_recruitment': fields.function(_no_of_recruitement, method=True, string='Expected in Recruitment', readonly=True),
'no_of_recruitment': fields.function(_no_of_recruitement,fnct_inv=_no_of_expected_employees, method=True, string='Expected in Recruitment'),
'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees'),
'description': fields.text('Job Description'),
'requirements': fields.text('Requirements'),

View File

@ -73,7 +73,7 @@
<group expand="0" string="Group By...">
<filter string="Users" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Anlytic account" icon="terp-folder-green" domain="[]" context="{'group_by':'account_id'}"/>
<filter string="Analytic account" icon="terp-folder-green" domain="[]" context="{'group_by':'account_id'}"/>
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>