コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2648 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
2
8月 21
6716
0
12月 24
1365
1
3月 24
2423
2
12月 23
14698
0
10月 23
33