Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
5650 Представления

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

Аватар
Отменить
Автор

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

Лучший ответ

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>
Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
апр. 19
2272
2
мая 24
7311
1
янв. 21
4173
0
мар. 15
4055
1
мар. 15
12147