[FIX] l10n_in_hr_payroll: Unable to refund payslip

When no input line is found in get_payslip_lines, the input line with
amount_python_compute = 'result = inputs.ARS.amount', the function __getattr__
on BrowsableObject returns 0.0 for ARS and raises an error for amount because
a float has no attribute amount.

Inspired from 9a6e7799fe

opw:785033
This commit is contained in:
Goffin Simon
2017-12-18 10:29:22 +01:00
parent cfe0ebcc59
commit 052323fae4
@@ -160,7 +160,7 @@ or (contract.wage * 0.10))</field>
<field name="name">Arrears</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.ARS.amount</field>
<field name="amount_python_compute">result = inputs.ARS and inputs.ARS.amount</field>
<field eval="0.0" name="amount_fix"/>
<field name="sequence" eval="28"/>
<field name="note">Generally arrears are fully taxable, but employee may claim exemption u/s 89(1).
@@ -185,7 +185,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.LE.amount</field>
<field name="amount_python_compute">result = inputs.LE and inputs.LE.amount</field>
<field name="sequence" eval="30"/>
<field name="note">Payment by way of leave encashment received by Central and State Govt.employees at the time of retirement in respect of the period of earned leave at credit is fully exempt. In case of other employees, the exemption is to be limited to minimum of all below:
1.The actual amount received
@@ -199,7 +199,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="name">Performance Incentive</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.PERF.amount</field>
<field name="amount_python_compute">result = inputs.PERF and inputs.PERF.amount</field>
<field name="sequence" eval="31"/>
<field name="note">This would be fully taxable based on incentive.</field>
</record>
@@ -209,7 +209,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="name">Bonus</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.BNS.amount</field>
<field name="amount_python_compute">result = inputs.BNS and inputs.BNS.amount</field>
<field name="sequence" eval="41"/>
<field name="note">This would be fully taxable based on Bonus.</field>
</record>
@@ -229,7 +229,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="name">Medical Reimbursement</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.MR.amount</field>
<field name="amount_python_compute">result = inputs.MR and inputs.MR.amount</field>
<field name="sequence" eval="32"/>
<field name="note">This component is on-taxable up to 15000 per year (or Rs 1250 per month) on producing medical bills.</field>
</record>
@@ -250,7 +250,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="name">Periodical Journals</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.PJ.amount</field>
<field name="amount_python_compute">result = inputs.PJ and inputs.PJ.amount</field>
<field name="sequence" eval="34"/>
<field name="note">Some employers may provide component for buying magazines, journals and books as a part of knowledge enhancement for business growth.This part would become non taxable on providing original bills.</field>
</record>
@@ -280,7 +280,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="name">Telephone Reimbursement</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.TR.amount</field>
<field name="amount_python_compute">result = inputs.TR and inputs.TR.amount</field>
<field name="sequence" eval="36"/>
<field name="note">In some of the cases, companies may provide a component for telephone bills.Employees may provide actual phone usage bills to reimburse this component and make it non-taxable.
</field>
@@ -300,7 +300,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="name">Car Expenses Reimbursement</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.CEI.amount</field>
<field name="amount_python_compute">result = inputs.CEI and inputs.CEI.amount</field>
<field name="sequence" eval="38"/>
<field name="note">In case company provides component for this and employee use self owned car for official and personal purposes, Rs 1800 per month would be non-taxable on showing bills for fuel or can maintenance. This amount would be Rs 2400 in case car is more capacity than 1600cc.</field>
</record>
@@ -310,7 +310,7 @@ Now difference of income tax between payment year and actual year would be allow
<field name="name">Internet Expense</field>
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = inputs.IE.amount</field>
<field name="amount_python_compute">result = inputs.IE and inputs.IE.amount</field>
<field name="sequence" eval="39"/>
<field name="note">Employer may also provide reimbursement of internet expenses and thus this would become non taxable.</field>
</record>
@@ -463,7 +463,7 @@ or - (contract.wage * contract.voluntary_provident_fund / 100))</field>
<field name="category_id" ref="hr_payroll.DED"/>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">result = - (inputs.LAI.amount)</field>
<field name="amount_python_compute">result = inputs.LAI and - (inputs.LAI.amount)</field>
<field name="register_id" ref="hr_leave_availed_register"/>
<field name="sequence" eval="180"/>
</record>