Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
11806 Visualizações

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
Cancelar
Autor Melhor resposta

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
jan. 25
1894
2
set. 23
7746
2
mar. 23
46846
2
set. 22
9645
2
dez. 23
57767