|
@ -1,14 +1,14 @@ |
|
|
# -*- coding: utf-8 -*- |
|
|
# -*- coding: utf-8 -*- |
|
|
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> |
|
|
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
from openerp import _, api, fields, models |
|
|
|
|
|
|
|
|
from odoo import _, api, fields, models |
|
|
import logging |
|
|
import logging |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
_logger = logging.getLogger(__name__) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Partner(models.Model): |
|
|
|
|
|
|
|
|
class ResPartner(models.Model): |
|
|
"""Partner with birth date in date format.""" |
|
|
"""Partner with birth date in date format.""" |
|
|
_inherit = "res.partner" |
|
|
_inherit = "res.partner" |
|
|
|
|
|
|
|
@ -36,8 +36,3 @@ class Partner(models.Model): |
|
|
_logger.warn( |
|
|
_logger.warn( |
|
|
_("Could not convert '{0.birthdate}' to date in " |
|
|
_("Could not convert '{0.birthdate}' to date in " |
|
|
"res.partner {0.id} ({0.name}). Skipping.").format(self)) |
|
|
"res.partner {0.id} ({0.name}). Skipping.").format(self)) |
|
|
|
|
|
|
|
|
@api.model |
|
|
|
|
|
def _birthdate_install(self): |
|
|
|
|
|
"""Export all old birthdates to the new format.""" |
|
|
|
|
|
self.search([('birthdate', "!=", False)])._inverse_birthdate() |
|
|
|