Odoo Help


Readonly field in workflow

Trai Doan
on 12/8/14, 10:18 AM 691 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">
                            <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"/>
                        <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'])]}"/>
                            <field name="danhsach" attrs="{'readonly': [('state', 'in',['won','lost'])]}"/>

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 :))

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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