I want to create a new object type that inherits from *res.partner* and have the same formatting in the form view
but my inherited view appears all on one page with no notebooks or pages.
in my **county.py** :
class county_citizen(osv.osv):
_name = 'county.citizen'
_description = 'County Citizen'
_inherit = 'res.partner'
_columns = {
'citizen_id' : fields.char('Identification No',size=15,required=True,help="The National ID of the Citizen"),
'citizen_passport_id': fields.char('Passport No',size=64),
'citizen_otherid': fields.char('Other Id', size=64),
'citizen_gender' : fields.selection([('male','Male'),('female','Female')], 'Gender',required=True),
'citizen_photo': fields.binary('Photo',help="Upload a Citizen's Passport Image"),
'citizen_work': fields.char('Occupation',size=32,required=True),
'citizen_notes': fields.text('Notes',help="Comments of citizen's role,work or duty in the county.")
}
def _get_photo(self,cr,uid,context=None):
photo_path = addons.get_module_resource('county','images','photo.png')
return open(photo_path,'rb').read().encode('base64')
_defaults = {
'citizen_photo': _get_photo
}
sql_constraints = [('id_unique','unique (citizen_id)','The citizen identification is unique')]
#end of class
county_citizen()
and in my **county_view.xml** :
Citizens county.citizen
Kindly Help it is Urgent.
Thanks
↧