<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
    <!-- Test Purchase Request Exceptions Scheduler-->
    <record model="ir.cron" forcecreate="True" id="ir_cron_test_pr_request_except">
        <field
            name="name"
        >Purchase Request: Test Draft Purchase Requests Exception</field>
        <field name="model_id" ref="purchase_request.model_purchase_request" />
        <field name="state">code</field>
        <field name="code">model.test_all_draft_requests()</field>
        <field name="user_id" ref="base.user_root" />
        <field name="interval_number">20</field>
        <field name="interval_type">minutes</field>
        <field name="numbercall">-1</field>
        <field name="doall" eval="False" />
        <field name="active" eval="False" />
    </record>
    <record id="pr_excep_no_approver" model="exception.rule">
        <field name="name">No approver</field>
        <field name="description">No approver assigned for this request</field>
        <field name="sequence">10</field>
        <field name="model">purchase.request</field>
        <field name="code">
if not self.assigned_to:
    failed=True
        </field>
        <field name="active" eval="False" />
    </record>
    <record id="prl_excep_qty_check" model="exception.rule">
        <field name="name">Quantity not positive</field>
        <field
            name="description"
        >Purchase request line quantity must be positive</field>
        <field name="sequence">20</field>
        <field name="model">purchase.request.line</field>
        <field name="code">
if self.product_qty &lt; 0:
    failed=True
        </field>
        <field name="active" eval="False" />
    </record>
</odoo>
