Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0] [MIG] partner_firstname: Migration to 11.0 #487

Merged
merged 122 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
045141d
[ADD] partner_firstname addons
nbessi Jan 14, 2013
9f64b0f
[REV] remove the previous revision, the merge proposal has been merge…
guewen Jan 14, 2013
c74f431
[ADD] partner_firstname module
nbessi Feb 4, 2013
28ad896
[FIX] heading coding definition
nbessi Feb 4, 2013
e55aaed
[FIX] partner_firstname can't create partner as lastname is required
nbessi Feb 4, 2013
52cbb73
[IMP] small improvements in module description and docstrings
gurneyalex Feb 5, 2013
4e2e2ab
[FIX] user creation from res_user form
nbessi Feb 5, 2013
af492eb
[MRG] Typo
nbessi Feb 5, 2013
2eaa49d
[FIX] partner_firstname name not editable in user view
yvaucher Feb 20, 2013
bde32e0
[IMP] partner_firstname - less steps in partner vals(e)
yvaucher Feb 20, 2013
aed00f2
[FIX] partner_firstname - adapt partner form inherit to new partner form
yvaucher Apr 29, 2013
4f3d2c9
[IMP] partner_firstname - giving some meaning to a comment
yvaucher Apr 30, 2013
6b0ddd4
[FIX] firstname lastname fix if empty
vrenaville May 17, 2013
6bd6eba
[FIX] search
vrenaville May 21, 2013
cad7208
[FIX] typo : fix instruction length
vrenaville May 21, 2013
af80ae4
[FIX] partner_firstname - error when lastname being empty with demo d…
yvaucher Jul 29, 2013
8498816
[FIX] use a tuple instead of a list
guewen Aug 12, 2013
8e6999e
[FIX] missing propagation of the context
guewen Aug 12, 2013
972a38a
[FIX] missing propagation of the context #2
guewen Aug 12, 2013
d186798
[IMP] don't show first/last name fields for companies
hbrunn Oct 1, 2013
14f833c
[FIX] get required attributes right for companies and non-companies
hbrunn Oct 1, 2013
13f6b5a
[ADD] Dutch translation
hbrunn Oct 3, 2013
bfbd51d
[ADD] translation template
hbrunn Oct 3, 2013
fb08e74
[FIX] layout for contact view (display Firstname and Lastname label) …
vrenaville Nov 13, 2013
0641647
[FIX] Create Sql constraint anyway
Jan 22, 2014
b95d6e1
[ADD] Tests For partner-firstname
Jan 22, 2014
ac30d5d
[CHG] Some Refactoring Of The Code
Jan 22, 2014
82aa187
Add more controls to avoid to update the name or the lastname fields …
Feb 5, 2014
72c5cda
[FIX] avoid traceback when calling the fnct_inv method with a null fi…
Olivier-LAURENT Feb 18, 2014
410e2f3
[FIX] some tests failed if user's language is not english
Olivier-LAURENT Mar 4, 2014
7b6a40f
Adapt user form to display first name and last name like partner form
Mar 12, 2014
4429bbe
Adapt user form to look like partner form
Mar 21, 2014
2c44dc7
Make the function of the 'name' field inheritable.
Jun 10, 2014
ebf9a92
Fix pep8
Jul 18, 2014
9fc8df9
Fix imports in partner_firstname
bwrsandman Jul 19, 2014
4614bc2
Move partner_last name to unported due to failed install
bwrsandman Jul 19, 2014
fc2bb5b
[ADD] partner_firstname for v8
eLBati Jul 23, 2014
6b4e3f6
[FIX] IntegrityError: column "lastname" contains null values
eLBati Jul 23, 2014
de00bb1
[IMP] partner_firstname - logging
eLBati Jul 25, 2014
ad735e4
[FIX] PEP8
eLBati Jul 26, 2014
abe6268
[FIX] IntegrityError: column "lastname" contains null values
eLBati Jul 29, 2014
002d4ae
[FIX] partner_firstname - some PEP8
eLBati Jul 29, 2014
ea2f670
[FIX] partner_firstname - PEP8
eLBati Jul 29, 2014
96daa6a
[IMP] _set_default_value_on_column avoiding useless queries
eLBati Jul 29, 2014
4832f54
Fix pep8 (line length)
bwrsandman Aug 19, 2014
6b96588
Fix pylint errors
tafaRU Dec 18, 2014
50cc65c
Spanish translation
Dec 23, 2014
03ef576
[FIX] partner_firstname: Change _id by id in the method copy_data to …
Jan 29, 2015
2df2f88
[FIX] partner_firstname : Remove the value checks in tests. With Odoo…
Feb 5, 2015
0a27963
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
eaa95fb
[FIX] partner_firstname: Better practices in views
pedrobaeza Feb 15, 2015
0a008d9
[FIX] cannot create user due to required name.
Apr 17, 2015
3f14de6
[ADD] Italian translation
LeartS May 12, 2015
6fef2f6
Danish translation of partner_firstname
hhgabelgaard May 22, 2015
8e0adb0
Better partner_firstname. Merged rebase.
May 15, 2015
eca1bbf
Fix wrong naming.
May 18, 2015
504c50b
Remove subclassing of exception, since there is only one.
May 18, 2015
a2dd8a7
Rename exception according to PEP8.
May 18, 2015
6e80b74
Reduce tests' redundancy.
May 18, 2015
7c20f94
Add test for whitespace trimming.
May 18, 2015
f38a00d
Use unicode for code & tests.
May 21, 2015
31f8dbb
Fix wrong comments.
May 25, 2015
aaa4388
Split _name_inverse adding _name_clean_inverse.
May 25, 2015
fd0dd16
Remove license header in XML files.
May 25, 2015
516ef6e
Preserve old view names.
May 25, 2015
4ffb061
Credits to last translator.
May 25, 2015
6bedce9
Increase coverage.
May 28, 2015
a655699
Add args to exception to display the correct message in the UI.
Jun 16, 2015
013dd24
Execute _firstname_install when installing, and log it.
Jun 29, 2015
3093d33
Rename methods to follow guidelines.
Jul 1, 2015
9835737
Better docstrings.
Jul 1, 2015
c0825a8
Workaround https://github.com/odoo/odoo/issues/6324.
Jul 1, 2015
b297844
Fix users not being able to create companies.
Jul 1, 2015
4c26197
Add new tests and fix the resulting bugs.
Jul 2, 2015
f705144
New tests, some fail.
Jul 6, 2015
56e95e7
Add docs to test modules.
Jul 8, 2015
b059c69
Fix recursive onchange misbehavior & tests.
Jul 8, 2015
1613c2c
Fix UI problem when lastname was u"".
Jul 8, 2015
a8d9b47
Use new() to create onchange records. Reduce redundancy in tests.
Jul 9, 2015
37d3cfb
Tests work with `mail` module installed now.
Jul 31, 2015
2e592a1
[REF][partner_firstname] Method refactoring to use algorithms in othe…
adrienpeiffer Aug 17, 2015
a150afb
Add missing default oca icons
yvaucher Aug 18, 2015
7741afe
[IMP][partner_firstname] Update documentation according methods refac…
adrienpeiffer Aug 18, 2015
2cb2838
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
a9af4c7
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
e382bff
Prepare partner_firstname for partner_second_lastname
May 15, 2015
40b0717
Fix #78. Test it too.
Oct 30, 2015
03a2fd9
Inverse values of name if required at creation.
Oct 30, 2015
a1aedcb
Allow creation of partners from *Create and Edit*.
Nov 2, 2015
9ffb67a
Fix bug #154.
Sep 7, 2015
e45571f
Fix flake8 error
Sep 8, 2015
7816398
After all, this was just a workaround. Remove it.
Sep 9, 2015
c84e440
Fix test that was having sentences after return.
Nov 3, 2015
fa8f4ca
PEP8 fix.
Nov 3, 2015
6c8a343
[FIX] _get_inverse_name in case of space in name
bealdav Aug 20, 2015
b789c0a
Credit creators, using same name across modules to avoid split statis…
Jan 5, 2016
5747ab3
[PORT] partner_firstname to 9.0
yvaucher Jan 12, 2016
b642515
[PORT][9.0] partner_firstname - remove hack to be able to edit user v…
yvaucher Jan 13, 2016
013806f
[PORT][9.0] partner_firstname - Format of string in __openerp__.py
yvaucher Jan 13, 2016
bca2737
[PORT][9.0] Adapt tests to take new constraint raising IntegrityError
yvaucher Jan 13, 2016
2e06431
partner_firstname: Name is not mandatory if partner is an address
Dec 29, 2015
3653129
fixup constraint
yvaucher Jan 18, 2016
2dac5dc
[FIX] Ensure default values are computed for res.users
yvaucher Jan 19, 2016
0675044
Filename conventions
yvaucher Feb 12, 2016
bc6e5bb
Add test for shipping address with empty name
yvaucher Feb 12, 2016
5b8dca5
partner_firstname: fix user creation
paulius-sladkevicius Mar 24, 2016
7920b4c
Fix user form with firstname and lastname asking for a mandatory name
yvaucher Feb 18, 2016
e72b460
OCA Transbot updated translations from Transifex
oca-transbot Sep 1, 2015
3ef594f
[FIX] remove en.po that was erroneously created by transbot
sbidoul Aug 15, 2016
2e60a1b
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
2893b79
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
1dd40e9
[MIG] Migrate partner_firstname to v10
Oct 6, 2016
753ad91
[IMP] Partner names order configurable
antespi Dec 18, 2015
11db867
[FIX] partner_firstname: name, firstname and lastname only required i…
mmuch Feb 27, 2017
3523a73
OCA Transbot updated translations from Transifex
oca-transbot Mar 11, 2017
e8b98fc
[MIG] partner_firstname: Upgrade to v10
lasley Nov 13, 2016
f3946ea
[UPD] partner_firstname: fix website url in manifest
sbidoul Mar 13, 2017
25ed841
[UPD] add ACSONE in authors
sbidoul Mar 13, 2017
1248d91
fix unicode/ascii error
damdam-s Jun 2, 2017
444249a
[IMP] partner_firstname: Add indices
lasley Aug 25, 2017
d7d2868
[IMP] partner_firstname: Only run install function on update
lasley Aug 25, 2017
01a92d1
[MIG] partner_firstname
etobella Oct 9, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions partner_firstname/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

================================
Partner first name and last name
================================

This module was written to extend the functionality of contacts to support
having separate last name and first name.

Configuration
=============

You can configure some common name patterns for the inverse function
in Settings > General settings:

* Lastname Firstname: For example 'Anderson Robert'
* Lastname, Firstname: For example 'Anderson, Robert'
* Firstname Lastname: For example 'Robert Anderson'

After applying the changes, you can recalculate all partners name clicking
"Recalculate names" button. Note: This process could take so much time depending
how many partners there are in database.

You can use *_get_inverse_name* method to get lastname and firstname from a simple string
and also *_get_computed_name* to get a name form the lastname and firstname.
These methods can be overridden to change the format specified above.


Usage
=====

The field *name* becomes a stored function field concatenating the *last name*
and the *first name*. This avoids breaking compatibility with other modules.

Users should fulfill manually the separate fields for *last name* and *first
name*, but in case you edit just the *name* field in some unexpected module,
there is an inverse function that tries to split that automatically. It assumes
that you write the *name* in format configured (*"Lastname Firstname"*, by default),
but it could lead to wrong splitting (because it's just blindly trying to
guess what you meant), so you better specify it manually.

For the same reason, after installing, previous names for contacts will stay in
the *name* field, and the first time you edit any of them you will be asked to
supply the *last name* and *first name* (just once per contact).

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/11.0

For further information, please visit:

* https://www.odoo.com/forum/help-1


Known issues / Roadmap
======================

Patterns for the inverse function are configurable only at system level. Maybe
this configuration could depend on partner language, country or company,
as discussed at `this OCA issue <https://github.com/OCA/partner-contact/issues/210>`_


Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/partner-contact/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Contributors
------------

* Nicolas Bessi <nicolas.bessi@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Vincent Renaville <vincent.renaville@camptocamp.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Holger Brunn <hbrunn@terp.nl>
* Jonathan Nemry <jonathan.nemry@acsone.eu>
* Olivier Laurent <olivier.laurent@acsone.eu>
* Sandy Carter <sandy.carter@savoirfairelinux.com>
* Alexis de Lattre <alexis.delattre@akretion.fr>
* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Hans Henrik Gabelgaard <hhg@gabelgaard.org>
* Jairo Llopis <j.llopis@grupoesoc.es>
* Adrien Peiffer <adrien.peiffer@acsone.eu>
* Ronald Portier <ronald@therp.nl>
* Sylvain Van Hoof
* Pedro Baeza <pedro.baeza@serviciosbaeza.com>
* Dave Lasley <dave@laslabs.com>

Translations
------------

* Danish: Hans Henrik Gabelgaard
* Italian: Leonardo Donelli
* Spanish: Antonio Espinosa
* Antonio Espinosa <antonioea@antiun.com>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
6 changes: 6 additions & 0 deletions partner_firstname/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# © 2013 Nicolas Bessi (Camptocamp SA)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
from .hooks import post_init_hook
30 changes: 30 additions & 0 deletions partner_firstname/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# © 2013 Nicolas Bessi (Camptocamp SA)
# © 2014 Agile Business Group (<http://www.agilebg.com>)
# © 2015 Grupo ESOC (<http://www.grupoesoc.es>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'Partner first name and last name',
'summary': "Split first name and last name for non company partners",
'version': '11.0.1.0.0',
'author': "Camptocamp, "
"Grupo ESOC Ingeniería de Servicios, "
"Tecnativa, "
"LasLabs, "
"ACSONE SA/NV, "
"Odoo Community Association (OCA)",
'license': "AGPL-3",
'maintainer': 'Camptocamp, Acsone',
'category': 'Extra Tools',
'website': 'https://odoo-community.org/',
'depends': ['base_setup'],
'post_init_hook': 'post_init_hook',
'data': [
'views/base_config_view.xml',
'views/res_partner.xml',
'views/res_user.xml',
],
'auto_install': False,
'installable': True,
}
12 changes: 12 additions & 0 deletions partner_firstname/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# © 2014-2015 Grupo ESOC (<http://www.grupoesoc.es>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, exceptions


class EmptyNamesError(exceptions.ValidationError):
def __init__(self, record, value=_("No name is set.")):
self.record = record
self._value = value
self.name = _("Error(s) with partner %d's name.") % record.id
self.args = (self.name, value)
11 changes: 11 additions & 0 deletions partner_firstname/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, SUPERUSER_ID


def post_init_hook(cr, _):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
env['res.partner']._install_partner_firstname()
58 changes: 58 additions & 0 deletions partner_firstname/i18n/am.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_firstname
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-10 03:39+0000\n"
"PO-Revision-Date: 2017-03-10 03:39+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: am\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: partner_firstname
#: sql_constraint:res.partner:0
msgid "Contacts require a name."
msgstr ""

#. module: partner_firstname
#: code:addons/partner_firstname/exceptions.py:11
#, python-format
msgid "Error(s) with partner %d's name."
msgstr ""

#. module: partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_users_firstname
msgid "First name"
msgstr ""

#. module: partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_partner_lastname
#: model:ir.model.fields,field_description:partner_firstname.field_res_users_lastname
msgid "Last name"
msgstr ""

#. module: partner_firstname
#: code:addons/partner_firstname/exceptions.py:8
#, python-format
msgid "No name is set."
msgstr ""

#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_partner
msgid "Partner"
msgstr "ተባባሪ"

#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_users
msgid "Users"
msgstr ""
58 changes: 58 additions & 0 deletions partner_firstname/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_firstname
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-10 03:39+0000\n"
"PO-Revision-Date: 2017-03-10 03:39+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: partner_firstname
#: sql_constraint:res.partner:0
msgid "Contacts require a name."
msgstr ""

#. module: partner_firstname
#: code:addons/partner_firstname/exceptions.py:11
#, python-format
msgid "Error(s) with partner %d's name."
msgstr ""

#. module: partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_users_firstname
msgid "First name"
msgstr ""

#. module: partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_partner_lastname
#: model:ir.model.fields,field_description:partner_firstname.field_res_users_lastname
msgid "Last name"
msgstr ""

#. module: partner_firstname
#: code:addons/partner_firstname/exceptions.py:8
#, python-format
msgid "No name is set."
msgstr ""

#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_partner
msgid "Partner"
msgstr "الشريك"

#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_users
msgid "Users"
msgstr ""
58 changes: 58 additions & 0 deletions partner_firstname/i18n/bg.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_firstname
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-31 01:39+0000\n"
"PO-Revision-Date: 2016-12-31 01:39+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n"
"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: bg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: partner_firstname
#: sql_constraint:res.partner:0
msgid "Contacts require a name."
msgstr ""

#. module: partner_firstname
#: code:addons/partner_firstname/exceptions.py:11
#, python-format
msgid "Error(s) with partner %d's name."
msgstr ""

#. module: partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_users_firstname
msgid "First name"
msgstr ""

#. module: partner_firstname
#: model:ir.model.fields,field_description:partner_firstname.field_res_partner_lastname
#: model:ir.model.fields,field_description:partner_firstname.field_res_users_lastname
msgid "Last name"
msgstr ""

#. module: partner_firstname
#: code:addons/partner_firstname/exceptions.py:8
#, python-format
msgid "No name is set."
msgstr ""

#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_partner
msgid "Partner"
msgstr "Партньор"

#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_users
msgid "Users"
msgstr ""
Loading