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


    <record id="project_project_view_form" model="ir.ui.view">
        <field name="name">project.project.maintenance.view.form</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.edit_project"/>
        <field name="arch" type="xml">
            <xpath expr="//page[@name='settings']" position="after">
                <page string="Maintenance" name="maintenance_details">
                    <field name="maintenance_ids">
                        <tree>
                            <field name="maintenance_type_id"/>
                            <field name="line_ids"/>
                            <field name="total_amount" sum="Total" widget="monetary"/>
                            <field name="currency_id" invisible="1"/>
                        </tree>
                        <form>
                            <group>
                                <field name="maintenance_type_id"/>
                                <field name="total_amount" widget="monetary" options="{'currency_field':'currency_id'}"/>
                                <field name="currency_id" invisible="1"/>
                            </group>
                            <group>
                                <field name="line_ids" colspan="4" nolabel="1" widget="one2many">
                                    <tree editable="top">
                                        <field name="maintenance_id" context="{'default_maintenance_type_id':parent.maintenance_type_id}" domain="[('maintenance_type_id','=',parent.maintenance_type_id)]"/>
                                        <field name="cost" widget="monetary" options="{'currency_field':'currency_id'}"/>
                                        <field name="currency_id" invisible="1"/>
                                    </tree>
                                    <form>
                                        <group>
                                        <field name="maintenance_id" context="{'default_maintenance_type_id':parent.maintenance_type_id}" domain="[('maintenance_type_id','=',parent.maintenance_type_id)]"/>
                                        <field name="cost" widget="monetary" options="{'currency_field':'currency_id'}"/>
                                        <field name="currency_id" invisible="1"/>
                                        </group>
                                    </form>
                                </field>
                            </group>
                        </form>
                    </field>
                </page>
            </xpath>
        </field>
    </record>


</odoo>
