Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5639 Vizualizări

how do I display the values, I have a field that loads the model, but I don’t know how to get the data from this model to the tree, I can get any data from the model, but how can I get the data from this model to the tree. Help please, who than can

        <record id="view_order_form_without_customer" model="ir.ui.view">

            <field name="name">sale.order.form.appointment</field>

            <field name="model">sale.order</field>

            <field name="inherit_id" ref="sale.view_order_form"/>

            <field name="arch" type="xml">

            <xpath expr="//page/field[@name='order_line']/.." position="before">

                <page string="List appointment">

                    <field name="recapp">

                        <tree string="appointments">

                            <field name="date"/>

                            <field name="description" />

                        </tree>

                    </field>

                </page>

            </xpath>


            </field>

        </record>


class SaleAppointment(models.Model):

_inherit='sale.order'


recapp = fields.One2many('record.appointment', 'example')   


class RecordAppointment(models.Model):

_inherit='record.appointment'


example = fields.Many2one('sale.arder', ondelete='cascade')

Imagine profil
Abandonează
Autor

In model record.appointment has data and me need them output in it's tree inside view model sale.order

Cel mai bun răspuns

Hello @Stas,

try by this,

<record id="view_order_form_without_customer" model="ir.ui.view">
<field name="name">sale.order.form.appointment</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page[@name='order_lines']" position="before">
<page string="List appointment">
<field name="recapp">
<tree string="appointments" editable="bottom">
<field name="date"/>
<field name="description" />
</tree>
</field>
</page>
</xpath>
</field>
</record>
Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
apr. 19
2259
2
mai 24
7299
1
ian. 21
4172
0
mar. 15
4052
1
mar. 15
12142