Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6186 Lượt xem

I have create a the view via sql, but data is not showing and no error are coming? 

Please help me on it. 

what is wrong on this code?

==================Model===========odoo 12========

from odoo import api, fields, models
from odoo import tools

class adminssionverify(models.Model):
_name = 'adminssionverify.adminssionverify'
_description = "Admission"
_auto = False

getStuname = fields.Char(string='Name')

@api.model_cr
def int(self):
tools.drop_view_if_exists(self._cr, 'adminssionverify_adminssionverify')
self._cr.execute("""
CREATE OR REPLACE VIEW adminssionverify_adminssionverify AS (
SELECT row_number() OVER() AS id, line.getStuname FROM (
SELECT st.name as getStuname
FROM student_student st
) line
)""")

=================View==================


teacher list
adminssionverify.adminssionverify








Student teacher window
ir.actions.act_window
adminssionverify.adminssionverify
tree,form










Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi lbrahim, 

I have I have already watched the video, and Query is not return the result?

Ảnh đại diện
Huỷ bỏ

can you run the query directly in postgres and see whether you get the result

Tác giả

Niyas,

I have run the query in postgres and query is working fine. but data is not showing on tree view.

Câu trả lời hay nhất

Hi, 
please watch this video: https://www.youtube.com/watch?v=_KIsGo4sttQ where it shows perfectly how to create view and display data in form view

Ảnh đại diện
Huỷ bỏ