You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

47 lines
2.1 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_task_form2" model="ir.ui.view">
<!--Inherit Project from view-->
<field name="name">project.task.view.form.inherit.allocation.time.approval</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<!--Add certain Buttons to header portion-->
<xpath expr="//form//header">
<header>
<button type="object" name="action_approval"
attrs="{'invisible':[('new_stage','=',False)]}">
Manager Approval
</button>
<button type="object" name="action_done"
attrs="{'invisible':[
('to_progress_stage','=',False)]}">
Done
</button>
<button type="object" name="action_cancel"
attrs="{'invisible':[
('to_progress_stage','=',False)]}">
Cancel
</button>
</header>
</xpath>
<!--Add certain fields to Project form view-->
<field name="tag_ids" position="after">
<field name="new_stage" invisible="1"/>
<field name="to_approve_stage" invisible="1"/>
<field name="to_progress_stage" invisible="1"/>
<field name="task_create_boolean"/>
</field>
<!--Make stage as readonly-->
<xpath expr="//field[@name='stage_id']" position="attributes">
<attribute name="options"
>{'readonly':[('to_approve_stage', '=', True)]}</attribute>
</xpath>
<!--Make Planned Hours as readonly-->
<xpath expr="//field[@name='planned_hours']" position="attributes">
<attribute name="attrs"
>{'readonly':[('to_progress_stage', '=', True)]}</attribute>
</xpath>
</field>
</record>
</odoo>