Skip to Content
Menu
This question has been flagged
8401 Views

Hello,

I have created a simple form. i create a tree view, but when i open tree view, it will report error that "cannot read property of undefined"?

here is my code


<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="student_parent_view_form" model="ir.ui.view">
<field name="name">student.parent.view.form</field>
<field name="model">student.parent</field>
<field name="arch" type="xml">
<form string="Parent">
<sheet>
<field name="image" widget="image" class="oe_avatar" options="{&quot;size&quot;: [90, 90]}"/>
<div class="oe_title">
<h1>
<field name="name" default_focus="1" placeholder="Name"/>
</h1>
</div>
<br/>
<div class="oe_left">
<label for="relation">Relation</label>
<br/>
<field name="relation" required="1"/>
<br/>
<field name="relation_guard" placeholder="Relationship"
attrs="{'invisible': [('relation', '!=', 'guardian')], 'required': [('relation', '=', 'guardian')]}"/>
</div>
<group colspan="4">
<group string="Contact Information" name="communication" col="4" colspan="4">
<field name="gender"
attrs="{'readonly': [('relation', '!=', 'guardian')]}" force_save="1"/>
<field widget="mask" data-inputmask="'mask': '99999-9999999-9'" name="cnic_no"/>
<field name="email" widget="email" required="1"/>
<field name="occupation"/>
<field name="mobile" widget="phone"/>
<field name="phone" widget="phone"/>
<field name="title" options="{&quot;no_open&quot;: True}"/>
<field name="lang"/>
<field name="user_ids" invisible="1"/>
<field name="spouse_id"/>
</group>
<group string="Postal Address" name="postal_address">
<label for="street" string="Address"/>
<div class="o_address_format">
<field name="street" placeholder="Street..." class="o_address_street"/>
<field name="street2" placeholder="Street 2..." class="o_address_street"/>
<field name="city_id" placeholder="City" class="o_address_city"/>
<field name="town_id" class="o_address_state" placeholder="Town"
options="{&quot;no_open&quot;: True}"
context="{'country_id': country_id, 'zip': zip}"/>
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
<field name="country_id" placeholder="Country" class="o_address_country"
options="{&quot;no_open&quot;: True, &quot;no_create&quot;: True}"/>
</div>
<field name="is_employee" readonly="1" force_save="1"/>
<field name="employment_type" readonly="1" force_save="1"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

<record model="ir.ui.view" id="student_parent_view_tree">
<field name="name">student.parent.view.list</field>
<field name="model">student.parent</field>
<field name="arch" type="xml">
<tree editable="top" string="Parent">
<field name="name"/>
</tree>
</field>
</record>

<record model="ir.actions.act_window" id="student_parent_view_list">
<field name="name">student.parent.view.list</field>
<field name="res_model">student.parent</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
Avatar
Discard