# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # ############################################################################## from openerp import models, fields, tools, api class res_partner(models.Model): _name = 'res.partner' _inherit = 'res.partner' _description = 'Add extra data media to Partner' #informacion personal basica ruc = fields.Char('R.U.C./C.I.', size=12,required=True) sexo = fields.Selection([('femenino','Femenino'),('masculino','Masculino'),('otro','Otro')],'Sexo') fecha_nac = fields.Date('Fecha de Nacimiento') estado_civil = fields.Selection([('soltero','Soltero/a'),('casado','Casado/a'),('divorciado','Divorciado/a'),('viudo','Viudo/a')],'Estado Civil') #direccion barrio = fields.Char('Barrio') # #informacion trabajo trab_cargo = fields.Char('Cargo') trab_empresa = fields.Char('Empresa') trab_telefono = fields.Char('Telefono') trab_antiguedad = fields.Integer('Antiguedad', size=2) trab_antiguedad_a = fields.Integer('Antiguedad años', size=2) trab_antiguedad_m = fields.Integer('Antiguedad meses', size=2) trab_salario = fields.Float('Salario') trab_salario_bonif = fields.Float('Comisión') #direccion laboral trab_street = fields.Char('Dirección Laboral') trab_city = fields.Char('Ciudad donde trabaja') # #informacion conyugue conyuge_id = fields.One2many('res.partner','parent_id','Cónyuge', domain=['&', ('is_personal_reference','=',False),('is_commercial_reference','=',False)]) # conyuge = fields.Many2one('res.partner','Cónyuge') # #informacion casa casa_propia = fields.Boolean('Casa propia') casa_alquiler = fields.Boolean('Casa alquiler') # #informacion referencias personales y comerciales ref_personal_ids = fields.One2many('res.partner','parent_id','Personal Reference', domain=[('active','=',True),('is_personal_reference','=',True)]) ref_comercial_ids = fields.Many2many('res.partner','rel_partner_ref_commercial','parent_id','partner_id',string='Commercial Reference',domain=[('active','=',True),('is_company','=',True)]) is_personal_reference = fields.Boolean('Is a Personal Reference', help="Check if the contact is a personal reference") is_commercial_reference = fields.Boolean('Is a Commercial Reference', help="Check if the contact is a commercial reference") credit_state = fields.Selection([('c1','Aprobado'),('c2','Rechazado')], string= 'Estado:',required='True', default="c1")