Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8096 มุมมอง

I am creating a table in the database using the below query:

CREATE TABLE location (
  data jsonb
);


Now I don't want to create a model. but want to make a view which shows the record from the location table.

The records in the table are like:
data

{"angle": -84.34, "speed": 93.2, "status": "intransit", "trip_id": 80, "latitude": -1.236294, "longitude": 36.748787, "location_stamp": "2019-07-04  07:43:10"}
{"angle": -84.34, "speed": 93.2, "status": "intransit", "trip_id": 80, "latitude": -1.236294, "longitude": 36.748787, "location_stamp": "2019-07-04  07:43:10"}

How can I do this? Please suggest me any way to do this.
Thank you

อวตาร
ละทิ้ง

Hello,You can do it in two way:Creating a model like sale.report to just view without saving. Or you can extend interface

คำตอบที่ดีที่สุด

HI, you can follow following tutorial for this:

https://youtu.be/kwkddYoFQCE

Hope it helps,

Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Rohit,

Try if following way if it's work for you.

There is method called default_get(), this method call when any record open in form view or created. So what you have to do is you have to do all coding in default_get and fill form values from database table's dictionary values.

Hope it will helpful for you.

Thanks and regards

Haresh Kansara

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 19
6392
3
ต.ค. 18
19541
many2many_tags widget with hyperlink แก้ไขแล้ว
4
ธ.ค. 23
13428
1
พ.ย. 18
6494
Select multiple elements with XPath แก้ไขแล้ว
5
ส.ค. 24
46754