res_partner.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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, api
  22. class res_partner(models.Model):
  23. _name = 'res.partner'
  24. _inherit = 'res.partner'
  25. #informacion personal basica
  26. fecha_credito = fields.Date('Fecha del crédito')
  27. _defaults = {
  28. 'user_id': lambda obj, cr, uid, context: uid,
  29. }
  30. # @api.model
  31. # def create(self, vals):
  32. # partner_id = super(res_partner,self).create(vals)
  33. # self.act_fecha_credito(partner_id)
  34. # return partner_id
  35. # @api.multi
  36. # def write(self, vals):
  37. # partner_id = super(res_partner,self).write(vals)
  38. # self.act_fecha_credito(partner_id)
  39. # return partner_id
  40. # @api.model
  41. # def act_fecha_credito(self,partner_id):
  42. # # print self.fecha_credito
  43. # if not self.fecha_credito:
  44. # # print 'no tiene fecha'
  45. # self.fecha_credito = fields.Date.context_today(self)
  46. #
  47. # return True
  48. # res_partner()