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

Hello, I encounter the following problem, when I try to extend the model 'res_users', this one does not take the extra fields,

Model:

class res_users(models.Model):

    _inherit = 'res.users' consultation_place = fields.Many2one('oocular.place', string=_('Consultations Place'))

    def __init__(self, pool, cr):

        init_res = super(res_users, self).__init__(pool, cr) self.SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS) self.SELF_WRITEABLE_FIELDS.extend(['consultation_place']) return init_res


XML:

<?xml version="1.0" encoding="utf-8"?>

<openerp>

    <data>
        <record id="add_to_user_preferences" model="ir.ui.view">
            <field name="name">Inhetitance In Preference</field>
            <field name="model">res.users</field>
            <field name="inherit_id" ref="base.view_users_form_simple_modif"/>
            <field name="arch" type="xml">
                <xpath expr="//page/group/field[@name='preferences']" position="after"> <field name="consultation_place" readonly="0"/> </xpath>
            </field>
        </record>
    </data>
</openerp>

I do not understand from where my mistake can you orient me towards the solution?

아바타
취소
작성자

Sorry and error :

ProgrammingError: column res_users.consultation_place does not exist

LINE 1: ... as "create_uid","res_users"."active" as "active","res_users...

베스트 답변

You could remove all the code for the __init__ method because is no needed. After that just start/restart the server to install/update your module so the field is installed properly in the model

아바타
취소
관련 게시물 답글 화면 활동
1
11월 24
3765
1
10월 17
16179
2
10월 17
7444
1
5월 16
6058
4
2월 25
3272