콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2866 화면

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

아바타
취소
베스트 답변

You should try to add readonly attribute

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

아바타
취소
관련 게시물 답글 화면 활동
0
4월 22
2132
4
2월 25
2438
1
8월 24
2036
2
11월 24
3210
1
4월 24
3428