Browse Source

Merge pull request #1 from OCA/8.0

Update to OCA
pull/247/head
brain-tec AG 10 years ago
parent
commit
b551fbbb07
  1. 30
      .travis.yml
  2. 8
      README.md
  3. 21
      base_contact/README.rst
  4. 12
      base_contact/__init__.py
  5. 20
      base_contact/__openerp__.py
  6. 186
      base_contact/i18n/base_contact.pot
  7. 191
      base_contact/i18n/de.po
  8. 188
      base_contact/i18n/fr.po
  9. 191
      base_contact/i18n/sl.po
  10. 38
      base_contact/migrations/8.0.2.0/pre-migrate.py
  11. 0
      base_continent/i18n/base_continent.pot
  12. 113
      base_location/i18n/da.po
  13. 6
      base_partner_sequence/partner.py
  14. 79
      partner_contact_birthdate/README.rst
  15. 19
      partner_contact_birthdate/__init__.py
  16. 31
      partner_contact_birthdate/__openerp__.py
  17. 19
      partner_contact_birthdate/data/res_partner.yml
  18. 37
      partner_contact_birthdate/i18n/de.po
  19. 38
      partner_contact_birthdate/i18n/es.po
  20. 36
      partner_contact_birthdate/i18n/fr.po
  21. 33
      partner_contact_birthdate/i18n/partner_contact_birthdate.pot
  22. 39
      partner_contact_birthdate/i18n/sl.po
  23. 58
      partner_contact_birthdate/models.py
  24. 19
      partner_contact_birthdate/tests/__init__.py
  25. 53
      partner_contact_birthdate/tests/test_birthdate.py
  26. 19
      partner_contact_birthdate/views/res_partner.xml
  27. 58
      partner_contact_gender/README.rst
  28. 19
      partner_contact_gender/__init__.py
  29. 35
      partner_contact_gender/__openerp__.py
  30. 38
      partner_contact_gender/i18n/es.po
  31. 37
      partner_contact_gender/i18n/partner_gender.pot
  32. 26
      partner_contact_gender/models.py
  33. BIN
      partner_contact_gender/static/description/icon.png
  34. 45
      partner_contact_gender/static/description/icon.svg
  35. 38
      partner_contact_gender/views/res_partner.xml
  36. 68
      partner_contact_in_several_companies/README.rst
  37. 19
      partner_contact_in_several_companies/__init__.py
  38. 35
      partner_contact_in_several_companies/__openerp__.py
  39. 0
      partner_contact_in_several_companies/demo/res_partner.xml
  40. 171
      partner_contact_in_several_companies/i18n/de.po
  41. 170
      partner_contact_in_several_companies/i18n/es.po
  42. 170
      partner_contact_in_several_companies/i18n/fr.po
  43. 165
      partner_contact_in_several_companies/i18n/partner_contact_in_several_companies.pot
  44. 170
      partner_contact_in_several_companies/i18n/sl.po
  45. 6
      partner_contact_in_several_companies/models.py
  46. 6
      partner_contact_in_several_companies/tests/__init__.py
  47. 14
      partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py
  48. 31
      partner_contact_in_several_companies/views/res_partner.xml
  49. 69
      partner_contact_nationality/README.rst
  50. 19
      partner_contact_nationality/__init__.py
  51. 31
      partner_contact_nationality/__openerp__.py
  52. 29
      partner_contact_nationality/i18n/de.po
  53. 28
      partner_contact_nationality/i18n/es.po
  54. 28
      partner_contact_nationality/i18n/fr.po
  55. 27
      partner_contact_nationality/i18n/partner_contact_nationality.pot
  56. 29
      partner_contact_nationality/i18n/sl.po
  57. 26
      partner_contact_nationality/models.py
  58. 19
      partner_contact_nationality/views/res_partner.xml
  59. 59
      partner_contact_personal_information_page/README.rst
  60. 0
      partner_contact_personal_information_page/__init__.py
  61. 32
      partner_contact_personal_information_page/__openerp__.py
  62. 24
      partner_contact_personal_information_page/i18n/de.po
  63. 23
      partner_contact_personal_information_page/i18n/es.po
  64. 23
      partner_contact_personal_information_page/i18n/fr.po
  65. 22
      partner_contact_personal_information_page/i18n/partner_contact_personal_information_page.pot
  66. 24
      partner_contact_personal_information_page/i18n/sl.po
  67. 24
      partner_contact_personal_information_page/views/res_partner.xml
  68. 65
      partner_external_maps/README.rst
  69. 4
      partner_external_maps/__init__.py
  70. 43
      partner_external_maps/__openerp__.py
  71. 190
      partner_external_maps/i18n/fr.po
  72. 172
      partner_external_maps/i18n/partner_external_maps.pot
  73. 64
      partner_external_maps/map_website_data.xml
  74. 49
      partner_external_maps/map_website_view.xml
  75. 210
      partner_external_maps/partner_external_maps.py
  76. 31
      partner_external_maps/partner_view.xml
  77. 28
      partner_external_maps/post_install.py
  78. 3
      partner_external_maps/security/ir.model.access.csv
  79. 42
      partner_external_maps/users_view.xml
  80. 56
      partner_firstname/README.rst
  81. 11
      partner_firstname/__init__.py
  82. 33
      partner_firstname/__openerp__.py
  83. 19
      partner_firstname/data/res_partner.yml
  84. 27
      partner_firstname/exceptions.py
  85. 54
      partner_firstname/i18n/da.po
  86. 48
      partner_firstname/i18n/es.po
  87. 53
      partner_firstname/i18n/it.po
  88. 31
      partner_firstname/i18n/partner_firstname.pot
  89. 136
      partner_firstname/models.py
  90. 134
      partner_firstname/partner.py
  91. 60
      partner_firstname/partner_view.xml
  92. 35
      partner_firstname/res_user_view.xml
  93. 2
      partner_firstname/tests/__init__.py
  94. 96
      partner_firstname/tests/base.py
  95. 68
      partner_firstname/tests/test_empty.py
  96. 90
      partner_firstname/tests/test_name.py
  97. 102
      partner_firstname/tests/test_onchange.py
  98. 153
      partner_firstname/tests/test_partner_firstname.py
  99. 98
      partner_firstname/views/res_partner.xml
  100. 32
      partner_firstname/views/res_user.xml

30
.travis.yml

@ -1,15 +1,31 @@
sudo: required
sudo: false
cache: pip
addons:
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
language: python language: python
python: python:
- "2.7" - "2.7"
env: env:
- VERSION="8.0" LINT_CHECK="1"
- VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0" EXCLUDE="portal_partner_merge"
- VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0" EXCLUDE="portal_partner_merge"
- VERSION="8.0" ODOO_REPO="odoo/odoo" LINT_CHECK="0" INCLUDE="portal_partner_merge"
- VERSION="8.0" ODOO_REPO="OCA/OCB" LINT_CHECK="0" INCLUDE="portal_partner_merge"
global:
- VERSION="8.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
- TRANSIFEX_USER='transbot@odoo-community.org'
- secure: "R3Tr39zWkjHWyKxBuOoxtvkIZNipt+HbPccuh9+fLi5irikIN3y1+YofBbK/H/wqzg6Vv6mnmwlHfXixiDmZRzQ1GidZ3nFqZYhGREp4vuEjBEf+rUb5/Ijrn6Zspgl+CCDR7ET9E3wOLMRV4A39poPgIll0vALzrAdIbdRbDqc="
matrix:
- LINT_CHECK="1"
- TRANSIFEX="1"
- TESTS="1" ODOO_REPO="odoo/odoo" EXCLUDE="portal_partner_merge"
- TESTS="1" ODOO_REPO="OCA/OCB" EXCLUDE="portal_partner_merge"
- TESTS="1" ODOO_REPO="odoo/odoo" INCLUDE="portal_partner_merge"
- TESTS="1" ODOO_REPO="OCA/OCB" INCLUDE="portal_partner_merge"
virtualenv: virtualenv:
system_site_packages: true system_site_packages: true
@ -25,4 +41,4 @@ script:
- travis_run_tests - travis_run_tests
after_success: after_success:
coveralls
- travis_after_tests_success

8
README.md

@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/OCA/partner-contact.svg?branch=8.0)](https://travis-ci.org/OCA/partner-contact) [![Build Status](https://travis-ci.org/OCA/partner-contact.svg?branch=8.0)](https://travis-ci.org/OCA/partner-contact)
[![Coverage Status](https://coveralls.io/repos/OCA/partner-contact/badge.png?branch=8.0)](https://coveralls.io/r/OCA/partner-contact?branch=8.0)
[![Coverage Status](https://coveralls.io/repos/OCA/partner-contact/badge.svg?branch=8.0)](https://coveralls.io/r/OCA/partner-contact?branch=8.0)
OCA partner and contact management modules for Odoo OCA partner and contact management modules for Odoo
=================================================== ===================================================
@ -13,6 +13,12 @@ Here you should find community modules that:
* Manage cities and post codes. * Manage cities and post codes.
* Etc. * Etc.
Translation Status
------------------
[![Transifex Status](https://www.transifex.com/projects/p/OCA-partner-contact-8-0/chart/image_png)](https://www.transifex.com/projects/p/OCA-partner-contact-8-0)
---- ----
OCA, or the Odoo Community Association, is a nonprofit organization whose OCA, or the Odoo Community Association, is a nonprofit organization whose

21
base_contact/README.rst

@ -20,7 +20,18 @@ For further information, please visit:
Known issues / Roadmap Known issues / Roadmap
====================== ======================
* Migrate to the new API
.. warning::
**DEPRECATED!!**
This module is deprecated and **will be removed in Odoo 9.0**.
Its functionality has been split in 3 separate modules:
- partner_contact_birthdate_
- partner_contact_in_several_companies_
- partner_contact_nationality_
You should consider using those instead.
Credits Credits
======= =======
@ -31,9 +42,10 @@ Contributors
* Xavier ALT <xal@openerp.com> (original author) * Xavier ALT <xal@openerp.com> (original author)
* EL HADJI DEM <elhadji.dem@savoirfairelinux.com> * EL HADJI DEM <elhadji.dem@savoirfairelinux.com>
* TheCloneMaster <the.clone.master@gmail.com> * TheCloneMaster <the.clone.master@gmail.com>
* Sandy Carter <bwrsandman@gmail.com>
* Sandy Carter <sandy.carter@savoirfairelinux.com>
* Rudolf Schnapka <rs@techno-flex.de> * Rudolf Schnapka <rs@techno-flex.de>
* Sebastien Alix <sebastien.alix@osiell.com> * Sebastien Alix <sebastien.alix@osiell.com>
* Jairo Llopis <j.llopis@grupoesoc.es>
Maintainer Maintainer
---------- ----------
@ -47,3 +59,8 @@ 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. 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. To contribute to this module, please visit http://odoo-community.org.
.. _partner_contact_birthdate: https://github.com/OCA/partner-contact/tree/8.0/partner_contact_birthdate
.. _partner_contact_in_several_companies: https://github.com/OCA/partner-contact/tree/8.0/partner_contact_in_several_companies
.. _partner_contact_nationality: https://github.com/OCA/partner-contact/tree/8.0/partner_contact_nationality

12
base_contact/__init__.py

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
@ -19,4 +20,13 @@
# #
############################################################################## ##############################################################################
from . import base_contact
import logging
import os
_logger = logging.getLogger(__name__ + ".deprecated")
# Skip warnings on runbots
_method = _logger.info if "OCA_RUNBOT" in os.environ else _logger.warning
_method("This module is DEPRECATED. See %s/README.rst.",
os.path.dirname(__file__))

20
base_contact/__openerp__.py

@ -21,24 +21,14 @@
{ {
'name': 'Contacts Management', 'name': 'Contacts Management',
'summary': u"Manage your contacts separately",
'version': '1.0',
'summary': u"[DEPRECATED] Manage your contacts separately",
'version': '2.0.0',
'author': "OpenERP SA,Odoo Community Association (OCA)", 'author': "OpenERP SA,Odoo Community Association (OCA)",
'website': 'http://www.openerp.com', 'website': 'http://www.openerp.com',
'category': 'Customer Relationship Management', 'category': 'Customer Relationship Management',
'complexity': "expert",
'depends': [ 'depends': [
'base',
'partner_contact_birthdate',
'partner_contact_in_several_companies',
'partner_contact_nationality',
], ],
'external_dependencies': {},
'data': [
'base_contact_view.xml',
],
'demo': [
'base_contact_demo.xml',
],
'test': [],
'installable': True,
'auto_install': False,
'images': [],
} }

186
base_contact/i18n/base_contact.pot

@ -1,186 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-19 22:10+0000\n"
"PO-Revision-Date: 2014-09-19 18:10-0500\n"
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.5.4\n"
#. module: base_contact
#: view:res.partner:0
msgid "City"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "other position"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Contacts"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid ""
"To see personal information about this contact, please go to to the his "
"person form:"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Street..."
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "State"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "at"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Tags..."
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Other Positions"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Phone:"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Company"
msgstr ""
#. module: base_contact
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Fax:"
msgstr ""
#. module: base_contact
#: code:addons/base_contact/base_contact.py:31
#, python-format
msgid "Standalone Contact"
msgstr ""
#. module: base_contact
#: help:res.partner,nationality_id:0
msgid "Nationality."
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Address"
msgstr ""
#. module: base_contact
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr ""
#. module: base_contact
#: code:addons/base_contact/base_contact.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "ZIP"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Country"
msgstr ""
#. module: base_contact
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Person"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Contact"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Mobile:"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "All partner positions"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "All positions"
msgstr ""
#. module: base_contact
#: model:ir.model,name:base_contact.model_ir_actions_act_window
msgid "ir.actions.act_window"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "other positions"
msgstr ""
#. module: base_contact
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr ""
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner
msgid "Partner"
msgstr ""
#. module: base_contact
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "Personal Information"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "e.g. Sales Director"
msgstr ""

191
base_contact/i18n/de.po

@ -1,191 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Rudolf Schnapka <schnapkar@golive-saar.de>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-19 22:10+0000\n"
"PO-Revision-Date: 2014-12-30 18:14+0100\n"
"Last-Translator: Rudolf Schnapka <schnapkar@golive-saar.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Lokalize 1.5\n"
"Language: de\n"
#. module: base_contact
#: view:res.partner:0
msgid "City"
msgstr "Stadt"
#. module: base_contact
#: view:res.partner:0
msgid "other position"
msgstr "andere Position"
#. module: base_contact
#: view:res.partner:0
msgid "Contacts"
msgstr "Kontakte"
#. module: base_contact
#: view:res.partner:0
msgid ""
"To see personal information about this contact, please go to to the his "
"person form:"
msgstr ""
"Um persönliche Auskunft zu diesem Kontakt zu erhalten, gehen Sie bitte auf "
"die Seite persönlich:"
#. module: base_contact
#: view:res.partner:0
msgid "Street..."
msgstr "Straße..."
#. module: base_contact
#: view:res.partner:0
msgid "State"
msgstr "Bundesland"
#. module: base_contact
#: view:res.partner:0
msgid "at"
msgstr "bei"
#. module: base_contact
#: view:res.partner:0
msgid "Tags..."
msgstr "Schlagworte..."
#. module: base_contact
#: view:res.partner:0
msgid "Other Positions"
msgstr "Andere Positionen"
#. module: base_contact
#: view:res.partner:0
msgid "Phone:"
msgstr "Telefon:"
#. module: base_contact
#: view:res.partner:0
msgid "Company"
msgstr "Unternehmen"
#. module: base_contact
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr "Hauptkontakt"
#. module: base_contact
#: view:res.partner:0
msgid "Fax:"
msgstr "Fax:"
#. module: base_contact
#: code:addons/base_contact/base_contact.py:31
#, python-format
msgid "Standalone Contact"
msgstr "Alleinstehender Kontakt"
#. module: base_contact
#: help:res.partner,nationality_id:0
msgid "Nationality."
msgstr "Nationalität."
#. module: base_contact
#: view:res.partner:0
msgid "Address"
msgstr "Anschrift"
#. module: base_contact
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr "Nationalität"
#. module: base_contact
#: code:addons/base_contact/base_contact.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr "Mit bestehendem Kontakt verknüpft"
#. module: base_contact
#: view:res.partner:0
msgid "ZIP"
msgstr "PLZ"
#. module: base_contact
#: view:res.partner:0
msgid "Country"
msgstr "Land"
#. module: base_contact
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr "Geburtsdatum"
#. module: base_contact
#: view:res.partner:0
msgid "Person"
msgstr "Person"
#. module: base_contact
#: view:res.partner:0
msgid "Contact"
msgstr "Kontakt"
#. module: base_contact
#: view:res.partner:0
msgid "Mobile:"
msgstr "Mobil:"
#. module: base_contact
#: view:res.partner:0
msgid "All partner positions"
msgstr "Alle Positionen des Partners"
#. module: base_contact
#: view:res.partner:0
msgid "All positions"
msgstr "Alle Positionen"
#. module: base_contact
#: model:ir.model,name:base_contact.model_ir_actions_act_window
msgid "ir.actions.act_window"
msgstr ""
#. module: base_contact
#: view:res.partner:0
msgid "other positions"
msgstr "andere Positionen"
#. module: base_contact
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr "Kontaktart"
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: base_contact
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr "Andere Positionen"
#. module: base_contact
#: view:res.partner:0
msgid "Personal Information"
msgstr "Persönliche Auskunft"
#. module: base_contact
#: view:res.partner:0
msgid "e.g. Sales Director"
msgstr "z. B. Verkaufsleiter"

188
base_contact/i18n/fr.po

@ -1,188 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-19 22:11+0000\n"
"PO-Revision-Date: 2014-09-19 18:18-0500\n"
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.5.4\n"
#. module: base_contact
#: view:res.partner:0
msgid "City"
msgstr "Ville"
#. module: base_contact
#: view:res.partner:0
msgid "other position"
msgstr "fonction"
#. module: base_contact
#: view:res.partner:0
msgid "Contacts"
msgstr "Contacts"
#. module: base_contact
#: view:res.partner:0
msgid ""
"To see personal information about this contact, please go to to the his "
"person form:"
msgstr ""
"Pour voir des informations personnelles sur ce contact, s'il vous plaît "
"aller au formulaire de la personne:"
#. module: base_contact
#: view:res.partner:0
msgid "Street..."
msgstr "Rue..."
#. module: base_contact
#: view:res.partner:0
msgid "State"
msgstr "État"
#. module: base_contact
#: view:res.partner:0
msgid "at"
msgstr "à"
#. module: base_contact
#: view:res.partner:0
msgid "Tags..."
msgstr "Étiquettes..."
#. module: base_contact
#: view:res.partner:0
msgid "Other Positions"
msgstr "Fonctions"
#. module: base_contact
#: view:res.partner:0
msgid "Phone:"
msgstr "Téléphone:"
#. module: base_contact
#: view:res.partner:0
msgid "Company"
msgstr "Organisme"
#. module: base_contact
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr "Principal contact"
#. module: base_contact
#: view:res.partner:0
msgid "Fax:"
msgstr "Fax :"
#. module: base_contact
#: code:addons/base_contact/base_contact.py:31
#, python-format
msgid "Standalone Contact"
msgstr "Contact autonome"
#. module: base_contact
#: help:res.partner,nationality_id:0
msgid "Nationality."
msgstr "Nationalité."
#. module: base_contact
#: view:res.partner:0
msgid "Address"
msgstr "Adresse"
#. module: base_contact
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr "Nationalité"
#. module: base_contact
#: code:addons/base_contact/base_contact.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr "Contact rattaché à un contact existant"
#. module: base_contact
#: view:res.partner:0
msgid "ZIP"
msgstr "Code postal"
#. module: base_contact
#: view:res.partner:0
msgid "Country"
msgstr "Pays"
#. module: base_contact
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr "Date de naissance"
#. module: base_contact
#: view:res.partner:0
msgid "Person"
msgstr "Personne"
#. module: base_contact
#: view:res.partner:0
msgid "Contact"
msgstr "Contact"
#. module: base_contact
#: view:res.partner:0
msgid "Mobile:"
msgstr "Portable :"
#. module: base_contact
#: view:res.partner:0
msgid "All partner positions"
msgstr "Tous les contacts"
#. module: base_contact
#: view:res.partner:0
msgid "All positions"
msgstr "Tous les contacts"
#. module: base_contact
#: model:ir.model,name:base_contact.model_ir_actions_act_window
msgid "ir.actions.act_window"
msgstr "ir.actions.act_window"
#. module: base_contact
#: view:res.partner:0
msgid "other positions"
msgstr "fonctions"
#. module: base_contact
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr "Type de contact"
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner
msgid "Partner"
msgstr "Partenaire"
#. module: base_contact
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr "Fonctions"
#. module: base_contact
#: view:res.partner:0
msgid "Personal Information"
msgstr "Informations personnelles"
#. module: base_contact
#: view:res.partner:0
msgid "e.g. Sales Director"
msgstr "ex: Directeur des ventes"

191
base_contact/i18n/sl.po

@ -1,191 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-19 22:10+0000\n"
"PO-Revision-Date: 2015-03-20 08:34+0100\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian <translate@matmoz.si>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Lokalize 1.5\n"
"Language: sl\n"
#. module: base_contact
#: view:res.partner:0
msgid "City"
msgstr "Kraj"
#. module: base_contact
#: view:res.partner:0
msgid "other position"
msgstr "drug položaj"
#. module: base_contact
#: view:res.partner:0
msgid "Contacts"
msgstr "Stiki"
#. module: base_contact
#: view:res.partner:0
msgid ""
"To see personal information about this contact, please go to to the his "
"person form:"
msgstr ""
"Za ogled osebnih podatkov o tem stiku pojdite na njegov glavni "
"obrazec:"
#. module: base_contact
#: view:res.partner:0
msgid "Street..."
msgstr "Ulica..."
#. module: base_contact
#: view:res.partner:0
msgid "State"
msgstr "Zvezna država"
#. module: base_contact
#: view:res.partner:0
msgid "at"
msgstr "pri"
#. module: base_contact
#: view:res.partner:0
msgid "Tags..."
msgstr "Oznake..."
#. module: base_contact
#: view:res.partner:0
msgid "Other Positions"
msgstr "Drugi položaji"
#. module: base_contact
#: view:res.partner:0
msgid "Phone:"
msgstr "Telefon:"
#. module: base_contact
#: view:res.partner:0
msgid "Company"
msgstr "Družba"
#. module: base_contact
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr "Glavni stik"
#. module: base_contact
#: view:res.partner:0
msgid "Fax:"
msgstr "Faks:"
#. module: base_contact
#: code:addons/base_contact/base_contact.py:31
#, python-format
msgid "Standalone Contact"
msgstr "Samostojni stik"
#. module: base_contact
#: help:res.partner,nationality_id:0
msgid "Nationality."
msgstr "Nacionalnost"
#. module: base_contact
#: view:res.partner:0
msgid "Address"
msgstr "Naslov"
#. module: base_contact
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr "Nacionalnost"
#. module: base_contact
#: code:addons/base_contact/base_contact.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr "Pripeto obstoječemu stiku"
#. module: base_contact
#: view:res.partner:0
msgid "ZIP"
msgstr "Poštna številka"
#. module: base_contact
#: view:res.partner:0
msgid "Country"
msgstr "Država"
#. module: base_contact
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr "Rojstni datum"
#. module: base_contact
#: view:res.partner:0
msgid "Person"
msgstr "Oseba"
#. module: base_contact
#: view:res.partner:0
msgid "Contact"
msgstr "Stik"
#. module: base_contact
#: view:res.partner:0
msgid "Mobile:"
msgstr "Mobilni telefon:"
#. module: base_contact
#: view:res.partner:0
msgid "All partner positions"
msgstr "Vsi partnerjevi položaji"
#. module: base_contact
#: view:res.partner:0
msgid "All positions"
msgstr "Vsi položaji"
#. module: base_contact
#: model:ir.model,name:base_contact.model_ir_actions_act_window
msgid "ir.actions.act_window"
msgstr "ir.actions.act_window"
#. module: base_contact
#: view:res.partner:0
msgid "other positions"
msgstr "drugi položaji"
#. module: base_contact
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr "Tip stika"
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: base_contact
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr "Drugi položaji"
#. module: base_contact
#: view:res.partner:0
msgid "Personal Information"
msgstr "Osebni podatki"
#. module: base_contact
#: view:res.partner:0
msgid "e.g. Sales Director"
msgstr "npr. vodja prodaje"

38
base_contact/migrations/8.0.2.0/pre-migrate.py

@ -0,0 +1,38 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
def migrate(cr, version):
"""Update fields owner module to avoid Odoo deleting them on uninstall."""
# partner_contact_birthdate
cr.execute("""UPDATE ir_model_data
SET module='partner_contact_birthdate'
WHERE module='base_contact'
AND name in ('field_res_partner_birthdate_date')""")
# partner_contact_nationality
cr.execute("""UPDATE ir_model_data
SET module='partner_contact_nationality'
WHERE module='base_contact'
AND name in ('field_res_partner_nationality_id')""")
# partner_contact_in_several_companies
cr.execute("""UPDATE ir_model_data
SET module='partner_contact_in_several_companies'
WHERE module='base_contact'
AND name LIKE 'field_%'""")

0
base_continent/i18n/base_continent.po → base_continent/i18n/base_continent.pot

113
base_location/i18n/da.po

@ -0,0 +1,113 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_location
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-12 22:33+0000\n"
"PO-Revision-Date: 2015-05-22 13:19+0100\n"
"Last-Translator: Hans Henrik Gabelgaard <hhg@gabelgaard.org>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.8\n"
"Language: da_DK\n"
#. module: base_location
#: model:ir.actions.act_window,name:base_location.action_zip_tree
msgid "Cites/locations Management"
msgstr "By/Postnummer/Lokations administration"
#. module: base_location
#: field:res.better.zip,city:0
msgid "City"
msgstr "By"
#. module: base_location
#: view:res.better.zip:0 field:res.better.zip,name:0
msgid "ZIP"
msgstr "Postnr."
#. module: base_location
#: field:res.better.zip,state_id:0
msgid "State"
msgstr "Delstat"
#. module: base_location
#: field:res.better.zip,country_id:0
msgid "Country"
msgstr "Land."
#. module: base_location
#: field:res.better.zip,priority:0
msgid "Priority"
msgstr "Prioritet"
#. module: base_location
#: model:ir.model,name:base_location.model_res_company
msgid "Companies"
msgstr "Virksomheder"
#. module: base_location
#: field:res.better.zip,code:0
msgid "City Code"
msgstr "Postnummer"
#. module: base_location
#: model:ir.model,name:base_location.model_res_better_zip
msgid " City/locations completion object"
msgstr " Slå by/postnummer op"
#. module: base_location
#: help:res.company,better_zip_id:0
msgid "Use the city name or the zip code to search the location"
msgstr "Søg på bynavn eller postnummer"
#. module: base_location
#: field:res.partner,zip_id:0
msgid "City/Location"
msgstr "Postnr/by "
#. module: base_location
#: view:res.better.zip:0
msgid "Search city"
msgstr "Søg by"
#. module: base_location
#: field:res.company,better_zip_id:0
msgid "Location"
msgstr "Postnr/by "
#. module: base_location
#: model:ir.ui.menu,name:base_location.zip_base
msgid "Cities/Locations Management"
msgstr "Byer/Loaktions administration"
#. module: base_location
#: model:ir.model,name:base_location.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: base_location
#: view:res.company:0 view:res.partner:0
msgid "City completion"
msgstr "Slå by/postnummer op"
#. module: base_location
#: field:res.country.state,better_zip_ids:0
msgid "Cities"
msgstr "Byer"
#. module: base_location
#: model:ir.model,name:base_location.model_res_country_state
msgid "Country state"
msgstr "Delstat/region"
#. module: base_location
#: help:res.better.zip,code:0
msgid "The official code for the city"
msgstr "Postnummer"

6
base_partner_sequence/partner.py

@ -21,7 +21,7 @@
# #
############################################################################## ##############################################################################
from openerp.osv import orm, fields
from openerp.osv import orm
class ResPartner(orm.Model): class ResPartner(orm.Model):
@ -65,10 +65,6 @@ class ResPartner(orm.Model):
context=context) context=context)
return vals.get('is_company') or not vals.get('parent_id') return vals.get('is_company') or not vals.get('parent_id')
_columns = {
'ref': fields.char('Reference', size=64, readonly=True),
}
def _commercial_fields(self, cr, uid, context=None): def _commercial_fields(self, cr, uid, context=None):
""" """
Make the partner reference a field that is propagated Make the partner reference a field that is propagated

79
partner_contact_birthdate/README.rst

@ -0,0 +1,79 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Module name
===========
This module was written to extend the functionality of Odoo to support setting
a birthdate using a date format and allow you to benefit of a clearer API and
UI.
Installation
============
To install this module, you need to:
* Ensure that the current contents of the *birthdate* field in the
*res.partner* model in your database are empty or in a format easily readable
by the python function strptime_ in case you want this module to
automatically convert those to the new format.
* Install the OCA repository `partner-contact`_.
* Update your modules list.
* Search and install this module.
Configuration
=============
No configuration is needed.
Usage
=====
To use this module, you need to:
* Edit or create a partner.
* Ensure it is **not** a company.
* Go to the *Personal Information* sheet.
* Set the birthdate there.
For further information, please visit:
* https://www.odoo.com/forum/help-1
* https://github.com/OCA/partner-contact/
Known issues / Roadmap
======================
* If you have data in your *res.partner* records' *birthdate* field that cannot
be converted to date by Pyhton's strptime_ function, those records will have
an empty *birthdate_date* after install.
Credits
=======
Contributors
------------
* EL Hadji DEM <elhadji.dem@savoirfairelinux.com>
* Jairo Llopis <j.llopis@grupoesoc.es>
* Matjaž Mozetič <m.mozetic@matmoz.si>
* Rudolf Schnapka <schnapkar@golive-saar.de>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://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.
.. _partner-contact: https://github.com/OCA/partner-contact/
.. _strptime: https://docs.python.org/2/library/datetime.html#datetime.datetime.strptime

19
partner_contact_birthdate/__init__.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import models

31
partner_contact_birthdate/__openerp__.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
"name": "Contact's birthdate",
"version": "1.0",
"author": "Odoo Community Association (OCA)",
"category": "Customer Relationship Management",
"website": "https://odoo-community.org/",
"depends": [
"partner_contact_personal_information_page",
],
"data": [
"views/res_partner.xml",
],
}

19
partner_contact_birthdate/data/res_partner.yml

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- !function {model: res.partner, name: _birthdate_install}

37
partner_contact_birthdate/i18n/de.po

@ -0,0 +1,37 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Rudolf Schnapka <schnapkar@golive-saar.de>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:17+0000\n"
"PO-Revision-Date: 2015-05-20 09:20+0100\n"
"Last-Translator: Rudolf Schnapka <schnapkar@golive-saar.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_birthdate
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr "Geburtsdatum"
#. module: partner_contact_birthdate
#: code:addons/partner_contact_birthdate/models.py:52
#, python-format
msgid ""
"Could not convert '{0.birthdate}' to date in res.partner {0.id} ({0.name}). "
"Skipping."
msgstr ""
#. module: partner_contact_birthdate
#: model:ir.model,name:partner_contact_birthdate.model_res_partner
msgid "Partner"
msgstr "Partner"

38
partner_contact_birthdate/i18n/es.po

@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_contact_birthdate
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:17+0000\n"
"PO-Revision-Date: 2015-05-20 09:21+0100\n"
"Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.7.6\n"
"Language: es_ES\n"
#. module: partner_contact_birthdate
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr "Fecha de nacimiento"
#. module: partner_contact_birthdate
#: code:addons/partner_contact_birthdate/models.py:52
#, python-format
msgid ""
"Could not convert '{0.birthdate}' to date in res.partner {0.id} ({0.name}). "
"Skipping."
msgstr ""
"No se pudo convertir '{0.birthdate}' en fecha en el res.partner {0.id} ({0."
"name}). Omitiéndolo."
#. module: partner_contact_birthdate
#: model:ir.model,name:partner_contact_birthdate.model_res_partner
msgid "Partner"
msgstr "Empresa"

36
partner_contact_birthdate/i18n/fr.po

@ -0,0 +1,36 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:17+0000\n"
"PO-Revision-Date: 2015-05-20 09:20+0100\n"
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_birthdate
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr "Date de naissance"
#. module: partner_contact_birthdate
#: code:addons/partner_contact_birthdate/models.py:52
#, python-format
msgid ""
"Could not convert '{0.birthdate}' to date in res.partner {0.id} ({0.name}). "
"Skipping."
msgstr ""
#. module: partner_contact_birthdate
#: model:ir.model,name:partner_contact_birthdate.model_res_partner
msgid "Partner"
msgstr "Partenaire"

33
partner_contact_birthdate/i18n/partner_contact_birthdate.pot

@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_contact_birthdate
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:17+0000\n"
"PO-Revision-Date: 2015-05-20 07:17+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_contact_birthdate
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr ""
#. module: partner_contact_birthdate
#: code:addons/partner_contact_birthdate/models.py:52
#, python-format
msgid "Could not convert '{0.birthdate}' to date in res.partner {0.id} ({0.name}). Skipping."
msgstr ""
#. module: partner_contact_birthdate
#: model:ir.model,name:partner_contact_birthdate.model_res_partner
msgid "Partner"
msgstr ""

39
partner_contact_birthdate/i18n/sl.po

@ -0,0 +1,39 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-02 08:17+0200\n"
"PO-Revision-Date: 2015-08-02 08:17+0200\n"
"Last-Translator: Matjaz Mozetic <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian <translate@matmoz.si>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.8.2\n"
#. module: partner_contact_birthdate
#: field:res.partner,birthdate_date:0
msgid "Birthdate"
msgstr "Rojstni datum"
#. module: partner_contact_birthdate
#: code:addons/partner_contact_birthdate/models.py:52
#, python-format
msgid ""
"Could not convert '{0.birthdate}' to date in res.partner {0.id} ({0.name}). "
"Skipping."
msgstr ""
"Ni možna pretvorba '{0.birthdate}' v datum v res.partner {0.id} ({0."
"name}). Preskoči."
#. module: partner_contact_birthdate
#: model:ir.model,name:partner_contact_birthdate.model_res_partner
msgid "Partner"
msgstr "Partner"

58
partner_contact_birthdate/models.py

@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from openerp import _, api, fields, models
import logging
_logger = logging.getLogger(__name__)
class Partner(models.Model):
"""Partner with birth date in date format."""
_inherit = "res.partner"
# New birthdate field in date format
birthdate_date = fields.Date("Birthdate")
# Make the old Char field to reflect the new Date field
birthdate = fields.Char(
compute="_birthdate_compute",
inverse="_birthdate_inverse",
store=True)
@api.one
@api.depends("birthdate_date")
def _birthdate_compute(self):
"""Store a string of the new date in the old field."""
self.birthdate = self.birthdate_date
@api.one
def _birthdate_inverse(self):
"""Convert the old Char date to the new Date format."""
try:
self.birthdate_date = self.birthdate
except ValueError:
_logger.warn(
_("Could not convert '{0.birthdate}' to date in "
"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()

19
partner_contact_birthdate/tests/__init__.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import test_birthdate

53
partner_contact_birthdate/tests/test_birthdate.py

@ -0,0 +1,53 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from openerp import fields
from openerp.tests.common import TransactionCase
from datetime import date
class GoodCase(TransactionCase):
def setUp(self):
super(GoodCase, self).setUp()
self.partner = self.env["res.partner"].create({"name": str(self)})
self.birthdate = date.today()
def tearDown(self):
self.assertEqual(self.partner.birthdate, self.partner.birthdate_date)
super(GoodCase, self).tearDown()
def test_new_to_old(self):
self.partner.birthdate_date = self.birthdate
def test_old_to_new(self):
self.partner.birthdate = fields.Date.to_string(self.birthdate)
class BadCase(TransactionCase):
def setUp(self):
super(BadCase, self).setUp()
self.partner = self.env["res.partner"].create({"name": str(self)})
self.birthdate = date.today()
def tearDown(self):
self.assertNotEqual(self.partner.birthdate,
self.partner.birthdate_date)
super(BadCase, self).tearDown()
def test_old_to_new(self):
self.partner.birthdate = "Not a date"

19
partner_contact_birthdate/views/res_partner.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="birthdate_date" model="ir.ui.view">
<field name="name">Birthdate Date field</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[@name='personal_information_group']">
<field name="birthdate_date"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

58
partner_contact_gender/README.rst

@ -0,0 +1,58 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Partner Gender
==============
This module was written to extend the functionality of Odoo contacts manager to
support setting the gender of a partner.
Installation
============
To install this module, you need to:
* Install the `partner-contact`_ repository.
.. _partner-contact: https://github.com/OCA/partner-contact/
Usage
=====
To use this module, you need to:
* Edit a partner or create a new one.
* Ensure the partner is **not** a company.
* Go to the *Personal information* sheet.
* Set the gender there.
For further information, please visit:
* https://www.odoo.com/forum/help-1
* https://github.com/OCA/partner-contact/
Credits
=======
* Icon from `Font Awesome <http://fontawesome.io/>`_.
Contributors
------------
* Jairo Llopis <j.llopis@grupoesoc.es>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://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.

19
partner_contact_gender/__init__.py

@ -0,0 +1,19 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import models

35
partner_contact_gender/__openerp__.py

@ -0,0 +1,35 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
"name": "Contact gender",
"version": "1.0",
"category": "Customer Relationship Management",
"author": "Odoo Community Association (OCA), Grupo ESOC",
"license": "AGPL-3",
"website": "https://odoo-community.org/",
"installable": True,
"application": False,
"summary": "Add gender field to contacts",
"depends": [
"partner_contact_personal_information_page",
],
"data": [
"views/res_partner.xml",
],
}

38
partner_contact_gender/i18n/es.po

@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_gender
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-18 10:55+0000\n"
"PO-Revision-Date: 2015-05-18 12:57+0100\n"
"Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.7.6\n"
"Language: es_ES\n"
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Female"
msgstr "Femenino"
#. module: partner_gender
#: field:res.partner,gender:0
msgid "Gender"
msgstr "Género"
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Male"
msgstr "Masculino"
#. module: partner_gender
#: model:ir.model,name:partner_gender.model_res_partner
msgid "Partner"
msgstr "Empresa"

37
partner_contact_gender/i18n/partner_gender.pot

@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_gender
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-18 10:55+0000\n"
"PO-Revision-Date: 2015-05-18 10:55+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Female"
msgstr ""
#. module: partner_gender
#: field:res.partner,gender:0
msgid "Gender"
msgstr ""
#. module: partner_gender
#: selection:res.partner,gender:0
msgid "Male"
msgstr ""
#. module: partner_gender
#: model:ir.model,name:partner_gender.model_res_partner
msgid "Partner"
msgstr ""

26
partner_contact_gender/models.py

@ -0,0 +1,26 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from openerp import fields, models
class Partner(models.Model):
"""Partners with gender."""
_inherit = "res.partner"
gender = fields.Selection([('male', 'Male'), ('female', 'Female')])

BIN
partner_contact_gender/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 2.6 KiB

45
partner_contact_gender/static/description/icon.svg

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
width="100"
height="100"
viewBox="0 0 99.999997 99.999997"
id="svg2"
version="1.1">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<text
id="text3338"
y="75.525475"
x="20.974659"
style="font-style:normal;font-weight:normal;font-size:73.30392456px;line-height:125%;font-family:Sans;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#2a7fff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="75.525475"
x="20.974659"
id="tspan3340"></tspan></text>
<text
id="text3342"
y="75.525475"
x="73.840477"
style="font-style:normal;font-weight:normal;font-size:73.30392456px;line-height:125%;font-family:Sans;text-align:center;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff5599;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
y="75.525475"
x="73.840477"
id="tspan3344"></tspan></text>
</svg>

38
partner_contact_gender/views/res_partner.xml

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Odoo, Open Source Management Solution
Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<openerp>
<data>
<record id="form" model="ir.ui.view">
<field name="name">Partner gender</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[@name='personal_information_group']">
<field name="gender"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

68
partner_contact_in_several_companies/README.rst

@ -0,0 +1,68 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Module name
===========
This module was written to extend the contact management functionality. It
allows you to set several job positions in different companies per contact.
Installation
============
To install this module, you need to:
* Install the OCA repository `partner-contact`_.
Configuration
=============
No configuration is needed.
Usage
=====
New tabs 'Other Positions' and 'Personal Information' are available on the
contact form.
For further information, please visit:
* https://www.odoo.com/forum/help-1
* https://github.com/OCA/partner-contact/
Known issues / Roadmap
======================
* Update to v8 API.
Credits
=======
Contributors
------------
* Xavier ALT <xal@openerp.com> (original author)
* EL HADJI DEM <elhadji.dem@savoirfairelinux.com>
* TheCloneMaster <the.clone.master@gmail.com>
* Sandy Carter <bwrsandman@gmail.com>
* Rudolf Schnapka <rs@techno-flex.de>
* Sebastien Alix <sebastien.alix@osiell.com>
* Jairo Llopis <j.llopis@grupoesoc.es>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://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.
.. _partner-contact: https://github.com/OCA/partner-contact/

19
partner_contact_in_several_companies/__init__.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import models

35
partner_contact_in_several_companies/__openerp__.py

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
"name": "Contacts in several partners",
"summary": "Allow to have one contact in several partners",
"version": "1.0.0",
"author": "Odoo Community Association (OCA)",
"category": "Customer Relationship Management",
"website": "https://odoo-community.org/",
"depends": [
"partner_contact_personal_information_page",
],
"data": [
"views/res_partner.xml",
],
"demo": [
"demo/res_partner.xml",
],
}

0
base_contact/base_contact_demo.xml → partner_contact_in_several_companies/demo/res_partner.xml

171
partner_contact_in_several_companies/i18n/de.po

@ -0,0 +1,171 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Rudolf Schnapka <schnapkar@golive-saar.de>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 09:26+0000\n"
"PO-Revision-Date: 2015-05-20 11:27+0100\n"
"Last-Translator: Rudolf Schnapka <schnapkar@golive-saar.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Address"
msgstr "Anschrift"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All partner positions"
msgstr "Alle Positionen des Partners"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All positions"
msgstr "Alle Positionen"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr "Mit bestehendem Kontakt verknüpft"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "City"
msgstr "Stadt"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Company"
msgstr "Unternehmen"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contact"
msgstr "Kontakt"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr "Kontaktart"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contacts"
msgstr "Kontakte"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Country"
msgstr "Land"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Fax:"
msgstr "Fax:"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr "Hauptkontakt"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Mobile:"
msgstr "Mobil:"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Other Positions"
msgstr "Andere Positionen"
#. module: partner_contact_in_several_companies
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr "Andere Positionen"
#. module: partner_contact_in_several_companies
#: model:ir.model,name:partner_contact_in_several_companies.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "Person"
msgstr "Person"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Phone:"
msgstr "Telefon:"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:31
#, python-format
msgid "Standalone Contact"
msgstr "Alleinstehender Kontakt"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "State"
msgstr "Bundesland"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Street..."
msgstr "Straße..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Tags..."
msgstr "Schlagworte..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_personal_information
#, fuzzy
msgid ""
"To see personal information about this contact, please\n"
" go to to the his person form:"
msgstr ""
"Um persönliche Auskunft zu diesem Kontakt zu erhalten, gehen Sie bitte auf "
"die Seite persönlich:"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "ZIP"
msgstr "PLZ"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "at"
msgstr "bei"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "e.g. Sales Director"
msgstr "z. B. Verkaufsleiter"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other position"
msgstr "andere Position"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other positions"
msgstr "andere Positionen"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "{'invisible': [('contact_type','=','attached')]}"
msgstr ""

170
partner_contact_in_several_companies/i18n/es.po

@ -0,0 +1,170 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 09:26+0000\n"
"PO-Revision-Date: 2015-05-20 11:33+0100\n"
"Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Address"
msgstr "Dirección"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All partner positions"
msgstr "Todas las posiciones de empresa"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All positions"
msgstr "Todas las posiciones"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr "Anexado a un contacto existente"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "City"
msgstr "Ciudad"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Company"
msgstr "Compañía"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contact"
msgstr "Contacto"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr "Tipo de contacto"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contacts"
msgstr "Contactos"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Country"
msgstr "País"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Fax:"
msgstr "Fax:"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr "Contacto principal"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Mobile:"
msgstr "Teléfono móvil:"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Other Positions"
msgstr "Otras posiciones"
#. module: partner_contact_in_several_companies
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr "Otras posiciones"
#. module: partner_contact_in_several_companies
#: model:ir.model,name:partner_contact_in_several_companies.model_res_partner
msgid "Partner"
msgstr "Empresa"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "Person"
msgstr "Persona"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Phone:"
msgstr "Teléfono:"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:31
#, python-format
msgid "Standalone Contact"
msgstr "Contacto independiente"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "State"
msgstr "Provincia"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Street..."
msgstr "Calle..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Tags..."
msgstr "Etiquetas..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_personal_information
#, fuzzy
msgid ""
"To see personal information about this contact, please\n"
" go to to the his person form:"
msgstr ""
"Para ver la información personal de este contacto, por favor vaya a su "
"formulario personal:"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "ZIP"
msgstr "C.P."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "at"
msgstr "en"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "e.g. Sales Director"
msgstr "ej.: Director de ventas"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other position"
msgstr "otra posición"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other positions"
msgstr "otras posiciones"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "{'invisible': [('contact_type','=','attached')]}"
msgstr ""

170
partner_contact_in_several_companies/i18n/fr.po

@ -0,0 +1,170 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 09:26+0000\n"
"PO-Revision-Date: 2015-05-20 11:28+0100\n"
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Address"
msgstr "Adresse"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All partner positions"
msgstr "Tous les contacts"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All positions"
msgstr "Tous les contacts"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr "Contact rattaché à un contact existant"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "City"
msgstr "Ville"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Company"
msgstr "Organisme"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contact"
msgstr "Contact"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr "Type de contact"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contacts"
msgstr "Contacts"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Country"
msgstr "Pays"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Fax:"
msgstr "Fax :"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr "Principal contact"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Mobile:"
msgstr "Portable :"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Other Positions"
msgstr "Fonctions"
#. module: partner_contact_in_several_companies
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr "Fonctions"
#. module: partner_contact_in_several_companies
#: model:ir.model,name:partner_contact_in_several_companies.model_res_partner
msgid "Partner"
msgstr "Partenaire"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "Person"
msgstr "Personne"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Phone:"
msgstr "Téléphone:"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:31
#, python-format
msgid "Standalone Contact"
msgstr "Contact autonome"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "State"
msgstr "État"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Street..."
msgstr "Rue..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Tags..."
msgstr "Étiquettes..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_personal_information
#, fuzzy
msgid ""
"To see personal information about this contact, please\n"
" go to to the his person form:"
msgstr ""
"Pour voir des informations personnelles sur ce contact, s'il vous plaît "
"aller au formulaire de la personne:"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "ZIP"
msgstr "Code postal"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "at"
msgstr "à"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "e.g. Sales Director"
msgstr "ex: Directeur des ventes"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other position"
msgstr "fonction"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other positions"
msgstr "fonctions"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "{'invisible': [('contact_type','=','attached')]}"
msgstr ""

165
partner_contact_in_several_companies/i18n/partner_contact_in_several_companies.pot

@ -0,0 +1,165 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_contact_in_several_companies
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 09:26+0000\n"
"PO-Revision-Date: 2015-05-20 09:26+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Address"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All partner positions"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All positions"
msgstr ""
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "City"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Company"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contact"
msgstr ""
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contacts"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Country"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Fax:"
msgstr ""
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Mobile:"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Other Positions"
msgstr ""
#. module: partner_contact_in_several_companies
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr ""
#. module: partner_contact_in_several_companies
#: model:ir.model,name:partner_contact_in_several_companies.model_res_partner
msgid "Partner"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "Person"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Phone:"
msgstr ""
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:31
#, python-format
msgid "Standalone Contact"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "State"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Street..."
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Tags..."
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_personal_information
msgid "To see personal information about this contact, please\n"
" go to to the his person form:"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "ZIP"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "at"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "e.g. Sales Director"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other position"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other positions"
msgstr ""
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "{'invisible': [('contact_type','=','attached')]}"
msgstr ""

170
partner_contact_in_several_companies/i18n/sl.po

@ -0,0 +1,170 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-08-02 08:21+0200\n"
"PO-Revision-Date: 2015-08-02 08:22+0200\n"
"Last-Translator: Matjaz Mozetic <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian <translate@matmoz.si>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.8.2\n"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Address"
msgstr "Naslov"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All partner positions"
msgstr "Vsi partnerjevi položaji"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "All positions"
msgstr "Vsi položaji"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:32
#, python-format
msgid "Attached to existing Contact"
msgstr "Pripeto obstoječemu stiku"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "City"
msgstr "Kraj"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Company"
msgstr "Družba"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contact"
msgstr "Stik"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_type:0
msgid "Contact Type"
msgstr "Tip stika"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Contacts"
msgstr "Stiki"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Country"
msgstr "Država"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Fax:"
msgstr "Faks:"
#. module: partner_contact_in_several_companies
#: field:res.partner,contact_id:0
msgid "Main Contact"
msgstr "Glavni stik"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Mobile:"
msgstr "Mobilni telefon:"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Other Positions"
msgstr "Drugi položaji"
#. module: partner_contact_in_several_companies
#: field:res.partner,other_contact_ids:0
msgid "Others Positions"
msgstr "Drugi položaji"
#. module: partner_contact_in_several_companies
#: model:ir.model,name:partner_contact_in_several_companies.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_filter_contact
msgid "Person"
msgstr "Oseba"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Phone:"
msgstr "Telefon:"
#. module: partner_contact_in_several_companies
#: code:addons/partner_contact_in_several_companies/models.py:31
#, python-format
msgid "Standalone Contact"
msgstr "Samostojni stik"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "State"
msgstr "Zvezna država"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Street..."
msgstr "Ulica..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "Tags..."
msgstr "Oznake..."
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_personal_information
msgid ""
"To see personal information about this contact, please\n"
" go to to the his person form:"
msgstr ""
"Za ogled osebnih podatkov o tem stiku\n"
"\t\t\tpojdite na njegov glavni obrazec:"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "ZIP"
msgstr "Poštna številka"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "at"
msgstr "pri"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "e.g. Sales Director"
msgstr "npr. vodja prodaje"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other position"
msgstr "drug položaj"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_res_partner_kanban_contact
msgid "other positions"
msgstr "drugi položaji"
#. module: partner_contact_in_several_companies
#: view:res.partner:partner_contact_in_several_companies.view_partner_form_inherit
msgid "{'invisible': [('contact_type','=','attached')]}"
msgstr "{'invisible': [('contact_type','=','attached')]}"

6
base_contact/base_contact.py → partner_contact_in_several_companies/models.py

@ -62,12 +62,6 @@ class res_partner(orm.Model):
'contact_id', 'contact_id',
'Others Positions', 'Others Positions',
), ),
# Person specific fields
# add a 'birthdate' as date field, i.e different from char
# 'birthdate' introduced v6.1!
'birthdate_date': fields.date('Birthdate'),
'nationality_id': fields.many2one('res.country', 'Nationality'),
} }
_defaults = { _defaults = {

6
base_contact/tests/__init__.py → partner_contact_in_several_companies/tests/__init__.py

@ -19,8 +19,4 @@
# #
############################################################################## ##############################################################################
from . import test_base_contact
checks = [
test_base_contact,
]
from . import test_partner_contact_in_several_companies

14
base_contact/tests/test_base_contact.py → partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py

@ -22,11 +22,11 @@
from openerp.tests import common from openerp.tests import common
class Test_Base_Contact(common.TransactionCase):
class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
def setUp(self): def setUp(self):
"""*****setUp*****""" """*****setUp*****"""
super(Test_Base_Contact, self).setUp()
super(PartnerContactInSeveralCompaniesCase, self).setUp()
cr, uid = self.cr, self.uid cr, uid = self.cr, self.uid
ModelData = self.registry('ir.model.data') ModelData = self.registry('ir.model.data')
self.partner = self.registry('res.partner') self.partner = self.registry('res.partner')
@ -34,11 +34,15 @@ class Test_Base_Contact(common.TransactionCase):
# Get test records reference # Get test records reference
for attr, module, name in [ for attr, module, name in [
('main_partner_id', 'base', 'main_partner'), ('main_partner_id', 'base', 'main_partner'),
('bob_contact_id', 'base_contact', 'res_partner_contact1'),
('bob_job1_id', 'base_contact',
('bob_contact_id',
'partner_contact_in_several_companies',
'res_partner_contact1'),
('bob_job1_id',
'partner_contact_in_several_companies',
'res_partner_contact1_work_position1'), 'res_partner_contact1_work_position1'),
('roger_contact_id', 'base', 'res_partner_main2'), ('roger_contact_id', 'base', 'res_partner_main2'),
('roger_job2_id', 'base_contact',
('roger_job2_id',
'partner_contact_in_several_companies',
'res_partner_main2_position_consultant')]: 'res_partner_main2_position_consultant')]:
r = ModelData.get_object_reference(cr, uid, module, name) r = ModelData.get_object_reference(cr, uid, module, name)
setattr(self, attr, r[1] if r else False) setattr(self, attr, r[1] if r else False)

31
base_contact/base_contact_view.xml → partner_contact_in_several_companies/views/res_partner.xml

@ -151,16 +151,6 @@
</form> </form>
</field> </field>
</page> </page>
<page name="personal-info" string="Personal Information" attrs="{'invisible': ['|',('is_company','=',True)]}">
<p attrs="{'invisible': [('contact_id','=',False)]}">
To see personal information about this contact, please go to to the his person form: <field name="contact_id" class="oe_inline" domain="[('contact_type','!=','attached')]" context="{'show_address': 1}"
on_change="onchange_contact_id(contact_id)" options="{'always_reload': True}"/>
</p>
<group attrs="{'invisible': [('contact_id','!=',False)]}">
<field name="birthdate_date"/>
<field name="nationality_id"/>
</group>
</page>
</page> </page>
<xpath expr="//form[@string='Contact']/sheet//field[@name='category_id']" position="before"> <xpath expr="//form[@string='Contact']/sheet//field[@name='category_id']" position="before">
<group> <group>
@ -178,6 +168,27 @@
</field> </field>
</record> </record>
<record id="view_res_partner_personal_information" model="ir.ui.view">
<field name="name">Contacts in several partners: personal info</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='personal_information_page']">
<p attrs="{'invisible': [('contact_id','=',False)]}">
To see personal information about this contact, please
go to to the his person form:
<field name="contact_id" class="oe_inline"
domain="[('contact_type','!=','attached')]"
context="{'show_address': 1}"
on_change="onchange_contact_id(contact_id)"
options="{'always_reload': True}"/>
</p>
</xpath>
</data>
</field>
</record>
<record model="ir.ui.view" id="view_res_partner_kanban_contact"> <record model="ir.ui.view" id="view_res_partner_kanban_contact">
<field name="name">res.partner.kanban.contact</field> <field name="name">res.partner.kanban.contact</field>
<field name="model">res.partner</field> <field name="model">res.partner</field>

69
partner_contact_nationality/README.rst

@ -0,0 +1,69 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Module name
===========
This module was written to extend the functionality of Odoo to support setting
a nationality for your contacts.
Installation
============
To install this module, you need to:
* Install the OCA repository `partner-contact`_.
Configuration
=============
No configuration is needed.
Usage
=====
To use this module, you need to:
* Edit or create a partner.
* Ensure it is **not** a company.
* Go to the *Personal Information* sheet.
* Set the nationality there.
For further information, please visit:
* https://www.odoo.com/forum/help-1
* https://github.com/OCA/partner-contact/
Known issues / Roadmap
======================
* None.
Credits
=======
Contributors
------------
* EL Hadji DEM <elhadji.dem@savoirfairelinux.com>
* Jairo Llopis <j.llopis@grupoesoc.es>
* Matjaž Mozetič <m.mozetic@matmoz.si>
* Rudolf Schnapka <schnapkar@golive-saar.de>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://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.
.. _partner-contact: https://github.com/OCA/partner-contact/

19
partner_contact_nationality/__init__.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import models

31
partner_contact_nationality/__openerp__.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
"name": "Contact's nationality",
"version": "1.0.0",
"author": "Odoo Community Association (OCA)",
"category": "Customer Relationship Management",
"website": "https://odoo-community.org/",
"depends": [
"partner_contact_personal_information_page",
],
"data": [
"views/res_partner.xml",
],
}

29
partner_contact_nationality/i18n/de.po

@ -0,0 +1,29 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Rudolf Schnapka <schnapkar@golive-saar.de>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:38+0000\n"
"PO-Revision-Date: 2015-05-20 09:39+0100\n"
"Last-Translator: Rudolf Schnapka <schnapkar@golive-saar.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_nationality
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr "Nationalität"
#. module: partner_contact_nationality
#: model:ir.model,name:partner_contact_nationality.model_res_partner
msgid "Partner"
msgstr "Partner"

28
partner_contact_nationality/i18n/es.po

@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_contact_nationality
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:38+0000\n"
"PO-Revision-Date: 2015-05-20 09:39+0100\n"
"Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.7.6\n"
"Language: es_ES\n"
#. module: partner_contact_nationality
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr "Nacionalidad"
#. module: partner_contact_nationality
#: model:ir.model,name:partner_contact_nationality.model_res_partner
msgid "Partner"
msgstr "Empresa"

28
partner_contact_nationality/i18n/fr.po

@ -0,0 +1,28 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:38+0000\n"
"PO-Revision-Date: 2015-05-20 09:40+0100\n"
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_nationality
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr "Nationalité"
#. module: partner_contact_nationality
#: model:ir.model,name:partner_contact_nationality.model_res_partner
msgid "Partner"
msgstr "Partenaire"

27
partner_contact_nationality/i18n/partner_contact_nationality.pot

@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_contact_nationality
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:38+0000\n"
"PO-Revision-Date: 2015-05-20 07:38+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_contact_nationality
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr ""
#. module: partner_contact_nationality
#: model:ir.model,name:partner_contact_nationality.model_res_partner
msgid "Partner"
msgstr ""

29
partner_contact_nationality/i18n/sl.po

@ -0,0 +1,29 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-20 07:38+0000\n"
"PO-Revision-Date: 2015-05-20 09:40+0100\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian <translate@matmoz.si>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_nationality
#: field:res.partner,nationality_id:0
msgid "Nationality"
msgstr "Nacionalnost"
#. module: partner_contact_nationality
#: model:ir.model,name:partner_contact_nationality.model_res_partner
msgid "Partner"
msgstr "Partner"

26
partner_contact_nationality/models.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from openerp import fields, models
class Partner(models.Model):
"""Partner with nationality."""
_inherit = "res.partner"
nationality_id = fields.Many2one("res.country", "Nationality")

19
partner_contact_nationality/views/res_partner.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="form" model="ir.ui.view">
<field name="name">Nationality field</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="partner_contact_personal_information_page.personal_information"/>
<field name="arch" type="xml">
<data>
<xpath expr="//group[@name='personal_information_group']">
<field name="nationality_id"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

59
partner_contact_personal_information_page/README.rst

@ -0,0 +1,59 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Contacts' Personal Information Page
===================================
This module was written to extend the contact management functionality.
Its only purpose is to serve as a base for other modules that add personal
information fields to **contacts that are persons**.
Installation
============
.. warning::
**You should NOT install this module yourself**, because it does nothing by
itself. This module should get installed automatically when you install
other modules that actually do something useful.
Usage
=====
You can find a new page called *Personal Information* in the contact's form.
For further information, please visit:
* https://www.odoo.com/forum/help-1
* https://github.com/OCA/partner-contact/
Known issues / Roadmap
======================
* None.
Credits
=======
Contributors
------------
* EL Hadji DEM <elhadji.dem@savoirfairelinux.com>
* Jairo Llopis <j.llopis@grupoesoc.es>
* Matjaž Mozetič <m.mozetic@matmoz.si>
* Rudolf Schnapka <schnapkar@golive-saar.de>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://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.

0
partner_contact_personal_information_page/__init__.py

32
partner_contact_personal_information_page/__openerp__.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
"name": "Personal information page for contacts",
"summary": "Add a page to contacts form to put personal information",
"version": "1.0.0",
"author": "Odoo Community Association (OCA)",
"category": "Customer Relationship Management",
"website": "https://odoo-community.org/",
"depends": [
"base"
],
"data": [
"views/res_partner.xml",
],
}

24
partner_contact_personal_information_page/i18n/de.po

@ -0,0 +1,24 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Rudolf Schnapka <schnapkar@golive-saar.de>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-19 10:13+0000\n"
"PO-Revision-Date: 2015-05-19 12:15+0100\n"
"Last-Translator: Rudolf Schnapka <schnapkar@golive-saar.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_base
#: view:res.partner:partner_contact_base.personal_information
msgid "Personal Information"
msgstr "Persönliche Auskunft"

23
partner_contact_personal_information_page/i18n/es.po

@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_contact_base
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-19 10:13+0000\n"
"PO-Revision-Date: 2015-05-19 12:16+0100\n"
"Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.7.6\n"
"Language: es_ES\n"
#. module: partner_contact_base
#: view:res.partner:partner_contact_base.personal_information
msgid "Personal Information"
msgstr "Información personal"

23
partner_contact_personal_information_page/i18n/fr.po

@ -0,0 +1,23 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-19 10:13+0000\n"
"PO-Revision-Date: 2015-05-19 12:15+0100\n"
"Last-Translator: EL Hadji DEM <elhadji.dem@savoirfairelinux.com>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_base
#: view:res.partner:partner_contact_base.personal_information
msgid "Personal Information"
msgstr "Informations personnelles"

22
partner_contact_personal_information_page/i18n/partner_contact_personal_information_page.pot

@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_contact_base
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0-20150514\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-19 10:13+0000\n"
"PO-Revision-Date: 2015-05-19 10:13+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_contact_base
#: view:res.partner:partner_contact_base.personal_information
msgid "Personal Information"
msgstr ""

24
partner_contact_personal_information_page/i18n/sl.po

@ -0,0 +1,24 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * base_contact
#
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015.
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-19 10:13+0000\n"
"PO-Revision-Date: 2015-05-19 12:15+0100\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian <translate@matmoz.si>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 1.7.6\n"
#. module: partner_contact_base
#: view:res.partner:partner_contact_base.personal_information
msgid "Personal Information"
msgstr "Osebni podatki"

24
partner_contact_personal_information_page/views/res_partner.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="personal_information" model="ir.ui.view">
<field name="name">Personal information page for contacts form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">2</field>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='internal_notes']" position="after">
<page name="personal_information_page"
string="Personal Information"
attrs="{'invisible': [('is_company','=',True)]}">
<group name="personal_information_group"/>
</page>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

65
partner_external_maps/README.rst

@ -0,0 +1,65 @@
Partner External Maps
=====================
In the old days of Odoo/OpenERP, back in version 6.1, there was an official *google_map* module ; this module added a *Map* button on the partner form view and, when the user clicked on that button, it would open a new tab on its web browser and go to Google Map with a search on the address of the partner.
This module aims at restoring this feature with several improvements:
* each user can select the map website he wants to use in its preferences
* there are now two buttons on the partner form view: one to open a regular map on the address of the partner, and another one to open an itinerary map from the start address configured in the preferences of the user to the address of the partner.
This module supports several map websites:
* `Google Maps <https://www.google.com/maps>`
* `OpenStreetMap <https://www.openstreetmap.org/>`
* `Bing Maps <https://www.bing.com/maps/>`
* `Here Maps <https://www.here.com/>`
* `MapQuest <http://www.mapquest.com/>`
* `Yahoo! Maps <https://maps.yahoo.com/>`
If the module *base_geolocalize* from the official addons is installed on the system, it will use the latitude and longitude to localize the partner (instead of the address) if this information is present on the partner.
Configuration
=============
If you want to create additionnal map websites, go to the menu *Sales > Configuration > Address Book > Localization > Map Websites*. You are invited to send the configuration information of your additionnal map websites to the author of the module, so that the module can be updated with more pre-configured map websites.
Usage
=====
First, you need to configure in your preferences:
* the map website to use for the regular maps,
* the map website to use for the route maps,
* the start address for the route maps.
Then you can use the two new buttons on the partner form to open a regular map or a route map.
Credits
=======
Contributors
------------
* Alexis de Lattre <alexis.delattre@akretion.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.

4
partner_external_maps/__init__.py

@ -0,0 +1,4 @@
# -*- encoding: utf-8 -*-
from . import partner_external_maps
from .post_install import set_default_map_settings

43
partner_external_maps/__openerp__.py

@ -0,0 +1,43 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Partner External Maps module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Partner External Maps',
'version': '0.1',
'category': 'Extra Tools',
'license': 'AGPL-3',
'summary': 'Add Map and Map Routing buttons on partner form to '
'open GMaps, OSM, Bing and others',
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'http://www.akretion.com',
'depends': ['base'],
'data': [
'partner_view.xml',
'map_website_data.xml',
'map_website_view.xml',
'users_view.xml',
'security/ir.model.access.csv',
],
'post_init_hook': 'set_default_map_settings',
'installable': True,
}

190
partner_external_maps/i18n/fr.po

@ -0,0 +1,190 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_external_maps
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-19 19:42+0000\n"
"PO-Revision-Date: 2015-06-19 19:42+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:115
#, python-format
msgid "Address missing on partner '%s'."
msgstr "Adresse manquante sur le partenaire '%s'."
#. module: partner_external_maps
#: field:map.website,create_uid:0
msgid "Created by"
msgstr "Créé par"
#. module: partner_external_maps
#: field:map.website,create_date:0
msgid "Created on"
msgstr "Créé le"
#. module: partner_external_maps
#: field:map.website,id:0
msgid "ID"
msgstr "ID"
#. module: partner_external_maps
#: help:map.website,address_url:0
msgid "In this URL, {ADDRESS} will be replaced by the address."
msgstr ""
#. module: partner_external_maps
#: help:map.website,lat_lon_url:0
msgid "In this URL, {LATITUDE} and {LONGITUDE} will be replaced by the latitude and longitude (requires the module 'base_geolocalize')"
msgstr ""
#. module: partner_external_maps
#: help:map.website,route_address_url:0
msgid "In this URL, {START_ADDRESS} and {DEST_ADDRESS} will be replaced by the start and destination addresses."
msgstr ""
#. module: partner_external_maps
#: help:map.website,route_lat_lon_url:0
msgid "In this URL, {START_LATITUDE}, {START_LONGITUDE}, {DEST_LATITUDE} and {DEST_LONGITUDE} will be replaced by the latitude and longitude of the start and destination adresses (requires the module 'base_geolocalize')."
msgstr ""
#. module: partner_external_maps
#: field:map.website,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: partner_external_maps
#: field:map.website,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: partner_external_maps
#: view:res.partner:partner_external_maps.view_partner_form
msgid "Map"
msgstr "Carte"
#. module: partner_external_maps
#: model:ir.model,name:partner_external_maps.model_map_website
#: view:map.website:partner_external_maps.map_website_form
#: field:res.users,context_map_website_id:0
msgid "Map Website"
msgstr "Site de carte"
#. module: partner_external_maps
#: field:map.website,name:0
msgid "Map Website Name"
msgstr "Nom du site de carte"
#. module: partner_external_maps
#: model:ir.actions.act_window,name:partner_external_maps.map_website_action
#: model:ir.ui.menu,name:partner_external_maps.map_website_menu
#: view:map.website:partner_external_maps.map_website_tree
msgid "Map Websites"
msgstr "Sites de carte"
#. module: partner_external_maps
#: help:res.users,context_route_map_website_id:0
msgid "Map provided used when you click on the car icon on the partner form to display an itinerary."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:191
#, python-format
msgid "Missing geo-localization information on destination partner '%s'."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:187
#, python-format
msgid "Missing geo-localization information on start partner '%s'."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:133
#, python-format
msgid "Missing map provider: you should set it in your preferences."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:178
#, python-format
msgid "Missing module 'base_geolocalize'"
msgstr "Module 'base_geolocalize' manquant"
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:147
#, python-format
msgid "Missing parameter 'URL that uses the address' for map website '%s'."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:162
#, python-format
msgid "Missing route map website: you should set it in your preferences."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:167
#, python-format
msgid "Missing start address for route map: you should set it in your preferences."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:181
#, python-format
msgid "No route URL that uses latitude and longitude on map provider '%s'."
msgstr ""
#. module: partner_external_maps
#: model:ir.model,name:partner_external_maps.model_res_partner
msgid "Partner"
msgstr "Partenaire"
#. module: partner_external_maps
#: view:res.partner:partner_external_maps.view_partner_form
msgid "Route Map"
msgstr "Itinéraire"
#. module: partner_external_maps
#: field:res.users,context_route_map_website_id:0
msgid "Route Map Website"
msgstr "Site web pour les itinéraires"
#. module: partner_external_maps
#: field:map.website,route_lat_lon_url:0
msgid "Route URL that uses latitude and longitude"
msgstr ""
#. module: partner_external_maps
#: field:map.website,route_address_url:0
msgid "Route URL that uses the addresses"
msgstr ""
#. module: partner_external_maps
#: field:res.users,context_route_start_partner_id:0
msgid "Start Address for Route Map"
msgstr "Adresse de départ pour les itinéraires"
#. module: partner_external_maps
#: field:map.website,lat_lon_url:0
msgid "URL that uses latitude and longitude"
msgstr ""
#. module: partner_external_maps
#: field:map.website,address_url:0
msgid "URL that uses the address"
msgstr ""
#. module: partner_external_maps
#: model:ir.model,name:partner_external_maps.model_res_users
msgid "Users"
msgstr "Utilisateurs"

172
partner_external_maps/i18n/partner_external_maps.pot

@ -0,0 +1,172 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_external_maps
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-19 19:55+0000\n"
"PO-Revision-Date: 2015-06-19 19:55+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:116
#, python-format
msgid "Address missing on partner '%s'."
msgstr ""
#. module: partner_external_maps
#: field:map.website,create_uid:0
msgid "Created by"
msgstr ""
#. module: partner_external_maps
#: field:map.website,create_date:0
msgid "Created on"
msgstr ""
#. module: partner_external_maps
#: field:map.website,id:0
msgid "ID"
msgstr ""
#. module: partner_external_maps
#: help:map.website,address_url:0
msgid "In this URL, {ADDRESS} will be replaced by the address."
msgstr ""
#. module: partner_external_maps
#: help:map.website,lat_lon_url:0
msgid "In this URL, {LATITUDE} and {LONGITUDE} will be replaced by the latitude and longitude (requires the module 'base_geolocalize')"
msgstr ""
#. module: partner_external_maps
#: help:map.website,route_address_url:0
msgid "In this URL, {START_ADDRESS} and {DEST_ADDRESS} will be replaced by the start and destination addresses."
msgstr ""
#. module: partner_external_maps
#: help:map.website,route_lat_lon_url:0
msgid "In this URL, {START_LATITUDE}, {START_LONGITUDE}, {DEST_LATITUDE} and {DEST_LONGITUDE} will be replaced by the latitude and longitude of the start and destination adresses (requires the module 'base_geolocalize')."
msgstr ""
#. module: partner_external_maps
#: field:map.website,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: partner_external_maps
#: field:map.website,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: partner_external_maps
#: view:res.partner:partner_external_maps.view_partner_form
msgid "Map"
msgstr ""
#. module: partner_external_maps
#: model:ir.model,name:partner_external_maps.model_map_website
#: view:map.website:partner_external_maps.map_website_form
#: field:res.users,context_map_website_id:0
msgid "Map Website"
msgstr ""
#. module: partner_external_maps
#: field:map.website,name:0
msgid "Map Website Name"
msgstr ""
#. module: partner_external_maps
#: model:ir.actions.act_window,name:partner_external_maps.map_website_action
#: model:ir.ui.menu,name:partner_external_maps.map_website_menu
#: view:map.website:partner_external_maps.map_website_tree
msgid "Map Websites"
msgstr ""
#. module: partner_external_maps
#: help:res.users,context_route_map_website_id:0
msgid "Map provided used when you click on the car icon on the partner form to display an itinerary."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:134
#, python-format
msgid "Missing map provider: you should set it in your preferences."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:148
#, python-format
msgid "Missing parameter 'URL that uses the address' for map website '%s'."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:187
#, python-format
msgid "Missing route URL that uses the addresses for the map website '%s'"
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:163
#, python-format
msgid "Missing route map website: you should set it in your preferences."
msgstr ""
#. module: partner_external_maps
#: code:addons/partner_external_maps/partner_external_maps.py:168
#, python-format
msgid "Missing start address for route map: you should set it in your preferences."
msgstr ""
#. module: partner_external_maps
#: model:ir.model,name:partner_external_maps.model_res_partner
msgid "Partner"
msgstr ""
#. module: partner_external_maps
#: view:res.partner:partner_external_maps.view_partner_form
msgid "Route Map"
msgstr ""
#. module: partner_external_maps
#: field:res.users,context_route_map_website_id:0
msgid "Route Map Website"
msgstr ""
#. module: partner_external_maps
#: field:map.website,route_lat_lon_url:0
msgid "Route URL that uses latitude and longitude"
msgstr ""
#. module: partner_external_maps
#: field:map.website,route_address_url:0
msgid "Route URL that uses the addresses"
msgstr ""
#. module: partner_external_maps
#: field:res.users,context_route_start_partner_id:0
msgid "Start Address for Route Map"
msgstr ""
#. module: partner_external_maps
#: field:map.website,lat_lon_url:0
msgid "URL that uses latitude and longitude"
msgstr ""
#. module: partner_external_maps
#: field:map.website,address_url:0
msgid "URL that uses the address"
msgstr ""
#. module: partner_external_maps
#: model:ir.model,name:partner_external_maps.model_res_users
msgid "Users"
msgstr ""

64
partner_external_maps/map_website_data.xml

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion (www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<!-- Interesting source of information: http://northwestspatial.com/wp/?p=38 -->
<record id="google_maps" model="map.website">
<field name="name">Google Maps</field>
<field name="address_url">https://www.google.com/maps?ie=UTF8&amp;q={ADDRESS}</field>
<field name="lat_lon_url">https://www.google.com/maps?z=15&amp;q={LATITUDE},{LONGITUDE}</field>
<field name="route_address_url">https://www.google.com/maps?saddr={START_ADDRESS}&amp;daddr={DEST_ADDRESS}&amp;directionsmode=driving</field>
<field name="route_lat_lon_url">https://www.google.com/maps?saddr={START_LATITUDE},{START_LONGITUDE}&amp;daddr={DEST_LATITUDE},{DEST_LONGITUDE}&amp;directionsmode=driving</field>
</record>
<record id="openstreetmap" model="map.website">
<field name="name">OpenStreetMap</field>
<field name="address_url">https://nominatim.openstreetmap.org/search?q={ADDRESS}</field>
<field name="lat_lon_url">https://www.openstreetmap.org/?zoom=15&amp;mlat={LATITUDE}&amp;mlon={LONGITUDE}</field>
<field name="route_lat_lon_url">https://www.openstreetmap.org/directions/?engine=orsm_car&amp;route={START_LATITUDE},{START_LONGITUDE};{DEST_LATITUDE},{DEST_LONGITUDE}</field>
</record>
<record id="openstreetmap_fr" model="map.website">
<field name="name">OpenStreetMap FR</field>
<field name="address_url">http://tile.openstreetmap.fr/?q={ADDRESS}</field>
<field name="lat_lon_url">http://tile.openstreetmap.fr/?zoom=15&amp;lat={LATITUDE}&amp;lon={LONGITUDE}</field>
</record>
<record id="bing_maps" model="map.website">
<field name="name">Bing Maps</field>
<field name="address_url">https://www.bing.com/maps/default.aspx?where1={ADDRESS}</field>
<field name="lat_lon_url">https://www.bing.com/maps/default.aspx?where1={LATITUDE},{LONGITUDE}&amp;lvl=15</field>
</record>
<record id="here" model="map.website">
<field name="name">Here Maps</field>
<field name="address_url">https://here.com/search/{ADDRESS}</field>
<field name="lat_lon_url">https://www.here.com/?map={LATITUDE},{LONGITUDE},15,normal</field>
<!-- TODO : for here maps, try to find a lat_lon_url with dot -->
<field name="route_lat_lon_url">https://www.here.com/directions/drive/:{START_LATITUDE},{START_LONGITUDE}/:{DEST_LATITUDE},{DEST_LONGITUDE}</field>
</record>
<record id="mapquest" model="map.website">
<field name="name">MapQuest</field>
<field name="address_url">http://mapq.st/?q={ADDRESS}</field>
<field name="lat_lon_url">http://mapq.st/?q={LATITUDE},{LONGITUDE}</field>
<field name="route_address_url">http://mapq.st/directions?saddr={START_ADDRESS}&amp;daddr={DEST_ADDRESS}</field>
<field name="route_lat_lon_url">http://mapq.st/directions?saddr={START_LATITUDE},{START_LONGITUDE}&amp;daddr={DEST_LATITUDE},{DEST_LONGITUDE}</field>
</record>
<record id="yahoo_maps" model="map.website">
<field name="name">Yahoo! Maps</field>
<field name="address_url">https://maps.yahoo.com/place/?addr={ADDRESS}</field>
<field name="lat_lon_url">https://maps.yahoo.com/place/?lat={LATITUDE}&amp;lon={LONGITUDE}</field>
<field name="route_address_url">https://maps.yahoo.com/directions/?o={START_ADDRESS}&amp;d={DEST_ADDRESS}</field>
</record>
</data>
</openerp>

49
partner_external_maps/map_website_view.xml

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion France (www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="map_website_form" model="ir.ui.view">
<field name="name">map.website.form</field>
<field name="model">map.website</field>
<field name="arch" type="xml">
<form string="Map Website">
<group name="main">
<field name="name"/>
<field name="address_url"/>
<field name="lat_lon_url"/>
<field name="route_address_url"/>
<field name="route_lat_lon_url"/>
</group>
</form>
</field>
</record>
<record id="map_website_tree" model="ir.ui.view">
<field name="name">map.website.tree</field>
<field name="model">map.website</field>
<field name="arch" type="xml">
<tree string="Map Websites">
<field name="name"/>
<field name="address_url"/>
</tree>
</field>
</record>
<record id="map_website_action" model="ir.actions.act_window">
<field name="name">Map Websites</field>
<field name="res_model">map.website</field>
<field name="view_mode">tree,form</field>
</record>
<!-- Menu entry under Sales > Config > Address Book > Localization -->
<menuitem id="map_website_menu" action="map_website_action"
parent="base.menu_localisation" sequence="50"/>
</data>
</openerp>

210
partner_external_maps/partner_external_maps.py

@ -0,0 +1,210 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Partner External Maps module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields, api, _
from openerp.exceptions import Warning
import logging
logger = logging.getLogger(__name__)
class MapWebsite(models.Model):
_name = 'map.website'
_description = 'Map Website'
name = fields.Char(string='Map Website Name', required=True)
address_url = fields.Char(
string='URL that uses the address',
help="In this URL, {ADDRESS} will be replaced by the address.")
lat_lon_url = fields.Char(
string='URL that uses latitude and longitude',
help="In this URL, {LATITUDE} and {LONGITUDE} will be replaced by "
"the latitude and longitude (requires the module 'base_geolocalize')")
route_address_url = fields.Char(
string='Route URL that uses the addresses',
help="In this URL, {START_ADDRESS} and {DEST_ADDRESS} will be "
"replaced by the start and destination addresses.")
route_lat_lon_url = fields.Char(
string='Route URL that uses latitude and longitude',
help="In this URL, {START_LATITUDE}, {START_LONGITUDE}, "
"{DEST_LATITUDE} and {DEST_LONGITUDE} will be replaced by the "
"latitude and longitude of the start and destination adresses "
"(requires the module 'base_geolocalize').")
class ResUsers(models.Model):
_inherit = 'res.users'
@api.model
def _default_map_website(self):
map_website = self.env['map.website'].search([
'|', ('address_url', '!=', False), ('lat_lon_url', '!=', False)],
limit=1)
return map_website
@api.model
def _default_route_map_website(self):
map_route_website = self.env['map.website'].search([
'|',
('route_address_url', '!=', False),
('route_lat_lon_url', '!=', False)], limit=1)
return map_route_website
# begin with context_ to allow user to change it by himself
context_map_website_id = fields.Many2one(
'map.website', string='Map Website',
domain=[
'|', ('address_url', '!=', False), ('lat_lon_url', '!=', False)],
default=_default_map_website)
# We want to give the possibility to the user to have one map provider for
# regular maps and another one for routing
context_route_map_website_id = fields.Many2one(
'map.website', string='Route Map Website',
domain=[
'|',
('route_address_url', '!=', False),
('route_lat_lon_url', '!=', False)],
default=_default_route_map_website,
help="Map provided used when you click on the car icon on the partner "
"form to display an itinerary.")
context_route_start_partner_id = fields.Many2one(
'res.partner', string='Start Address for Route Map')
@api.model
def _default_map_settings(self):
"""Method called from post-install script
I can't use a default method on the field, because it would be executed
before loading map_website_data.xml, so it would not be able to set a
value"""
users = self.env['res.users'].search([])
map_website = self._default_map_website()
map_route_website = self._default_route_map_website()
logger.info('Updating user settings for maps...')
for user in users:
user.write({
'context_map_website_id': map_website.id or False,
'context_route_map_website_id': map_route_website.id or False,
'context_route_start_partner_id': user.partner_id.id or False,
})
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.model
def _address_as_string(self):
addr = []
if self.street:
addr.append(self.street)
if self.street2:
addr.append(self.street2)
if self.city:
addr.append(self.city)
if self.state_id:
addr.append(self.state_id.name)
if self.country_id:
addr.append(self.country_id.name)
if not addr:
raise Warning(
_("Address missing on partner '%s'.") % self.name)
address = ' '.join(addr)
return address
@api.model
def _prepare_url(self, url, replace):
assert url, 'Missing URL'
for key, value in replace.iteritems():
if not isinstance(value, (str, unicode)):
# for latitude and longitude which are floats
value = unicode(value)
url = url.replace(key, value)
logger.debug('Final URL: %s', url)
return url
@api.multi
def open_map(self):
if not self.env.user.context_map_website_id:
raise Warning(
_('Missing map provider: '
'you should set it in your preferences.'))
map_website = self.env.user.context_map_website_id
if (
map_website.lat_lon_url and
hasattr(self, 'partner_latitude') and
self.partner_latitude and self.partner_longitude):
url = self._prepare_url(
map_website.lat_lon_url, {
'{LATITUDE}': self.partner_latitude,
'{LONGITUDE}': self.partner_longitude})
else:
if not map_website.address_url:
raise Warning(
_("Missing parameter 'URL that uses the address' "
"for map website '%s'.") % map_website.name)
url = self._prepare_url(
map_website.address_url,
{'{ADDRESS}': self._address_as_string()})
return {
'type': 'ir.actions.act_url',
'url': url,
'target': 'new',
}
@api.multi
def open_route_map(self):
if not self.env.user.context_route_map_website_id:
raise Warning(
_('Missing route map website: '
'you should set it in your preferences.'))
map_website = self.env.user.context_route_map_website_id
if not self.env.user.context_route_start_partner_id:
raise Warning(
_('Missing start address for route map: '
'you should set it in your preferences.'))
start_partner = self.env.user.context_route_start_partner_id
if (
map_website.route_lat_lon_url and
hasattr(self, 'partner_latitude') and
self.partner_latitude and
self.partner_longitude and
start_partner.partner_latitude and
start_partner.partner_longitude):
url = self._prepare_url(
map_website.route_lat_lon_url, {
'{START_LATITUDE}': start_partner.partner_latitude,
'{START_LONGITUDE}': start_partner.partner_longitude,
'{DEST_LATITUDE}': self.partner_latitude,
'{DEST_LONGITUDE}': self.partner_longitude})
else:
if not map_website.route_address_url:
raise Warning(
_("Missing route URL that uses the addresses "
"for the map website '%s'") % map_website.name)
url = self._prepare_url(
map_website.route_address_url, {
'{START_ADDRESS}': start_partner._address_as_string(),
'{DEST_ADDRESS}': self._address_as_string()})
return {
'type': 'ir.actions.act_url',
'url': url,
'target': 'new',
}

31
partner_external_maps/partner_view.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion France (www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<!-- Inherit partner view to add 'Map' button -->
<record id="view_partner_form" model="ir.ui.view">
<field name="name">map.button.res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='buttons']" position="inside">
<button class="oe_inline oe_stat_button"
name="open_map" type="object" string="Map"
attrs="{'invisible': [('city', '=', False)]}"
icon="fa-map-marker"/>
<button class="oe_inline oe_stat_button"
name="open_route_map" type="object" string="Route Map"
attrs="{'invisible': [('city', '=', False)]}"
icon="fa-car"/>
</xpath>
</field>
</record>
</data>
</openerp>

28
partner_external_maps/post_install.py

@ -0,0 +1,28 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Partner Address on Map module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import SUPERUSER_ID
def set_default_map_settings(cr, pool):
pool['res.users']._default_map_settings(cr, SUPERUSER_ID)
return

3
partner_external_maps/security/ir.model.access.csv

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_map_website_read,Read access on map.website to everybody,model_map_website,,1,0,0,0
access_map_website_full,Full access on map.website to System user,model_map_website,base.group_system,1,1,1,1

42
partner_external_maps/users_view.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion France (www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_users_form" model="ir.ui.view">
<field name="name">map.res.users.form</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<group name="messaging" position="after">
<group name="maps" string="Maps">
<field name="context_map_website_id" widget="selection"/>
<field name="context_route_map_website_id" widget="selection"/>
<field name="context_route_start_partner_id"/>
</group>
</group>
</field>
</record>
<record id="view_users_form_simple_modif" model="ir.ui.view">
<field name="name">map.preferences.res.users.form</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="arch" type="xml">
<group name="preferences" position="inside">
<field name="context_map_website_id"
readonly="0" widget="selection"/>
<field name="context_route_map_website_id"
readonly="0" widget="selection"/>
<field name="context_route_start_partner_id" readonly="0"/>
</group>
</field>
</record>
</data>
</openerp>

56
partner_firstname/README.rst

@ -0,0 +1,56 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
: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.
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 *"Lastname Firstname"*, 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).
For further information, please visit:
* https://www.odoo.com/forum/help-1
Credits
=======
Contributors
------------
* Nicolas Bessi <nicolas.bessi@camptocamp.com>
* Jonathan Nemry <jonathan.nemry@acsone.eu>
* Olivier Laurent <olivier.laurent@acsone.eu>
* Hans Henrik Gabelgaard <hhg@gabelgaard.org>
* Jairo Llopis <j.llopis@grupoesoc.es>
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.

11
partner_firstname/__init__.py

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA # Author: Nicolas Bessi. Copyright Camptocamp SA
# Copyright (C)
# 2014: Agile Business Group (<http://www.agilebg.com>)
# 2015: Grupo ESOC <www.grupoesoc.es>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -15,8 +17,5 @@
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import partner
from . import res_user
from . import models

33
partner_firstname/__openerp__.py

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA # Author: Nicolas Bessi. Copyright Camptocamp SA
# Copyright (C)
# 2014: Agile Business Group (<http://www.agilebg.com>)
# 2015: Grupo ESOC <www.grupoesoc.es>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -15,35 +17,20 @@
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{ {
'name': 'Partner first name, last name',
'description': """
This module splits first name and last name for non company partners
====================================================================
The field 'name' becomes a stored function field concatenating lastname and
firstname
Note: in version 7.0, installing this module invalidates a yaml test in the
'edi' module
Contributors
============
Jonathan Nemry <jonathan.nemry@acsone.eu>
Olivier Laurent <olivier.laurent@acsone.eu>
""",
'version': '1.2',
'name': 'Partner first name and last name',
'summary': "Split first name and last name for non company partners",
'version': '2.0',
'author': "Camptocamp,Odoo Community Association (OCA)", 'author': "Camptocamp,Odoo Community Association (OCA)",
'maintainer': 'Camptocamp, Acsone', 'maintainer': 'Camptocamp, Acsone',
'category': 'Extra Tools', 'category': 'Extra Tools',
'website': 'http://www.camptocamp.com, http://www.acsone.eu', 'website': 'http://www.camptocamp.com, http://www.acsone.eu',
'depends': ['base'], 'depends': ['base'],
'data': [ 'data': [
'partner_view.xml',
'res_user_view.xml',
'views/res_partner.xml',
'views/res_user.xml',
'data/res_partner.yml',
], ],
'demo': [], 'demo': [],
'test': [], 'test': [],

19
partner_firstname/data/res_partner.yml

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright (C)
# 2015: Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- !function {model: res.partner, name: _install_partner_firstname}

27
partner_firstname/exceptions.py

@ -0,0 +1,27 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from openerp 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)

54
partner_firstname/i18n/da.po

@ -0,0 +1,54 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * partner_firstname
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-22 13:33+0100\n"
"PO-Revision-Date: 2015-05-22 13:38+0100\n"
"Last-Translator: Hans Henrik Gabelgaard <hhg@gabelgaard.org>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.8\n"
"Language: da\n"
#. module: partner_firstname
#: code:addons/partner_firstname/partner.py:81
#: code:addons/partner_firstname/res_user.py:35
#: code:addons/partner_firstname/tests/test_partner_firstname.py:56
#: code:addons/partner_firstname/tests/test_partner_firstname.py:57
#: code:addons/partner_firstname/tests/test_partner_firstname.py:71
#: code:addons/partner_firstname/tests/test_partner_firstname.py:72
#, python-format
msgid "%s (copy)"
msgstr "%s (kopi)"
#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_users
msgid "Users"
msgstr "Brugere"
#. module: partner_firstname
#: field:res.partner,firstname:0
msgid "Firstname"
msgstr "Fornavn"
#. module: partner_firstname
#: field:res.partner,lastname:0
msgid "Lastname"
msgstr "Efternavn"
#. module: partner_firstname
#: view:res.partner:0
msgid "Is a Company?"
msgstr "Er et firma?"
#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_partner
msgid "Partner"
msgstr "Partner"

48
partner_firstname/i18n/es.po

@ -6,48 +6,54 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n" "Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-12-23 14:09+0000\n"
"PO-Revision-Date: 2014-12-23 14:09+0000\n"
"Last-Translator: <>\n"
"POT-Creation-Date: 2015-03-30 07:53+0000\n"
"PO-Revision-Date: 2015-03-30 10:01+0100\n"
"Last-Translator: Jairo Llopis <j.llopis@grupoesoc.es>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n" "Plural-Forms: \n"
"X-Generator: Poedit 1.7.5\n"
#. module: partner_firstname #. module: partner_firstname
#: code:addons/partner_firstname/partner.py:81
#: code:addons/partner_firstname/res_user.py:35
#: code:addons/partner_firstname/tests/test_partner_firstname.py:56
#: code:addons/partner_firstname/tests/test_partner_firstname.py:57
#: code:addons/partner_firstname/tests/test_partner_firstname.py:71
#: code:addons/partner_firstname/tests/test_partner_firstname.py:72
#: code:addons/partner_firstname/exceptions.py:26
#, python-format #, python-format
msgid "%s (copy)"
msgstr "%s (copia)"
#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_users
msgid "Users"
msgstr "Usuarios"
msgid "Error(s) with partner %d's name."
msgstr "Errores con el nombre de la empresa %d."
#. module: partner_firstname #. module: partner_firstname
#: field:res.partner,firstname:0 #: field:res.partner,firstname:0
msgid "First name" msgid "First name"
msgstr "Nombre" msgstr "Nombre"
#. module: partner_firstname
#: view:res.partner:partner_firstname.partner_form
msgid "Is a Company?"
msgstr "¿Es una empresa?"
#. module: partner_firstname #. module: partner_firstname
#: field:res.partner,lastname:0 #: field:res.partner,lastname:0
msgid "Last name" msgid "Last name"
msgstr "Apellidos"
msgstr "Apellido"
#. module: partner_firstname #. module: partner_firstname
#: view:res.partner:0
msgid "Is a Company?"
msgstr "¿Es una empresa?"
#: code:addons/partner_firstname/exceptions.py:40
#, python-format
msgid "No name is set."
msgstr "No se ha establecido ningún nombre."
#. module: partner_firstname #. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_partner #: model:ir.model,name:partner_firstname.model_res_partner
msgid "Partner" msgid "Partner"
msgstr "Empresa" msgstr "Empresa"
#~ msgid "True"
#~ msgstr "Verdadero"
#~ msgid "%s (copy)"
#~ msgstr "%s (copia)"
#~ msgid "Users"
#~ msgstr "Usuarios"

53
partner_firstname/i18n/it.po

@ -0,0 +1,53 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * partner_firstname
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-12 17:38+0200\n"
"PO-Revision-Date: 2015-05-12 17:38+0200\n"
"Last-Translator: Leonardo Donelli <donelli@webmonks.it>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_firstname
#: code:addons/partner_firstname/partner.py:81
#: code:addons/partner_firstname/res_user.py:35
#: code:addons/partner_firstname/tests/test_partner_firstname.py:56
#: code:addons/partner_firstname/tests/test_partner_firstname.py:57
#: code:addons/partner_firstname/tests/test_partner_firstname.py:71
#: code:addons/partner_firstname/tests/test_partner_firstname.py:72
#, python-format
msgid "%s (copy)"
msgstr "%s (copia)"
#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_users
msgid "Users"
msgstr "Utenti"
#. module: partner_firstname
#: field:res.partner,firstname:0
msgid "Firstname"
msgstr "Nome"
#. module: partner_firstname
#: field:res.partner,lastname:0
msgid "Lastname"
msgstr "Cognome"
#. module: partner_firstname
#: view:res.partner:0
msgid "Is a Company?"
msgstr "È un'azienda?"
#. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_partner
msgid "Partner"
msgstr "Partner"

31
partner_firstname/i18n/partner_firstname.pot

@ -1,13 +1,13 @@
# Translation of OpenERP Server.
# Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * partner_firstname # * partner_firstname
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Project-Id-Version: Odoo Server 8.0-20150327\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-01-22 14:09+0000\n"
"PO-Revision-Date: 2014-01-22 14:09+0000\n"
"POT-Creation-Date: 2015-03-30 07:53+0000\n"
"PO-Revision-Date: 2015-03-30 07:53+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -16,24 +16,19 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: partner_firstname #. module: partner_firstname
#: code:addons/partner_firstname/partner.py:81
#: code:addons/partner_firstname/res_user.py:35
#: code:addons/partner_firstname/tests/test_partner_firstname.py:56
#: code:addons/partner_firstname/tests/test_partner_firstname.py:57
#: code:addons/partner_firstname/tests/test_partner_firstname.py:71
#: code:addons/partner_firstname/tests/test_partner_firstname.py:72
#: code:addons/partner_firstname/exceptions.py:26
#, python-format #, python-format
msgid "%s (copy)"
msgid "Error(s) with partner %d's name."
msgstr "" msgstr ""
#. module: partner_firstname #. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_users
msgid "Users"
#: field:res.partner,firstname:0
msgid "First name"
msgstr "" msgstr ""
#. module: partner_firstname #. module: partner_firstname
#: field:res.partner,firstname:0
msgid "Firstname"
#: view:res.partner:partner_firstname.partner_form
msgid "Is a Company?"
msgstr "" msgstr ""
#. module: partner_firstname #. module: partner_firstname
@ -42,12 +37,12 @@ msgid "Lastname"
msgstr "" msgstr ""
#. module: partner_firstname #. module: partner_firstname
#: view:res.partner:0
msgid "Is a Company?"
#: code:addons/partner_firstname/exceptions.py:40
#, python-format
msgid "No name is set."
msgstr "" msgstr ""
#. module: partner_firstname #. module: partner_firstname
#: model:ir.model,name:partner_firstname.model_res_partner #: model:ir.model,name:partner_firstname.model_res_partner
msgid "Partner" msgid "Partner"
msgstr "" msgstr ""

136
partner_firstname/models.py

@ -0,0 +1,136 @@
# -*- coding: utf-8 -*-
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Copyright (C)
# 2014: Agile Business Group (<http://www.agilebg.com>)
# 2015: Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
from openerp import api, fields, models
from . import exceptions
_logger = logging.getLogger(__name__)
class ResPartner(models.Model):
"""Adds last name and first name; name becomes a stored function field."""
_inherit = 'res.partner'
firstname = fields.Char("First name")
lastname = fields.Char("Last name")
name = fields.Char(
compute="_compute_name",
inverse="_inverse_name_after_cleaning_whitespace",
required=False,
store=True)
@api.one
@api.depends("firstname", "lastname")
def _compute_name(self):
"""Write the 'name' field according to splitted data."""
self.name = u" ".join((p for p in (self.lastname,
self.firstname) if p))
@api.one
def _inverse_name_after_cleaning_whitespace(self):
"""Clean whitespace in :attr:`~.name` and split it.
Removes leading, trailing and duplicated whitespace.
The splitting logic is stored separately in :meth:`~._inverse_name`, so
submodules can extend that method and get whitespace cleaning for free.
"""
# Remove unneeded whitespace
clean = u" ".join(self.name.split(None)) if self.name else self.name
# Clean name avoiding infinite recursion
if self.name != clean:
self.name = clean
# Save name in the real fields
else:
self._inverse_name()
@api.one
def _inverse_name(self):
"""Try to revert the effect of :meth:`._compute_name`.
- If the partner is a company, save it in the lastname.
- Otherwise, make a guess.
This method can be easily overriden by other submodules.
When this method is called, :attr:`~.name` already has unified and
trimmed whitespace.
"""
# Company name goes to the lastname
if self.is_company or not self.name:
parts = [self.name or False, False]
# Guess name splitting
else:
parts = self.name.split(" ", 1)
while len(parts) < 2:
parts.append(False)
self.lastname, self.firstname = parts
@api.one
@api.constrains("firstname", "lastname")
def _check_name(self):
"""Ensure at least one name is set."""
if not (self.firstname or self.lastname):
raise exceptions.EmptyNamesError(self)
@api.one
@api.onchange("firstname", "lastname")
def _onchange_subnames(self):
"""Avoid recursion when the user changes one of these fields.
This forces to skip the :attr:`~.name` inversion when the user is
setting it in a not-inverted way.
"""
# Modify self's context without creating a new Environment.
# See https://github.com/odoo/odoo/issues/7472#issuecomment-119503916.
self.env.context = self.with_context(skip_onchange=True).env.context
@api.one
@api.onchange("name")
def _onchange_name(self):
"""Ensure :attr:`~.name` is inverted in the UI."""
if self.env.context.get("skip_onchange"):
# Do not skip next onchange
self.env.context = (
self.with_context(skip_onchange=False).env.context)
else:
self._inverse_name_after_cleaning_whitespace()
@api.model
def _install_partner_firstname(self):
"""Save names correctly in the database.
Before installing the module, field ``name`` contains all full names.
When installing it, this method parses those names and saves them
correctly into the database. This can be called later too if needed.
"""
# Find records with empty firstname and lastname
records = self.search([("firstname", "=", False),
("lastname", "=", False)])
# Force calculations there
records._inverse_name()
_logger.info("%d partners updated installing module.", len(records))

134
partner_firstname/partner.py

@ -1,134 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Copyright (C) 2014 Agile Business Group (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import orm, fields
from openerp.tools.translate import _
import logging
_logger = logging.getLogger(__name__)
class ResPartner(orm.Model):
"""Adds lastname and firstname, name become a stored function field"""
_inherit = 'res.partner'
def _set_default_value_on_column(self, cr, column_name, context=None):
res = super(ResPartner, self)._set_default_value_on_column(
cr, column_name, context=context)
if column_name == 'lastname':
cr.execute('UPDATE res_partner SET lastname = name WHERE name '
'IS NOT NULL AND lastname IS NULL')
cr.execute('ALTER TABLE res_partner ALTER COLUMN lastname '
'SET NOT NULL')
_logger.info("NOT NULL constraint for "
"res_partner.lastname correctly set")
return res
def _prepare_name_custom(self, cursor, uid, partner, context=None):
"""
This function is designed to be inherited in a custom module
"""
names = (partner.lastname, partner.firstname)
fullname = " ".join([s for s in names if s])
return fullname
def _compute_name_custom(self, cursor, uid, ids, fname, arg, context=None):
res = {}
for partner in self.browse(cursor, uid, ids, context=context):
res[partner.id] = self._prepare_name_custom(
cursor, uid, partner, context=context)
return res
def _write_name(
self, cursor, uid, partner_id, field_name, field_value, arg,
context=None
):
"""
Try to reverse the effect of _compute_name_custom:
* if the partner is not a company and the firstname does not change in
the new name then firstname remains untouched and lastname is updated
accordingly
* otherwise lastname=new name and firstname=False
In addition an heuristic avoids to keep a firstname without a non-blank
lastname
"""
field_value = (
field_value and not field_value.isspace() and field_value or False)
vals = {'lastname': field_value, 'firstname': False}
if field_value:
flds = self.read(
cursor, uid, [partner_id], ['firstname', 'is_company'],
context=context)[0]
if not flds['is_company']:
to_check = ' %s' % flds['firstname']
if field_value.endswith(to_check):
ln = field_value[:-len(to_check)].strip()
if ln:
vals['lastname'] = ln
del(vals['firstname'])
else:
# If the lastname is deleted from the new name
# then the firstname becomes the lastname
vals['lastname'] = flds['firstname']
return self.write(cursor, uid, partner_id, vals, context=context)
def copy_data(self, cr, uid, id, default=None, context=None):
"""
Avoid to replicate the firstname into the name when duplicating a
partner
"""
default = default or {}
if not default.get('lastname'):
default = default.copy()
default['lastname'] = (
_('%s (copy)') % self.read(
cr, uid, [id], ['lastname'], context=context
)[0]['lastname']
)
if default.get('name'):
del(default['name'])
return super(ResPartner, self).copy_data(
cr, uid, id, default, context=context)
def create(self, cursor, uid, vals, context=None):
"""
To support data backward compatibility we have to keep this overwrite
even if we use fnct_inv: otherwise we can't create entry because
lastname is mandatory and module will not install if there is demo data
"""
to_use = vals
if 'name' in vals:
corr_vals = vals.copy()
if vals.get('name'):
corr_vals['lastname'] = corr_vals['name']
del(corr_vals['name'])
to_use = corr_vals
return super(ResPartner, self).create(
cursor, uid, to_use, context=context)
_columns = {'name': fields.function(_compute_name_custom, string="Name",
type="char", store=True,
select=True, readonly=True,
fnct_inv=_write_name),
'firstname': fields.char("Firstname"),
'lastname': fields.char("Lastname", required=True)}

60
partner_firstname/partner_view.xml

@ -1,60 +0,0 @@
<openerp>
<data>
<record id="view_partner_simple_form_firstname" model="ir.ui.view">
<field name="name">res.partner.simplified.form.firstname</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_simple_form"/>
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="attrs">{'readonly': [('is_company', '=', False)], 'required': [('is_company', '=', True)]}</attribute>
</field>
<field name="category_id" position="before">
<group attrs="{'invisible': [('is_company', '=', True)]}">
<field name="lastname" attrs="{'required': [('is_company', '=', False)]}"/>
<field name="firstname" />
</group>
</field>
</field>
</record>
<record id="view_partner_form_firstname" model="ir.ui.view">
<field name="name">res.partner.form.firstname</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="name" position="attributes">
<attribute name="attrs">{'readonly': [('is_company', '=', False)], 'required': [('is_company', '=', True)]}</attribute>
</field>
<field name="category_id" position="before">
<group attrs="{'invisible': [('is_company', '=', True)]}">
<field name="lastname" attrs="{'required': [('is_company', '=', False)]}"/>
<field name="firstname"/>
</group>
</field>
<!-- Add firstname and last name in inner contact form of child_ids -->
<xpath expr="//field[@name='child_ids']/form//field[@name='category_id']" position="before">
<group attrs="{'invisible': [('is_company', '=', True)]}">
<field name="lastname" attrs="{'required': [('is_company', '=', False)]}"/>
<field name="firstname"/>
</group>
</xpath>
<xpath expr="//field[@name='child_ids']/form//field[@name='category_id']" position="attributes">
<attribute name="style"/>
</xpath>
<xpath expr="//field[@name='child_ids']/form//label[@for='name']" position="before">
<div class="oe_edit_only">
<field name="is_company"
on_change="onchange_type(is_company)"/>
<label for="is_company"
string="Is a Company?"/>
</div>
</xpath>
<xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="attributes">
<attribute name="attrs">{'readonly': [('is_company', '=', False)], 'required': [('is_company', '=', True)]}</attribute>
</xpath>
</field>
</record>
</data>
</openerp>

35
partner_firstname/res_user_view.xml

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Replace name with first name and last name -->
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form.firstname</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<label for="name" position="attributes">
<attribute name="invisible">1</attribute>
</label>
<label for="name" position="after">
<label for="firstname" class="oe_edit_only"/>
</label>
<field name="name" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="name" position="after">
<field name="firstname"/>
</field>
<label for="login" position="before">
<label for="lastname" class="oe_edit_only"/>
<h1><field name="lastname"/></h1>
</label>
</field>
</record>
</data>
</openerp>

2
partner_firstname/tests/__init__.py

@ -28,4 +28,4 @@
# #
############################################################################## ##############################################################################
from . import test_partner_firstname
from . import test_empty, test_name, test_onchange

96
partner_firstname/tests/base.py

@ -0,0 +1,96 @@
# -*- coding: utf-8 -*-
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs.
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contact a Free Software
# Service Company.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
from openerp.tests.common import TransactionCase
from .. import exceptions as ex
class MailInstalled():
def mail_installed(self):
"""Check if ``mail`` module is installed.``"""
return (self.env["ir.module.module"]
.search([("name", "=", "mail")])
.state == "installed")
class BaseCase(TransactionCase, MailInstalled):
def setUp(self):
super(BaseCase, self).setUp()
self.check_fields = True
self.expect(u"Núñez", u"Fernán")
self.create_original()
def create_original(self):
self.original = self.env["res.partner"].create({
"lastname": self.lastname,
"firstname": self.firstname})
def expect(self, lastname, firstname, name=None):
"""Define what is expected in each field when ending."""
self.lastname = lastname
self.firstname = firstname
self.name = name or u"%s %s" % (lastname, firstname)
def tearDown(self):
if self.check_fields:
if not hasattr(self, "changed"):
self.changed = self.original
for field in ("name", "lastname", "firstname"):
self.assertEqual(
getattr(self.changed, field),
getattr(self, field),
"Test failed with wrong %s" % field)
super(BaseCase, self).tearDown()
def test_copy(self):
"""Copy the partner and compare the result."""
self.expect(self.lastname, u"%s (copy)" % self.firstname)
self.changed = self.original.with_context(lang="en_US").copy()
def test_one_name(self):
"""Test what happens when only one name is given."""
name = u"Mönty"
self.expect(name, False, name)
self.original.name = name
def test_no_names(self):
"""Test that you cannot set a partner/user without names."""
self.check_fields = False
with self.assertRaises(ex.EmptyNamesError):
self.original.firstname = self.original.lastname = False
class OnChangeCase(TransactionCase):
is_company = False
def new_partner(self):
"""Create an empty partner. Ensure it is (or not) a company."""
new = self.env["res.partner"].new()
new.is_company = self.is_company
return new

68
partner_firstname/tests/test_empty.py

@ -0,0 +1,68 @@
# -*- encoding: utf-8 -*-
# Odoo, Open Source Management Solution
# Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Test situations where names are empty.
To have more accurate results, remove the ``mail`` module before testing.
"""
from openerp.tests.common import TransactionCase
from .base import MailInstalled
from .. import exceptions as ex
class CompanyCase(TransactionCase):
"""Test ``res.partner`` when it is a company."""
model = "res.partner"
context = {"default_is_company": True}
def tearDown(self):
try:
data = {"name": self.name}
with self.assertRaises(ex.EmptyNamesError):
self.env[self.model].with_context(**self.context).create(data)
finally:
super(CompanyCase, self).tearDown()
def test_name_empty_string(self):
"""Test what happens when the name is an empty string."""
self.name = ""
def test_name_false(self):
"""Test what happens when the name is ``False``."""
self.name = False
class PersonCase(CompanyCase):
"""Test ``res.partner`` when it is a person."""
context = {"default_is_company": False}
class UserCase(CompanyCase, MailInstalled):
"""Test ``res.users``."""
model = "res.users"
context = {"default_login": "user@example.com"}
def tearDown(self):
# Cannot create users if ``mail`` is installed
if self.mail_installed():
# Skip tests
super(CompanyCase, self).tearDown()
else:
# Run tests
super(UserCase, self).tearDown()

90
partner_firstname/tests/test_name.py

@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs.
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contact a Free Software
# Service Company.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Test naming logic.
To have more accurate results, remove the ``mail`` module before testing.
"""
from .base import BaseCase
class PartnerContactCase(BaseCase):
def test_update_lastname(self):
"""Change lastname."""
self.expect(u"newlästname", self.firstname)
self.original.name = self.name
def test_update_firstname(self):
"""Change firstname."""
self.expect(self.lastname, u"newfïrstname")
self.original.name = self.name
def test_whitespace_cleanup(self):
"""Check that whitespace in name gets cleared."""
self.expect(u"newlästname", u"newfïrstname")
self.original.name = " newlästname newfïrstname "
# Need this to refresh the ``name`` field
self.original.invalidate_cache()
class PartnerCompanyCase(BaseCase):
def create_original(self):
super(PartnerCompanyCase, self).create_original()
self.original.is_company = True
def test_copy(self):
"""Copy the partner and compare the result."""
super(PartnerCompanyCase, self).test_copy()
self.expect(self.name, False, self.name)
def test_company_inverse(self):
"""Test the inverse method in a company record."""
name = u"Thïs is a Companŷ"
self.expect(name, False, name)
self.original.name = name
class UserCase(PartnerContactCase):
def create_original(self):
name = u"%s %s" % (self.lastname, self.firstname)
# Cannot create users if ``mail`` is installed
if self.mail_installed():
self.original = self.env.ref("base.user_demo")
self.original.name = name
else:
self.original = self.env["res.users"].create({
"name": name,
"login": "firstnametest@example.com"})
def test_copy(self):
"""Copy the partner and compare the result."""
# Skip if ``mail`` is installed
if not self.mail_installed():
super(UserCase, self).test_copy()

102
partner_firstname/tests/test_onchange.py

@ -0,0 +1,102 @@
# -*- coding: utf-8 -*-
"""These tests try to mimic the behavior of the UI form.
The form operates in onchange mode, with its limitations.
"""
from .base import OnChangeCase
class PartnerCompanyCase(OnChangeCase):
is_company = True
def test_create_from_form(self):
"""A user creates a company from the form."""
name = u"Sôme company"
with self.env.do_in_onchange():
# User presses ``new``
partner = self.new_partner()
# User sets a name, which triggers onchanges
partner.name = name
partner._onchange_name()
self.assertEqual(partner.name, name)
self.assertEqual(partner.firstname, False)
self.assertEqual(partner.lastname, name)
def test_empty_name_and_subnames(self):
"""If the user empties ``name``, subnames must be ``False``.
Otherwise, the ``required`` attr will not work as expected.
"""
with self.env.do_in_onchange():
# User presses ``new``
partner = self.new_partner()
# User sets a name, which triggers onchanges
partner.name = u"Foó"
partner._onchange_name()
# User unsets name, which triggers onchanges
partner.name = u""
partner._onchange_name()
self.assertEqual(partner.firstname, False)
self.assertEqual(partner.lastname, False)
class PartnerContactCase(OnChangeCase):
def test_create_from_form_only_firstname(self):
"""A user creates a contact with only the firstname from the form."""
firstname = u"Fïrst"
with self.env.do_in_onchange():
# User presses ``new``
partner = self.new_partner()
# Changes firstname, which triggers onchanges
partner.firstname = firstname
partner._onchange_subnames()
partner._onchange_name()
self.assertEqual(partner.lastname, False)
self.assertEqual(partner.firstname, firstname)
self.assertEqual(partner.name, firstname)
def test_create_from_form_only_lastname(self):
"""A user creates a contact with only the lastname from the form."""
lastname = u"Läst"
with self.env.do_in_onchange():
# User presses ``new``
partner = self.new_partner()
# Changes lastname, which triggers onchanges
partner.lastname = lastname
partner._onchange_subnames()
partner._onchange_name()
self.assertEqual(partner.firstname, False)
self.assertEqual(partner.lastname, lastname)
self.assertEqual(partner.name, lastname)
def test_create_from_form_all(self):
"""A user creates a contact with all names from the form."""
firstname = u"Fïrst"
lastname = u"Läst"
with self.env.do_in_onchange():
# User presses ``new``
partner = self.new_partner()
# Changes firstname, which triggers onchanges
partner.firstname = firstname
partner._onchange_subnames()
partner._onchange_name()
# Changes lastname, which triggers onchanges
partner.lastname = lastname
partner._onchange_subnames()
partner._onchange_name()
self.assertEqual(partner.lastname, lastname)
self.assertEqual(partner.firstname, firstname)
self.assertEqual(partner.name, u" ".join((lastname, firstname)))

153
partner_firstname/tests/test_partner_firstname.py

@ -1,153 +0,0 @@
# -*- coding: utf-8 -*-
#
#
# Authors: Nemry Jonathan
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs.
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contact a Free Software
# Service Company.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
import openerp.tests.common as common
from openerp.tools.translate import _
class test_partner_firstname(common.TransactionCase):
def setUp(self):
super(test_partner_firstname, self).setUp()
self.registry('ir.model').clear_caches()
self.registry('ir.model.data').clear_caches()
self.user_model = self.registry("res.users")
self.partner_model = self.registry("res.partner")
self.fields_partner = {
'lastname': 'lastname', 'firstname': 'firstname'}
self.fields_user = {
'name': 'lastname', 'login': 'v5Ue4Tql0Pm67KX05g25A'}
self.context = self.user_model.context_get(self.cr, self.uid)
def test_copy_partner(self):
cr, uid, context = self.cr, self.uid, self.context
res_id = self.partner_model.create(
cr, uid, self.fields_partner, context=context)
res_id = self.partner_model.copy(
cr, uid, res_id, default={}, context=context)
vals = self.partner_model.read(cr, uid, [res_id], [
'name', 'lastname', 'firstname'], context=context)[0]
self.assertEqual(
vals['name'],
_('%s (copy)') % 'lastname' + " firstname",
'Copy of the partner failed with wrong name'
)
self.assertEqual(
vals['lastname'],
_('%s (copy)') % 'lastname',
'Copy of the partner failed with wrong lastname'
)
self.assertEqual(vals['firstname'], 'firstname',
'Copy of the partner failed with wrong firstname')
def test_copy_user(self):
cr, uid, context = self.cr, self.uid, self.context
# create a user
res_id = self.user_model.create(
cr, uid, self.fields_user, context=context)
# get the related partner id and add it a firstname
flds = self.user_model.read(
cr, uid, [res_id], ['partner_id'], context=context)[0]
self.partner_model.write(cr, uid, flds['partner_id'][
0], {'firstname': 'firstname'}, context=context)
# copy the user and compare result
res_id = self.user_model.copy(
cr, uid, res_id, default={}, context=context)
vals = self.user_model.read(
cr, uid, [res_id], ['name', 'lastname', 'firstname'],
context=context)[0]
self.assertEqual(
vals['name'],
_('%s (copy)') % 'lastname' + ' firstname',
'Copy of the user failed with wrong name'
)
self.assertEqual(
vals['lastname'], _('%s (copy)') %
'lastname', 'Copy of the user failed with wrong lastname')
self.assertEqual(vals['firstname'], 'firstname',
'Copy of the user failed with wrong firstname')
def test_update_user_lastname(self):
cr, uid, context = self.cr, self.uid, self.context
# create a user
res_id = self.user_model.create(
cr, uid, self.fields_user, context=context)
# get the related partner id and add it a firstname
flds = self.user_model.read(
cr, uid, [res_id], ['partner_id'], context=context)[0]
self.partner_model.write(
cr, uid, flds['partner_id'][0], {'firstname': 'firstname'},
context=context)
self.user_model.write(
cr, uid, res_id, {'name': 'change firstname'}, context=context)
vals = self.user_model.read(
cr, uid, [res_id], ['name', 'lastname', 'firstname'],
context=context)[0]
self.assertEqual(vals['name'], 'change firstname',
'Update of the user lastname failed with wrong name')
self.assertEqual(
vals['lastname'], 'change',
'Update of the user lastname failed with wrong lastname')
self.assertEqual(
vals['firstname'], 'firstname',
'Update of the user lastname failed with wrong firstname')
def test_update_user_firstname(self):
cr, uid, context = self.cr, self.uid, self.context
# create a user
res_id = self.user_model.create(
cr, uid, self.fields_user, context=context)
# get the related partner id and add it a firstname
flds = self.user_model.read(
cr, uid, [res_id], ['partner_id'], context=context)[0]
self.partner_model.write(
cr, uid, flds['partner_id'][0], {'firstname': 'firstname'},
context=context)
self.user_model.write(
cr, uid, res_id, {'name': 'lastname other'}, context=context)
vals = self.user_model.read(
cr, uid, [res_id], ['name', 'lastname', 'firstname'],
context=context)[0]
self.assertEqual(
vals['name'], 'lastname other',
'Update of the user firstname failed with wrong name')
self.assertEqual(
vals['lastname'], 'lastname other',
'Update of the user firstname failed with wrong lastname')
self.assertFalse(
vals['firstname'],
'Update of the user firstname failed with wrong firstname')

98
partner_firstname/views/res_partner.xml

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_partner_simple_form_firstname" model="ir.ui.view">
<field name="name">Add firstname and lastname</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_simple_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="attrs">{
'readonly': [('is_company', '=', False)],
'required': [('is_company', '=', True)]
}</attribute>
</xpath>
<xpath expr="//field[@name='category_id']" position="before">
<group attrs="{'invisible': [('is_company', '=', True)]}">
<field name="lastname" attrs=
"{'required': [('firstname', '=', False),
('is_company', '=', False)]}"/>
<field name="firstname" attrs=
"{'required': [('lastname', '=', False),
('is_company', '=', False)]}"/>
</group>
</xpath>
</data>
</field>
</record>
<record id="view_partner_form_firstname" model="ir.ui.view">
<field name="name">Add firstname and surnames</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="attrs">{
'readonly': [('is_company', '=', False)],
'required': [('is_company', '=', True)]
}</attribute>
</xpath>
<xpath expr="//field[@name='category_id']" position="before">
<group attrs="{'invisible': [('is_company', '=', True)]}">
<field name="lastname" attrs=
"{'required': [('firstname', '=', False),
('is_company', '=', False)]}"/>
<field name="firstname" attrs=
"{'required': [('lastname', '=', False),
('is_company', '=', False)]}"/>
</group>
</xpath>
<!-- Modify inner contact form of child_ids -->
<xpath expr="//field[@name='child_ids']/form
//field[@name='category_id']"
position="before">
<group attrs="{'invisible': [('is_company', '=', True)]}">
<field name="lastname" attrs=
"{'required': [('firstname', '=', False),
('is_company', '=', False)]}"/>
<field name="firstname" attrs=
"{'required': [('lastname', '=', False),
('is_company', '=', False)]}"/>
</group>
</xpath>
<xpath expr="//field[@name='child_ids']/form
//field[@name='category_id']"
position="attributes">
<attribute name="style"/>
</xpath>
<xpath expr="//field[@name='child_ids']/form//label[@for='name']"
position="before">
<div class="oe_edit_only">
<field name="is_company"
on_change="onchange_type(is_company)"/>
<label for="is_company"
string="Is a Company?"/>
</div>
</xpath>
<xpath expr="//field[@name='child_ids']/form//field[@name='name']"
position="attributes">
<attribute name="attrs">{
'readonly': [('is_company', '=', False)],
'required': [('is_company', '=', True)]
}</attribute>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

32
partner_firstname/views/res_user.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Required before modifying `base.vew_users_form`.
https://github.com/odoo/odoo/issues/6324#issuecomment-93534579 -->
<function model="res.groups" name="update_user_groups_view" />
<record id="view_users_form" model="ir.ui.view">
<field name="name">Add firstname and surnames</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="readonly">True</attribute>
</xpath>
<xpath expr="//field[@name='email']" position="after">
<group>
<field name="lastname"
attrs="{'required': [('firstname', '=', False)]}"/>
<field name="firstname"
attrs="{'required': [('lastname', '=', False)]}"/>
</group>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save