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

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'

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

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 '.'

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ส.ค. 21
6691
0
ธ.ค. 24
1339
Import Data From Another Model แก้ไขแล้ว
1
มี.ค. 24
2402
Odoo Mail Sending Limit แก้ไขแล้ว
2
ธ.ค. 23
14664
0
ต.ค. 23
33