Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Readonly field in workflow

By
Trai Doan
on 12/8/14, 10:18 AM 507 views

<record id="phieuxuatform" model="ir.ui.view">
            <field name="name">Phiếu xuất</field>
            <field name="model">tt_phieuxuat</field> 
            <field name="type">form</field>
            <field name="arch" type="xml">
                    <form>
                        <header>
                            <button name="getdonhang" string="Lấy sản phẩm từ đơn hàng" type="object" states="new"/>
                            <button name="mymod_negotiation" string="Xem xét" states="new" class="oe_highlight" type="workflow" confirm="Vui lòng xem xét kĩ vì sau bước này bạn không được quyền chỉnh sửa nữa?"/>
                            <button name="mymod_won" string="Đồng ý" states="negotiation" class="oe_highlight" type="workflow"/>
                            <button name="mymod_lost" string="Không đồng ý" states="negotiation" class="oe_highlight" type="workflow"/>
                            <field     name="state" widget="statusbar" statusbar_visible="new,negotiation,won,lost"/>
                        </header>
                        <sheet>
                        <separator string ="Thông tin"/>
                            <group col="2">
                                <field name="name" on_change="getname()" attrs="{'readonly': [('state', 'in',['won','lost'])]}"/>
                                <field name="ten" attrs="{'readonly': [('state', 'in',['won','lost'])]}"/>
                                <field name="nam" attrs="{'readonly': [('state', 'in',['won','lost'])]}"/>
                                <field name="ngay" attrs="{'readonly': [('state', 'in',['won','lost'])]}"/>
                                <field name="donhang" domain="[('tinhtrang','=','ht')]" attrs="{'readonly': [('state', 'in',['won','lost'])]}"/>
                            </group>
                            <field name="danhsach" attrs="{'readonly': [('state', 'in',['won','lost'])]}"/>
                        </sheet>
                    </form>
             </field>
        </record>

I try to make form views read only or  all fields read only in state win and lost but it doesn't work .Please help me to solve it.Thanks you :))

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/8/14, 10:18 AM
Seen: 507 times
Last updated: 3/16/15, 8:10 AM