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

When I inherit from base view "base.view_partner_form"
it doesn't show the regular customer view as in sales, instead I got what in the pic below

 


My code as below

class Director(Model):
    _name = 'director'   
_inherit = 'res.partner'   

gender = Selection([('male', 'Male'), ('female', 'Female')], default='male')   
end_date = Date()   
degree = Integer(default=1)
 
    # communication tab   
passport = Char()   
passport_expire = Date()   
driving_license = Char()   
visa_date = Date()   
visa_expire = Date()
<record id="view_partner_form_inherited" model="ir.ui.view">
            <field name="name">Inherited Form View</field>
            <field name="model">director</field>
            <field name="inherit_id" ref="base.view_partner_form"/>
            <field name="arch" type="xml">
                <!--<xpath expr="//field[@name='fax']" position="attributes">-->
               <!--<attribute name="invisible">1</attribute>-->
                <!--</xpath>-->
                <!--<xpath expr="//field[@name='fax']" position="after">-->
                <!--<field name='gender'/>-->
                <!--</xpath>-->           
</field>       
</record>
아바타
취소

class Director(Model):

_name = 'director'

_inherit = 'res.partner'

This style of inheritance is extension which means 'director' model represents a new table based on 'res.partner', so that modify 'director' won't affect 'res.partner'. You may try classical inheritance below.

class Director(Model):

_inherit = 'res.partner'

작성자

Actually it works, but is there a way to inherit as extension so I can refer to the model with its name "director" not "res,partner"?

관련 게시물 답글 화면 활동
1
5월 16
4908
View inheritance 해결 완료
1
3월 20
3620
5
12월 18
3598
12
12월 18
34971
1
7월 16
7194