23 lines
848 B
Python
23 lines
848 B
Python
# -*- coding: utf-8 -*-
|
|
from odoo import models, fields, api
|
|
|
|
class ResPartner(models.Model):
|
|
_inherit = 'res.partner'
|
|
|
|
is_patient = fields.Boolean(string="Es Paciente")
|
|
patient_identifier = fields.Char(string="Identificador de Paciente", copy=False)
|
|
birthdate_date = fields.Date(string="Fecha de Nacimiento")
|
|
gender = fields.Selection([
|
|
('male', 'Masculino'),
|
|
('female', 'Femenino'),
|
|
('other', 'Otro')
|
|
], string="Género")
|
|
|
|
is_doctor = fields.Boolean(string="Es Médico")
|
|
doctor_license = fields.Char(string="Licencia Médica", copy=False)
|
|
|
|
_sql_constraints = [
|
|
('patient_identifier_unique', 'unique(patient_identifier)', 'El identificador del paciente debe ser único.'),
|
|
('doctor_license_unique', 'unique(doctor_license)', 'La licencia médica debe ser única.')
|
|
]
|