<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="custom_account_analytic_line_form_view" model="ir.ui.view">
        <field name="name">account.analytic.line.custom.form</field>
        <field name="model">account.analytic.line</field>
        <field name="inherit_id" ref="analytic.view_account_analytic_line_form" />
        <field name="arch" type="xml">
            <group name="amount" position="after">
                <group name="manufacture" string="Manufacture">
                    <field name="stock_move_id" />
                    <field name="manufacturing_order_id" />
                </group>
            </group>
        </field>
    </record>
    <record id="custom_account_analytic_line_filter_view" model="ir.ui.view">
        <field name="name">account.analytic.line.custom.filter</field>
        <field name="model">account.analytic.line</field>
        <field name="inherit_id" ref="analytic.view_account_analytic_line_filter" />
        <field name="arch" type="xml">
            <filter name="date" position="after">
                <filter
                    name="related-mo"
                    string="Related to MO"
                    domain="[('manufacturing_order_id','!=',False)]"
                />
                <filter
                    string="Manufacturing Order"
                    name="group_by_mo"
                    domain="[]"
                    context="{'group_by': 'manufacturing_order_id'}"
                />
            </filter>
        </field>
    </record>
    <record id="action_new_mrp_analytic_items" model="ir.actions.act_window">
        <field name="name">Analytic Items</field>
        <field name="res_model">account.analytic.line</field>
        <field name="view_mode">tree,form</field>
        <field name="context">{'search_default_related-mo': True}</field>
    </record>
    <menuitem
        id="custom_account_analytic_line_menu"
        name="Analytic Items"
        parent="mrp.menu_mrp_reporting"
        action="action_new_mrp_analytic_items"
        sequence="30"
    />
</odoo>
