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

When I change '_' for '.'  an error appears.

model name in pgAdmin: irco_festivos_res_partner_rel


@api.onchange('delegacion')

def onchange_delegacion(self):

_logger.info(self.env['irco.festivos.res.partner.rel'].search([]))


Error:

KeyError: 'irco.festivos.res.partner.rel'

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

Odoo uses MVC with Model first technique, so you have to create model in python file and add this file in __init__.py file. 

While you install this module, database table will be created automatically with the declared fileds. in pyhthon file if you have mentioned model name with '.' it will be replaced with '_' in database automatically. 

But if you have mentioned model name with '_' in python file then it will remain as it is, it won'y be changed to '.'

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 21
6692
0
thg 12 24
1340
1
thg 3 24
2402
2
thg 12 23
14665
0
thg 10 23
33