<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>

<!-- HR SALARY RULES-->
    <record id="hr_payroll_rules_wa_unemp_wages_2018" model="hr.salary.rule">
        <field name="sequence" eval="423"/>
        <field name="category_id" ref="hr_payroll_wa_unemp_wages"/>
        <field name="name">Washington Unemployment - Wages (2018)</field>
        <field name="code">WA_UNEMP_WAGES_2018</field>
        <field name="condition_select">python</field>
        <field name="condition_python">result = (payslip.date_to[:4] == '2018')</field>
        <field name="amount_select">code</field>
        <field name="amount_python_compute">
###
ytd = payslip.sum('WA_UNEMP_WAGES_2018', '2018-01-01', '2019-01-01')
ytd += contract.external_wages
remaining = 47300.0 - ytd
if remaining &lt;= 0.0:
    result = 0
elif remaining &lt; categories.BASIC:
    result = remaining
else:
    result = categories.BASIC
        </field>
        <field name="appears_on_payslip" eval="False"/>
    </record>
    <record id="hr_payroll_rules_wa_unemp_2018" model="hr.salary.rule">
        <field name="sequence" eval="443"/>
        <field name="category_id" ref="hr_payroll_wa_unemp"/>
        <field name="name">Washington Unemployment (2018)</field>
        <field name="code">WA_UNEMP_2018</field>
        <field name="condition_select">python</field>
        <field name="condition_python">result = (payslip.date_to[:4] == '2018')</field>
        <field name="amount_select">code</field>
        <field name="amount_python_compute">
result_rate = -contract.wa_unemp_rate(2018)
result = categories.WA_UNEMP_WAGES

# result_rate of 0 implies 100% due to bug
if result_rate == 0.0:
    result = 0.0
        </field>
        <field name="register_id" ref="contrib_register_wador_unemp"/>
        <field name="appears_on_payslip" eval="False"/>
    </record>

    </data>
</odoo>
