<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018-20 ForgeFlow S.L. (http://www.forgeflow.com)
     License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
    <record id="view_move_tree" model="ir.ui.view">
        <field name="name">stock.move.tree</field>
        <field name="model">stock.move</field>
        <field name="inherit_id" ref="stock.view_move_tree" />
        <field name="arch" type="xml">
            <field name="state" position="after">
                <button
                    title="Go to Source"
                    name="action_open_stock_move_source"
                    icon="fa-arrow-right"
                    type="object"
                />
            </field>
        </field>
    </record>
    <record id="view_move_form" model="ir.ui.view">
        <field name="name">stock.move.form</field>
        <field name="model">stock.move</field>
        <field name="inherit_id" ref="stock.view_move_form" />
        <field name="arch" type="xml">
            <field name="date" position="attributes">
                <attribute name="invisible">False</attribute>
            </field>
            <field name="move_dest_ids" position="after">
                <field name="buffer_ids" />
            </field>
        </field>
    </record>
    <record id="view_move_consumption_pivot" model="ir.ui.view">
        <field name="name">stock.move.consumption.pivot</field>
        <field name="model">stock.move</field>
        <field name="arch" type="xml">
            <pivot string="Stock Moves Yearly Consumption">
                <field name="date" interval="month" type="row" />
                <field name="location_dest_id" type="col" />
                <field name="product_uom_qty" type="measure" />
            </pivot>
        </field>
    </record>
    <record id="stock_move_year_consumption_action" model="ir.actions.act_window">
        <field name="name">Stock Move Last Year Consumption</field>
        <field name="res_model">stock.move</field>
        <field name="view_id" ref="ddmrp.view_move_consumption_pivot" />
        <field
            name="context"
        >{"time_ranges": {"field": "date", "range": "last_365_days"}}</field>
        <field name="domain" />
        <field name="view_mode">pivot</field>
    </record>
</odoo>
