Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
5641 Visualizações

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')

Avatar
Cancelar
Autor

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

Melhor resposta

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>
Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
abr. 19
2268
2
mai. 24
7301
1
jan. 21
4172
0
mar. 15
4052
1
mar. 15
12142