Odoo Help

4

3
11 Answers
0
Mathieu Laflamme Canada
9/1/16, 12:16 PM

This would be very handy indeed.

Also documentation makes no mention that "Invisible" attribute is working, but not "readonly" and "required".

https://www.odoo.com/documentation/9.0/reference/views.html#structural-components

0
Avatar

Atul Kumar jain India

--Atul Kumar jain--
944
| 5 3 9
Indore, India
--Atul Kumar jain--

.

Atul Kumar jain India
4/22/14, 10:24 AM

I have used it in my custom module

<page string="Campaign Details">
                    <field name="outdoor" widget="outdoor" attrs="{'invisible':[('type_of_activity','=','paper_media')]}" >
                    <tree string="Out Door Activity" editable="bottom">
                        <field name="sequence_no"/>
                        <field name="product_id"/>
                        <field name="places"/>
                        <field name="duration"/>
                        <field name="width"/>
                        <field name="length"/>
                        <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                        <field name="price"/>
                        <field name="quantity"/>
                        <field name="price_subtotal"/>
                    </tree> 
                    </field>
</page>
4 Comments
Atchuthan - Technical Consultant, Sodexis Inc India
4/22/14, 10:52 AM

yes, I can also use it on a single field.

I am asking how to set readonly for a group or page

Atchuthan - Technical Consultant, Sodexis Inc India
4/22/14, 10:54 AM

also only invisible works in attrs of group and page

Atul Kumar jain India
4/22/14, 10:58 AM

i think you should have use this for readonly <group string="Data"> <field name="url" widget="url" attrs="{'readonly':[('type','=','binary')]}"/> </group>

Atchuthan - Technical Consultant, Sodexis Inc India
4/22/14, 11:26 AM

yes but my question regards to use of attrs="{'readonly':[domain]}" in PAGE and GROUP

0
Avatar

Prakash India

--Prakash--

11631
| 6 7 9
Bikaner, India
--Prakash--

OpenERP Developer at SunARC Technology

Prakash India
4/22/14, 10:19 AM

In Default Openerp Project Module attrs readonly used in the <page> tag:-

addons/project/project_view.xml

<page string="Extra Info" attrs="{'readonly':[('state','=','done')]}">
                            <group col="4">
                                <field name="priority" groups="base.group_user"/>
                                <field name="sequence"/>
                                <field name="partner_id"/>
                                <field name="state" invisible="1"/>
                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                            </group>
                            <group>
                                <group string="Gantt View">
                                    <field name="date_start"/>
                                    <field name="date_end"/>
                                </group>
                                <group>
                                </group>
                            </group>
</page>
1 Comment
Atchuthan - Technical Consultant, Sodexis Inc India
4/22/14, 10:23 AM

yes, its available in code. But its not working in project_view

Ask a Question
Tags
Keep Informed
3 follower(s)
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.

Register
Odoo Training Center

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

Test it now