Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
760 Widoki

I have created a Model below, I can view it in pgAdmin, see the properties, browse data by Right Clicking on table name and use View/Edit Data option but when trying to access via sql statement it is showing error as 

ERROR: relation "public.k2p_cities" does not exist

SQL state: 42P01


SELECT * FROM public.k2p_cities -- (with and without public. the result is same)

ORDER BY id ASC;


Model Code:


# noinspection PyUnresolvedReferences

from odoo import api, fields, models


class K2PCities(models.Model):

_name = 'k2p.cities'

_description = "Cities"


name = fields.Text(string="City Name", required=True)

country_id = fields.Many2one('res.country', string='Country', readonly=False, store=True)

state_id = fields.Many2one('res.country.state', string='State', required=True,

domain="[('country_id', '=', country_id)]")


in another apps i have created Models the same way and i can query, upload csv data from pgAdmin but this is very strange problem, please help.


regards


Awatar
Odrzuć
Autor

sorry guys, it was my fault, i was in another database instance. its working fine now, i have uploaded csv data successfully.
.