콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

Hi Odoo developers.

I have created a new model Comercial which inherits from res.users model using delegation inheritance.

class Comercial(models.Model):
_name = 'crm.comercial'
_inherits = {'res.users': 'usuario_id'}

num_ventas = fields.Integer()
usuario_id = fields.Many2one('res.users', required=True, ondelete='restrict',
        auto_join=True)
name = fields.Char(related='usuario_id.name', inherited=True)
email = fields.Char(related='usuario_id.email', inherited=True)

I haven't defined a form view for Comercial model, so when I create a new Comercial in a form, it shows all fields from res.users model and res.partner model. It shows the fields from res.partner model because res.users inherits from res.partner using delegation inheritance too.

class res_users(osv.osv):
...
_inherits = {
'res.partner': 'partner_id',
}
...
'partner_id': fields.many2one('res.partner', required=True,
string='Related Partner', ondelete='restrict',
help='Partner-related data of the user', auto_join=True),

When I create a new Comercial in the form and click on the Save button, I get this error:


File "/opt/odoo/odoo_server/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
ProgrammingError: invalid reference to FROM-clause entry for table "res_users"
LINE 2: ...ario_id" = "crm_comercial__usuario_id"."id") AND ("res_users...
                                                                                                  ^
HINT: Perhaps you meant to reference the table alias "crm_comercial__usuario_id".

Thank you. 


아바타
취소
관련 게시물 답글 화면 활동
1
3월 16
10795
2
3월 15
6244
0
6월 25
831
1
2월 24
2949
2
7월 23
3329