# -*- coding: utf-8 -*- import base64 import logging from odoo import api, fields, models from odoo.modules.module import get_module_resource from odoo import tools, _ _logger = logging.getLogger(__name__) GENDER = [ ('male', '男'), ('female', '女'), ('other', '其他') ] MARITAL = [ ('single', '单身'), ('married', '已婚'), ('cohabitant', '合法同居'), ('widower', '丧偶'), ('divorced', '离婚') ] class Employee(models.Model): _name = 'ml.employee' _description = '''员工信息''' name = fields.Char(string='姓名') company_id = fields.Many2one('res.company', string='公司') gender = fields.Selection(GENDER, string='性别') country_id = fields.Many2one('res.country', string='国籍') birthday = fields.Date(string='生日') marital = fields.Selection(MARITAL, string='婚姻状况', default='single') address = fields.Char(string='家庭住址') mobile_phone = fields.Char(string='手机号') work_email = fields.Char(string='工作邮箱') leader_id = fields.Many2one('ml.employee', string='所属上级') subordinate_ids = fields.One2many('ml.employee', 'leader_id', string='下属') note = fields.Text(string='备注信息')