Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
7648 Näkymät

[ODOO11] Hi. I have an editable tree view inside my form view (see picture: https://ibb.co/gsCVKK)

I can edit the values inside the tree but everytime I hit the Save button at top, it doesn't save the update values inside my tree. It goes back to default (in this case 0). My assumption is, the "Save" button is for the form view alone. It's not the save button for the tree view which is why values are not updating.
Below is my code for my form view:

        <record model="ir.ui.view" id="score_card_form_view">
            <field name="name">Score Card</field>
            <field name="model">golf_online_ph.score_card</field>
            <field name="arch" type="xml">
                <form>
                    <sheet>
                        <group string="Score Card">
                            <field name="round_id" />
                            <field name="player_id" />
                            <field name="round_holes">
                                <tree editable="top" >
                                    <field name="hole_number" readonly="1"/>
                                    <field name="score_value"/>
                                </tree>
                            </field>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>
Avatar
Hylkää
Paras vastaus
hole_number is the Many2one then try the following code 
(I think the problem hole_number is mandatory field on python code and it's readonly on xml)

<record model="ir.ui.view" id="score_card_form_view">
            <field name="name">Score Card</field>
            <field name="model">golf_online_ph.score_card</field>
            <field name="arch" type="xml">
                <form>
                    <sheet>
                        <group string="Score Card">
                            <field name="round_id" />
                            <field name="player_id" />
                            <field name="round_holes">
                                <tree editable="top" >
                                    <field name="hole_number" invisible="1"/>
                                    <field name="score_value"/>
                                </tree>
                            </field>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>
Avatar
Hylkää
Paras vastaus

Your view is correct, can you post the code for model file for the same? It seems the manytomany/onetomany field is incorrect

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
syysk. 23
4637
2
toukok. 21
18958
2
kesäk. 22
3993
0
syysk. 21
2171
0
syysk. 20
1773