Skip to Content
Menu
This question has been flagged
1 Reply
2120 Views

Hello,

I am customizing Odoo 8's project module. 

My requirement is to not allow any work summary entry on a task if a task is "Done".


Here is my xml file:

<openerp>

<data>  

   <!-- FORM View -->

<record id="project_task_forms" model="ir.ui.view">

            <field name="name">Project Task Form</field>

            <field name="model">project.task</field>

            <field name="inherit_id" ref="project.view_task_form2"/>

            <field name="type">form</field>

            <field name="arch" type="xml">

               <xpath expr="//field[@name='work_ids']//tree" position="attributes">

                   <attribute name="editable"/>

                </xpath>

            </field>

        </record>

</data>

</openerp>   


.... in the standard module project_view.xml, i see the editable attribute on the Tree tag set to "top".


 <field name="work_ids" groups="project.group_tasks_work_on_tasks">

                                <tree string="Task Work" editable="top">

                                    <field name="name"/>

                                    <field name="hours" widget="float_time" sum="Spent Hours"/>

                                    <field name="date"/>

                                    <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_user']}"/>

                                </tree>

                            </field>


i would like to remove this editable attribute when stage_id is done..

Could you help me out here?

Thanks,

Annette

Avatar
Discard
Best Answer

You should try to add readonly attribute

attrs="{'readonly' : [('state', '=', 'done')]}" />

Avatar
Discard
Related Posts Replies Views Activity
0
Apr 22
1207
1
Aug 24
421
2
Nov 24
751
1
Apr 24
2273
3
Oct 23
13195