Rui Vieira
Rui Vieira

Reputation: 23

Odoo One2Many table creates line when pressing enter

I made a relational table in my own created object called typology. here's how the thing works there’s a field in which you have to enter something like 1+1 or 2+3+4 and for each number in this field lines are created on this typology table, so the only thing that allows creation of lines in this table it's this field.

Now for each line I have to fill it with integers there are two columns Gross Weight and Tare, everything seems fine but when I’m filling the last fields in the typology table tree even though I have create=false if I press enter to enter the value it creates a new line.

<field name="typology_table" attrs="{'readonly':[('completed_flag','=',True)]}" class="table_w_symbol_label">
    <tree editable="bottom" create="false" open="false" delete="false">
        <field name="axis" readonly="1"/>
        <field name="position" readonly="1"/>
        <field name="tare"/>
        <field name="symbol" style="width:2%"/>
        <field name="gross_weight"/>
        <field name="symbol" style="width:2%"/>
    </tree>     
</field>

Anyone have any idea on how I can prevent this from happening. Thanks in advance for the help!

img

NOTE:

I'm developing my module in my local computer but I upload it to an instance so I can make some tests, the problem persist in this instance but not locally, there are several differences for example when I print a report locally it's bigger than the development instance report. I don't get it bc they both have exactly the same modules

Upvotes: 1

Views: 404

Answers (1)

Try:

<field name="typology_table" attrs="{'readonly':[('completed_flag','=',True)]}" class="table_w_symbol_label" options="{'no_create': True}">

instead of using the create attr on the tree.

Upvotes: 0

Related Questions