콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
4806 화면

<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.





아바타
취소
베스트 답변

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

아바타
취소
베스트 답변

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.

아바타
취소