[HR] Improve view,title,tooltip and code.

bzr revid: amb@tinyerp.com-20130626121617-17i92ua5yty8htwu
This commit is contained in:
Amit Bhavsar (Open ERP) 2013-06-26 17:46:17 +05:30
parent c180afab26
commit 34f15e56d9
9 changed files with 26 additions and 18 deletions

View File

@ -190,7 +190,7 @@ class hr_employee(osv.osv):
'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'),
'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True),
'coach_id': fields.many2one('hr.employee', 'Coach'),
'job_id': fields.many2one('hr.job', 'Job'),
'job_id': fields.many2one('hr.job', 'Job Title'),
# image: all image fields are base64 encoded and PIL-supported
'image': fields.binary("Photo",
help="This field holds the image used as photo for the employee, limited to 1024x1024px."),

View File

@ -380,10 +380,9 @@
<tree string="Job">
<field name="name"/>
<field name="department_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="expected_employees"/>
<field name="no_of_employee"/>
<field name="no_of_recruitment"/>
<field name="expected_employees"/>
<field name="state"/>
</tree>
</field>

View File

@ -88,6 +88,13 @@ class hr_contract(osv.osv):
'type_id': _get_type
}
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
if not employee_id:
return {'value':{}}
emp_obj = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context)
val = {'job_id': emp_obj.job_id.id}
return {'value': val}
def _check_dates(self, cr, uid, ids, context=None):
for contract in self.read(cr, uid, ids, ['date_start', 'date_end'], context=context):
if contract['date_start'] and contract['date_end'] and contract['date_start'] > contract['date_end']:

View File

@ -73,14 +73,15 @@
<form string="Contract" version="7.0">
<sheet>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="Contract Reference"/>
</h1>
</div>
<group>
<group>
<field name="employee_id"/>
<field name="job_id"/>
<field name="employee_id" on_change="onchange_employee_id(employee_id)"/>
<field name="job_id" context="{'form_view_ref': 'hr.view_hr_job_employee_form'}"/>
</group>
<group>
<field name="type_id"/>

View File

@ -70,8 +70,8 @@
<group col="4">
<field name="name"/>
<field name="code"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="parent_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<notebook colspan="4">
<page string="Salary Rules">
@ -227,13 +227,12 @@
<div class="oe_title">
<label for="employee_id" class="oe_edit_only"/>
<h1><field name="employee_id" on_change="onchange_employee_id(date_from, date_to, employee_id, contract_id)"/></h1>
<label for="date_from" class="oe_edit_only" string="Period"/>
<h2>
From <field name="date_from" on_change="onchange_employee_id(date_from, date_to, employee_id, contract_id)"/>
to <field name="date_to"/>
</h2>
</div>
<group col="4">
<label for="date_from" string="Period"/>
<div>
<field name="date_from" on_change="onchange_employee_id(date_from, date_to, employee_id, contract_id)" class="oe_inline"/> - <field name="date_to" class="oe_inline"/>
</div>
<field name="contract_id" domain="[('employee_id','=',employee_id),('date_start','&lt;=',date_to),'|',('date_end','&gt;=',date_from),('date_end','=',False)]" on_change="onchange_contract_id(date_from, date_to, employee_id, contract_id)" context="{'default_employee_id': employee_id}"/>
<field name="number"/>
<field name="struct_id" attrs="{'required':[('contract_id','&lt;&gt;',False)]}"/>
@ -592,8 +591,8 @@
<field name="amount_percentage_base" attrs="{'invisible':[('amount_select','&lt;&gt;','percentage')], 'required': [('amount_select','=','percentage')]}"/><newline/>
<field name="quantity" attrs="{'invisible':[('amount_select','=','code')], 'required':[('amount_select','!=','code')]}"/><newline/>
<field name="amount_fix" attrs="{'invisible':[('amount_select','&lt;&gt;','fix')], 'required':[('amount_select','=','fix')]}"/><newline/>
<field name="amount_percentage" attrs="{'invisible':[('amount_select','&lt;&gt;','percentage')], 'required':[('amount_select','=','percentage')]}"/>
<field colspan="4" name="amount_python_compute" attrs="{'invisible':[('amount_select','&lt;&gt;','code')], 'required':[('amount_select','=','code')]}"/>
<field name="amount_percentage" attrs="{'invisible':[('amount_select','&lt;&gt;','percentage')], 'required':[('amount_select','=','percentage')]}"/>
<separator colspan="4" string="Company Contribution"/>
<field name="register_id"/>
</group>

View File

@ -7,14 +7,16 @@
<field name="model">payslip.lines.contribution.register</field>
<field name="arch" type="xml">
<form string="Contribution Register's Payslip Lines" version="7.0">
<header>
<button name="print_report" string="Print" type="object" icon="gtk-print" class="oe_highlight"/>
</header>
<group col="4" colspan="6">
<field name="date_from"/>
<newline/>
<field name="date_to"/>
</group>
<footer>
<button name="print_report" string="Print" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>

View File

@ -12,7 +12,7 @@
name="Meetings"
res_model="crm.meeting"
src_model="hr.applicant"
view_mode="tree,form,calendar,graph"
view_mode="calendar,tree,form,graph"
view_type="form"/>
<!-- Stage -->

View File

@ -29,7 +29,7 @@ class hr_employee(osv.osv):
_name = "hr.employee"
_inherit = "hr.employee"
_columns = {
'product_id': fields.many2one('product.product', 'Product', help="Specifies employee's designation as a product with type 'service'."),
'product_id': fields.many2one('product.product', 'Product', help="If you want to reinvoice working time of employees, link this employee to a service to determinate the cost price of the job."),
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal'),
'uom_id': fields.related('product_id', 'uom_id', type='many2one', relation='product.uom', string='Unit of Measure', store=True, readonly=True)
}

View File

@ -44,7 +44,7 @@ class hr_contract(osv.osv):
'driver_salay': fields.boolean('Driver Salary', help="Check this box if you provide allowance for driver"),
'medical_insurance': fields.float('Medical Insurance', digits_compute=dp.get_precision('Payroll'), help="Deduction towards company provided medical insurance"),
'voluntary_provident_fund': fields.float('Voluntary Provident Fund (%)', digits_compute=dp.get_precision('Payroll'), help="VPF is a safe option wherein you can contribute more than the PF ceiling of 12% that has been mandated by the government and VPF computed as percentage(%)"),
'house_rent_allowance_metro_nonmetro': fields.float('House Rent Allowance (%)', digits_compute=dp.get_precision('Payroll'), help="HRA is an allowance given by the employer to the employee for taking care of his rental or accommodation expenses for metro city it is 50 % and for non metro 40%.HRA computed as percentage(%)"),
'house_rent_allowance_metro_nonmetro': fields.float('House Rent Allowance (%)', digits_compute=dp.get_precision('Payroll'), help="HRA is an allowance given by the employer to the employee for taking care of his rental or accommodation expenses for metro city it is 50 % and for non metro 40%. \nHRA computed as percentage(%)"),
'supplementary_allowance': fields.float('Supplementary Allowance', digits_compute=dp.get_precision('Payroll')),
}