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

        <record model="ir.cron" id="ir_cron_import_sale_orders" forcecreate="True">
            <field name="name">Opencart - Import Sales Orders</field>
            <field name="active" eval="False"/>
            <field name="state">code</field>
            <field name="user_id" ref="base.user_root"/>
            <field name="interval_number">1</field>
            <field name="interval_type">hours</field>
            <field name="numbercall">-1</field>
            <field name="doall" eval="False"/>
            <field ref="connector_opencart.model_opencart_backend" name="model_id"/>
            <field name="code">model._scheduler_import_sale_orders()</field>
        </record>

        <record id="excep_wrong_total_amount" model="exception.rule">
            <field name="name">Total Amount differs from Opencart</field>
            <field name="description">The amount computed in Odoo doesn't match with the amount in Opencart.

Cause:
The taxes are probably different between Odoo and Opencart. A fiscal position could have changed the final price.

Resolution:
Check your taxes and fiscal positions configuration and correct them if necessary.</field>
            <field name="sequence">30</field>
            <field name="model">sale.order</field>
            <field name="code">failed = object.opencart_bind_ids and abs(object.amount_total - object.opencart_bind_ids[0].total_amount) >= 0.01</field>
            <field name="active" eval="True"/>
        </record>

    </data>

    <record id="group_order_comment_review" model="res.groups">
        <field name="name">Opencart Order Comment Reviewer</field>
    </record>

    <record id="checkpoint" model="mail.activity.type">
        <field name="name">Opencart Checkpoint</field>
        <field name="summary">Opencart checkpoint.</field>
        <!-- TODO maybe add something like this in connector -->
<!--        <field name="category">checkpoint</field>-->
        <field name="chaining_type">trigger</field>
    </record>

</odoo>
