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

I created form view for school.student model 

i putted subjects field in the bottom of the form view but it is showen in the top of the form

Why??

this is thcode of student form view:

id="school_student_view_form" model="ir.ui.view">
name="name">school.student.view.form
name="model">school.student
name="arch" type="xml">
string="Student">



name="name"/>
name="class_id"/>
name="division"/>
name="address"/>


name="birth_date"/>
name="age"/>
name="date"/>
name="officer"/>
name="subjects"/>





this is the code of school.student model:

class school_student(models.Model):
_name='school.student'
name=fields.Many2one('res.partner',string='Student Name')
subjects=fields.Many2many('school.subject',string="Subjects")
class_id=fields.Integer(string="Class ID")
address=fields.Char(string="Address")
division=fields.Char(string="Division")
birth_date=fields.Date(string="Birth Date")
age=fields.Integer(string="Age",compute='_compute_age')
date=fields.Date()
officer=fields.Many2one('res.users')

this the screen of the output:


Avatar
Annuleer
Beste antwoord

Hello Asmaa, 

Please find code in comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Annuleer

Please find below code it may help you to resolve this issue,

id="school_student_view_form" model="ir.ui.view">
name="name">school.student.view.form
name="model">school.student
name="arch" type="xml">
string="Student">
<sheet>
<group>
name="name"/>
name="class_id"/>
name="division"/>
name="address"/>
name="birth_date"/>
name="age"/>
name="date"/>
name="officer"/>
name="subjects"/>
</group>
</sheet>

Beste antwoord

Hi,

Can you activate the developer mode and open your form view and from the debugger button, click on Edit View: Form and see whether you can see the added form view there or not.

As per the shared screen shot, it seems like that the added form is not get added to the database yet. So most probably when you click Edit View: Form, you will see empty form view.


So just make sure that the file in which you have added the form view is added in the manifest file and upgrade the module after adding the view.

If you are new in Odoo, and learning odoo 16 development, follow: odoo 16 development tutorials 

Thanks

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mei 23
2276
1
nov. 22
2853
1
jun. 22
3080
2
aug. 24
3554
1
apr. 24
2014