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

    <record id="view_walmart_backend_form" model="ir.ui.view">
        <field name="name">walmart.backend.form</field>
        <field name="model">walmart.backend</field>
        <field name="arch" type="xml">
            <form string="Walmart Backend">
                <header>
                </header>
                <sheet>
                    <label for="name" class="oe_edit_only"/>
                    <h1>
                        <field name="name" class="oe_inline" />
                    </h1>
                    <group name="walmart" string="Walmart Configuration">
                        <notebook>
                            <page string="API" name="api">
                                <group colspan="4" col="4">
                                    <field name="client_id"/>
                                    <field name="client_secret" password="1"/>
                                </group>
                            </page>
                        </notebook>
                    </group>
                    <group name="main_configuration" string="Main Configuration">
                        <group name="order_configuration" string="Order Defaults">
                            <field name="warehouse_id"/>
                            <field name="analytic_account_id"/>
                            <field name="fiscal_position_id"/>
                            <field name="team_id"/>
                            <field name="user_id"/>
                            <field name="sale_prefix"/>
                            <field name="payment_mode_id"/>
                            <field name="acknowledge_order"/>
                        </group>
                        <group name="product_configuration" string="Product Defaults">
                            <field name="product_categ_id"/>
                        </group>
                    </group>
                    <notebook>
                        <page name="import" string="Imports">
                            <p class="oe_grey oe_inline">
                                By clicking on the buttons,
                                you will initiate the synchronizations
                                with Walmart.
                                Note that the import or exports
                                won't be done directly,
                                they will create 'Jobs'
                                executed as soon as possible.
                            </p>
                            <p class="oe_grey oe_inline">
                                Once imported,
                                some types of records,
                                like the products or categories,
                                need a manual review.
                                You will find the list
                                of the new records to review
                                in the menu 'Connectors > Checkpoint'.
                            </p>
                            <group>
                                <div>
                                    <label string="Import sale orders since" class="oe_inline"/>
                                    <field name="import_orders_from_date"
                                        class="oe_inline"
                                        nolabel="1"/>
                                </div>
                                <button name="import_sale_orders"
                                    type="object"
                                    class="oe_highlight"
                                    string="Import in background"/>
                            </group>

                        </page>

                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_walmart_backend_tree" model="ir.ui.view">
        <field name="name">walmart.backend.tree</field>
        <field name="model">walmart.backend</field>
        <field name="arch" type="xml">
            <tree string="Walmart Backend">
                <field name="name"/>
                <field name="import_orders_from_date"/>
            </tree>
        </field>
    </record>

    <record id="action_walmart_backend" model="ir.actions.act_window">
        <field name="name">Walmart Backends</field>
        <field name="res_model">walmart.backend</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="view_walmart_backend_tree"/>
    </record>

</odoo>
