<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
	<data>

		<!-- PROJECTS STAGES -->
		<record id="project_task_type_cmrgs_form" model="ir.ui.view">
            <field name="name">project.task.type.cmrgs.form</field>
            <field name="model">project.task.type</field>
            <field name="inherit_id" ref="project.task_type_edit"/>
            <field name="arch" type="xml">
                <field name="sequence" position="after">
                    <field name="default_project_stage"/>
                    <field name="type_done"/>
                    <field name="type_cancel"/>
                </field>
            </field>
        </record>

		<record id="prime_view_project_kanban" model="ir.ui.view">
			<field name="name">project.project.prime.kanban</field>
			<field name="model">project.project</field>
			<field name="inherit_id" ref="project.view_project_kanban"/>
			<field name="arch" type="xml">
				<xpath expr="//kanban" position="attributes">
					<attribute name="on_create"/>
				</xpath>
			</field>
		</record>
	
		<record id="project_prime_form" model="ir.ui.view">
            <field name="name">project.project.prime.form</field>
            <field name="model">project.project</field>
            <field name="inherit_id" ref="project.edit_project"/>
            <field name="arch" type="xml">
				<field name="user_id" position="after">
					<field name="type_ids" widget="many2many_tags" options="{'no_create_edit':1}" />
				</field>
			
				<page name="description_page" position="replace">
					<page name="description_page" string="Info">
						<group col="4" colspan="4">
							<field name="department_id" required="1" options="{'no_create_edit':1, 'no_create':1}" />
							<field name="operational_objective_id" required="1" options="{'no_create_edit':1, 'no_create':1}" />
                            <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
						</group>
						<group col="4" colspan="4">
							<separator string="Period" colspan="4"/>
							<field name="date_start" required="1"/>
							<field name="date" string="End date"/>
						</group>
						<group col="4" colspan="4">
							<separator string="Budget" colspan="4"/>
							<field name="estimated_budget" />
							<field name="total_cost" readonly="1"/>
							<field name="budget_execution" widget="progressbar"/>
						</group>
						<group col="4">
							<separator string="Description" colspan="4"/>
                            <field name="description" nolabel="1" placeholder="Describe your project..." colspan="4" type="html"/>
						</group>
					</page>
				</page>
				<page name="settings" position="after">
					<page string="Team">
						<field name="team_members_line" colspan="4" nolabel="1">
							<tree string="Members">
								<field name="user_id"/>
								<field name="employee_id"/>
								<field name="department_id"/>
							</tree>
							<form string="Members">
								<sheet>
									<group colspan="4" col="4">
										<field name="user_id" options="{'no_create_edit':1, 'no_create':1}"/>
										<field name="employee_id" options="{'no_create_edit':1, 'no_create':1}"/>
										<field name="department_id" options="{'no_create_edit':1, 'no_create':1}"/>
									</group>
								</sheet>
							</form>
						</field>
					</page>
				</page>
            </field>
        </record>

		<record id="project_task_prime_form" model="ir.ui.view">
            <field name="name">project.task.prime.form</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='tag_ids']" position="after">
					<field name="task_cost" />
				</xpath>
                <xpath expr="//field[@name='project_id']" position="replace">
					<field name="project_id" domain="[('active', '=', True), ('company_id', '=', company_id)]"/>
				</xpath>
            </field>
        </record>

	</data>

</odoo>
