Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
4812 Weergaven

<odoo>
<data>
<!-- explicit list view definition -->

<record model="ir.ui.view" id="patient_tree">
<field name="name">hospital.patient.tree</field>
<field name="model">hospital.patient</field>
<field name="arch" type="xml">
<tree string="Patients">
<field name="name"/>
<field name="age"/>
<field name="notes"/>
</tree>
</field>
</record>

<record model="ir.ui.view" id="patient_form">
<field name="name">hospital.patient.form</field>
<field name="model">hospital.patient</field>
<field name="arch" type="xml">
<form string="Patients">
<sheet>
<group>
<field name="name"/>
<field name="age"/>
<field name="notes"/>
</group>
</sheet>
</form>
</field>
</record>

<record model="ir.actions.act_window" id="action_patient">
<field name="name">Patients</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hospital.patient</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Create a new Patient.
</p>
</field>
</record>

<menuitem id="hospital_root" name="Hospital" sequence="0"/>
<menuitem id="hospital_patient" name="Patients" parent="hospital_root" action="action_patient"/>








IN my models.py :


from odoo import models, fields, api


class mymodule(models.Model):
_name = 'hospital.patient'
_description = 'Patient Records'

name = fields.Char(string='Name')
age = fields.Integer(string="Age")
notes = fields.Text(string="Notes")


Only the "Name" column is showed in tree view. Please help me.





Avatar
Annuleer
Beste antwoord

Hi,

Activate the developer mode and click the debugger button from the corresponding tree view and see whether its external ID is same as of the one which defined in the code. As Duc specified any chance to define another tree view for the same model ? check that too.

If there is multiple tree view for the model, the one which having low priority/sequence will be called first, if same priority for both, the view with the lowest id will be displayed.

Thanks

Avatar
Annuleer
Beste antwoord

are you check another tree view for this model with sequence smaller than this tree view ? if exist you can delete that tree view and if not, you try to upgrade this module again and F5 browser.

Avatar
Annuleer