diff --git a/partner_firstname_first/__init__.py b/partner_firstname_first/__init__.py new file mode 100644 index 0000000..61cf8b2 --- /dev/null +++ b/partner_firstname_first/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import partner diff --git a/partner_firstname_first/__manifest__.py b/partner_firstname_first/__manifest__.py new file mode 100644 index 0000000..8cf79ad --- /dev/null +++ b/partner_firstname_first/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +{ + 'name': 'Partner Firstname First', + 'version': '10.0.1.0.0', + 'category': 'Partner', + 'license': 'AGPL-3', + 'summary': 'Put firstname first in partner names', + 'description': """ +Partner Firstname First +======================= + +Changes the behaviour of the OCA module *partner_firstname* to put the firstname before the lastname. + +This module has been written by Alexis de Lattre from Akretion. + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['partner_firstname'], + 'installable': True, +} diff --git a/partner_firstname_first/partner.py b/partner_firstname_first/partner.py new file mode 100644 index 0000000..c9a8761 --- /dev/null +++ b/partner_firstname_first/partner.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# © 2016 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, api + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.model + def _get_computed_name(self, lastname, firstname): + return u" ".join((p for p in (firstname, lastname) if p))