This question has been flagged
2 Replies
10494 Views

I am having one2many field. It is showing me "Add an item" link. I am having following requirements. Please help.

1. I am having around 30 fields related to this one2many fields and appears in pop-up when i click on "Add an item" link. I want to show all of them without pop-up means on the space itself where this "Add an item" link appears.

2. I want to addonly one record for this not more than that. So how to restrict.

The thing is i want to achieve one2one functionality using this. Please suggest if any other solution suits my requirement.

Thanks in advance!!!

Avatar
Discard
Author Best Answer

I have fixed this issue using one2one (indirectly by inheritance by deligation). Please check here : https://www.odoo.com/forum/help-1/question/one2one-relation-in-openerp-solved-56780

Avatar
Discard
Best Answer

Hi you can specify what are all the fields shown in one2many popup.

In py,


'field_name': fields.one2many( 'model_name', string="one2many"),

In xml,

<field name="field_name">
                            <tree string="Demo">
                                <field name="field_name" />
                            </tree>
                            <form string="Demo" version="7.0">
                                <sheet>
                                    <group>
                                        <field name="field_name" />
                                    </group>
                                </sheet>
                            </form>

</field>



Or you can make the tree view itself editable like,


<field name="One2many_field_name" >
                                    <tree editable="bottom">
                                        <field name="name"/>                                       
                                    </tree>
</field>

As far as I know you can not switch to form view without a pop-up or new window.
 

Avatar
Discard