[ADD] payroll: Onchange on company contribution boolean: if company contribution then appears on payslip = uncheck disable company contribution = checkenable so like this we can tell if it is a company contribution or not

bzr revid: mra@mra-laptop-20110401050630-15la70amdihuz68k
This commit is contained in:
Mustufa Rangwala 2011-04-01 10:36:30 +05:30
parent 47c207a56a
commit 9ea2084e08
2 changed files with 7 additions and 2 deletions

View File

@ -1464,6 +1464,11 @@ class hr_salary_rule(osv.osv):
'condition_select': 'python',
}
def onchange_company(self, cr, uid, ids, company_contribution=False, context=None):
if company_contribution:
return {'value': {'appears_on_payslip': False}}
return {'value': {}}
# def _execute_function(self, cr, uid, id, value, context=None):
# """
# self: pointer to self object

View File

@ -631,7 +631,7 @@
<field name="active"/>
<field name="sequence" />
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="appears_on_payslip"/>
<field name="appears_on_payslip" attrs="{'readonly':[('company_contribution','=', True)]}" />
</group>
<notebook colspan="6">
<page string="General">
@ -656,7 +656,7 @@
<group col="2" colspan="2">
<group col="2" colspan="2">
<separator colspan="4" string="Company contribution"/>
<field name="company_contribution"/>
<field name="company_contribution" on_change="onchange_company(company_contribution)" />
<group col="2" colspan="2" attrs="{'readonly':[('company_contribution','=',False)]}">
<!-- <field name="amt_type" />
<field name="contribute_per"/>-->