partner_extra_data.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. from openerp import models, fields, tools, api
  22. class res_partner(models.Model):
  23. _name = 'res.partner'
  24. _inherit = 'res.partner'
  25. _description = 'Add extra data media to Partner'
  26. #informacion personal basica
  27. ruc = fields.Char('R.U.C./C.I.', size=12,required=True)
  28. sexo = fields.Selection([('femenino','Femenino'),('masculino','Masculino'),('otro','Otro')],'Sexo')
  29. fecha_nac = fields.Date('Fecha de Nacimiento')
  30. estado_civil = fields.Selection([('soltero','Soltero/a'),('casado','Casado/a'),('divorciado','Divorciado/a'),('viudo','Viudo/a')],'Estado Civil')
  31. #direccion
  32. barrio = fields.Char('Barrio')
  33. # #informacion trabajo
  34. trab_cargo = fields.Char('Cargo')
  35. trab_empresa = fields.Char('Empresa')
  36. trab_telefono = fields.Char('Telefono')
  37. trab_antiguedad = fields.Integer('Antiguedad', size=2)
  38. trab_antiguedad_a = fields.Integer('Antiguedad años', size=2)
  39. trab_antiguedad_m = fields.Integer('Antiguedad meses', size=2)
  40. trab_salario = fields.Float('Salario')
  41. trab_salario_bonif = fields.Float('Comisión')
  42. #direccion laboral
  43. trab_street = fields.Char('Dirección Laboral')
  44. trab_city = fields.Char('Ciudad donde trabaja')
  45. #
  46. #informacion conyugue
  47. conyuge_id = fields.One2many('res.partner','parent_id','Cónyuge',
  48. domain=['&', ('is_personal_reference','=',False),('is_commercial_reference','=',False)])
  49. # conyuge = fields.Many2one('res.partner','Cónyuge')
  50. #
  51. #informacion casa
  52. casa_propia = fields.Boolean('Casa propia')
  53. casa_alquiler = fields.Boolean('Casa alquiler')
  54. #
  55. #informacion referencias personales y comerciales
  56. ref_personal_ids = fields.One2many('res.partner','parent_id','Personal Reference', domain=[('active','=',True),('is_personal_reference','=',True)])
  57. ref_comercial_ids = fields.Many2many('res.partner','rel_partner_ref_commercial','parent_id','partner_id',string='Commercial Reference',domain=[('active','=',True),('is_company','=',True)])
  58. is_personal_reference = fields.Boolean('Is a Personal Reference', help="Check if the contact is a personal reference")
  59. is_commercial_reference = fields.Boolean('Is a Commercial Reference', help="Check if the contact is a commercial reference")
  60. credit_state = fields.Selection([('c1','Aprobado'),('c2','Rechazado')], string= 'Estado:',required='True', default="c1")