Browse Source

Merge pull request #329 from Tecnativa/9.0-mig-partner_sector

9.0 [MIG] partner_sector migration
pull/342/head
Rafael Blasco 8 years ago
committed by GitHub
parent
commit
6097d28951
  1. 71
      partner_sector/README.rst
  2. 6
      partner_sector/__init__.py
  3. 24
      partner_sector/__openerp__.py
  4. 0
      partner_sector/i18n/.gitkeep
  5. 109
      partner_sector/i18n/de.po
  6. 119
      partner_sector/i18n/es.po
  7. 108
      partner_sector/i18n/fi.po
  8. 119
      partner_sector/i18n/fr.po
  9. 109
      partner_sector/i18n/it.po
  10. 106
      partner_sector/i18n/partner_sector.pot
  11. 119
      partner_sector/i18n/sl.po
  12. 7
      partner_sector/models/__init__.py
  13. 23
      partner_sector/models/res_partner.py
  14. 35
      partner_sector/models/res_partner_sector.py
  15. 5
      partner_sector/security/ir.model.access.csv
  16. BIN
      partner_sector/static/description/icon.png
  17. 6
      partner_sector/tests/__init__.py
  18. 17
      partner_sector/tests/test_res_partner.py
  19. 30
      partner_sector/views/res_partner_sector_view.xml
  20. 53
      partner_sector/views/res_partner_view.xml

71
partner_sector/README.rst

@ -0,0 +1,71 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==============
Partner Sector
==============
This module adds the concept of economic sector for partners.
Configuration
=============
To manage sectors, you need to:
* Go to *Sales > Configuration > Address Book > Sectors*.
Usage
=====
To use this module, you need to:
* Go to any partner's form.
Only companies have sectors.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/9.0
Known issues / Roadmap
======================
* Add a unique constraint for name per parent sector.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
In case of trouble, please check there if your issue has already been reported. If you
spotted it first, help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Rafael Blasco <rafabn@antiun.com>
* Antonio Espinosa <antonioea@antiun.com>
* Javier Iniesta <javieria@antiun.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>
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.

6
partner_sector/__init__.py

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingenieria S.L. - Antonio Espinosa
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

24
partner_sector/__openerp__.py

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Partner Sector",
"summary": "Add partner sectors",
"version": "9.0.1.0.0",
"category": "Customer Relationship Management",
"website": "http://www.tecnativa.com",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"base",
],
"data": [
"security/ir.model.access.csv",
"views/res_partner_sector_view.xml",
"views/res_partner_view.xml",
]
}

0
partner_sector/i18n/.gitkeep

109
partner_sector/i18n/de.po

@ -0,0 +1,109 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_sector
#
# Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2016
msgid ""
msgstr ""
"Project-Id-Version: partner-contact (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-19 01:46+0000\n"
"PO-Revision-Date: 2016-01-18 16:40+0000\n"
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
"Language-Team: German (http://www.transifex.com/oca/OCA-partner-contact-8-0/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: partner_sector
#: field:res.partner.sector,child_ids:0
msgid "Children"
msgstr "Untergeordnete"
#. module: partner_sector
#: field:res.partner.sector,create_uid:0
msgid "Created by"
msgstr "Angelegt durch"
#. module: partner_sector
#: field:res.partner.sector,create_date:0
msgid "Created on"
msgstr "Angelegt am"
#. module: partner_sector
#: field:res.partner.sector,id:0
msgid "ID"
msgstr "ID"
#. module: partner_sector
#: field:res.partner.sector,write_uid:0
msgid "Last Updated by"
msgstr "Zuletzt aktualisiert durch"
#. module: partner_sector
#: field:res.partner.sector,write_date:0
msgid "Last Updated on"
msgstr "Zuletzt aktualisiert am"
#. module: partner_sector
#: field:res.partner,sector_id:0
msgid "Main Sector"
msgstr "Hauptsektor"
#. module: partner_sector
#: field:res.partner.sector,name:0
msgid "Name"
msgstr "Bezeichnung"
#. module: partner_sector
#: field:res.partner.sector,parent_left:0
msgid "Parent Left"
msgstr "Links übergeordnet"
#. module: partner_sector
#: field:res.partner.sector,parent_right:0
msgid "Parent Right"
msgstr "rechts übergeordnet"
#. module: partner_sector
#: field:res.partner.sector,parent_id:0
msgid "Parent id"
msgstr "ID Übergeordneter"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: partner_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Salesperson"
msgstr "Verkäufer"
#. module: partner_sector
#: field:res.partner,secondary_sector_ids:0
msgid "Secondary Sectors"
msgstr "Nachrangige Sektoren"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner_sector
#: view:res.partner:partner_sector.view_partner_form_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Sector"
msgstr "Sektor"
#. module: partner_sector
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view
msgid "Sectors"
msgstr "Sektoren"
#. module: partner_sector
#: code:addons/partner_sector/models/res_partner.py:21
#, python-format
msgid "The main sector must be different from the secondary sectors."
msgstr "Der Hauptsektor muss sich von den Sekundären unterscheiden."

119
partner_sector/i18n/es.po

@ -0,0 +1,119 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_sector
#
# Translators:
# Oihane Crucelaegui <oihanecruce@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: partner-contact (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-25 11:58+0000\n"
"PO-Revision-Date: 2016-07-14 09:04+0000\n"
"Last-Translator: Oihane Crucelaegui <oihanecruce@gmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-partner-contact-8-0/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: partner_sector
#: field:res.partner.sector,child_ids:0
msgid "Children"
msgstr "Hijos"
#. module: partner_sector
#: field:res.partner.sector,create_uid:0
msgid "Created by"
msgstr "Creado por"
#. module: partner_sector
#: field:res.partner.sector,create_date:0
msgid "Created on"
msgstr "Creado en"
#. module: partner_sector
#: field:res.partner.sector,display_name:0
msgid "Display Name"
msgstr "Nombre mostrado"
#. module: partner_sector
#: field:res.partner.sector,id:0
msgid "ID"
msgstr "ID"
#. module: partner_sector
#: field:res.partner.sector,__last_update:0
msgid "Last Modified on"
msgstr "Última modificación el"
#. module: partner_sector
#: field:res.partner.sector,write_uid:0
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: partner_sector
#: field:res.partner.sector,write_date:0
msgid "Last Updated on"
msgstr "Última actualización en"
#. module: partner_sector
#: field:res.partner,sector_id:0
msgid "Main Sector"
msgstr "Sector principal"
#. module: partner_sector
#: field:res.partner.sector,name:0
msgid "Name"
msgstr "Nombre"
#. module: partner_sector
#: field:res.partner.sector,parent_left:0
msgid "Parent Left"
msgstr "Padre izquierdo"
#. module: partner_sector
#: field:res.partner.sector,parent_right:0
msgid "Parent Right"
msgstr "Padre derecho"
#. module: partner_sector
#: field:res.partner.sector,parent_id:0
msgid "Parent id"
msgstr "ID del padre"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner
msgid "Partner"
msgstr "Empresa"
#. module: partner_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Salesperson"
msgstr "Comercial"
#. module: partner_sector
#: field:res.partner,secondary_sector_ids:0
msgid "Secondary Sectors"
msgstr "Sectores secundarios"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner_sector
#: view:res.partner:partner_sector.view_partner_form_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Sector"
msgstr "Sector"
#. module: partner_sector
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view
msgid "Sectors"
msgstr "Sectores"
#. module: partner_sector
#: code:addons/partner_sector/models/res_partner.py:21
#, python-format
msgid "The main sector must be different from the secondary sectors."
msgstr "El sector principal debe ser diferente a los sectores secundarios."

108
partner_sector/i18n/fi.po

@ -0,0 +1,108 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_sector
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: partner-contact (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-19 01:46+0000\n"
"PO-Revision-Date: 2015-12-18 17:07+0000\n"
"Last-Translator: <>\n"
"Language-Team: Finnish (http://www.transifex.com/oca/OCA-partner-contact-8-0/language/fi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: partner_sector
#: field:res.partner.sector,child_ids:0
msgid "Children"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,create_uid:0
msgid "Created by"
msgstr "Luonut"
#. module: partner_sector
#: field:res.partner.sector,create_date:0
msgid "Created on"
msgstr "Luotu"
#. module: partner_sector
#: field:res.partner.sector,id:0
msgid "ID"
msgstr "ID"
#. module: partner_sector
#: field:res.partner.sector,write_uid:0
msgid "Last Updated by"
msgstr "Viimeksi päivitetty"
#. module: partner_sector
#: field:res.partner.sector,write_date:0
msgid "Last Updated on"
msgstr "Viimeksi päivittänyt"
#. module: partner_sector
#: field:res.partner,sector_id:0
msgid "Main Sector"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,name:0
msgid "Name"
msgstr "Nimi"
#. module: partner_sector
#: field:res.partner.sector,parent_left:0
msgid "Parent Left"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,parent_right:0
msgid "Parent Right"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,parent_id:0
msgid "Parent id"
msgstr ""
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner
msgid "Partner"
msgstr "Kumppani"
#. module: partner_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Salesperson"
msgstr "Myyjä"
#. module: partner_sector
#: field:res.partner,secondary_sector_ids:0
msgid "Secondary Sectors"
msgstr ""
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner_sector
#: view:res.partner:partner_sector.view_partner_form_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Sector"
msgstr ""
#. module: partner_sector
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view
msgid "Sectors"
msgstr ""
#. module: partner_sector
#: code:addons/partner_sector/models/res_partner.py:21
#, python-format
msgid "The main sector must be different from the secondary sectors."
msgstr ""

119
partner_sector/i18n/fr.po

@ -0,0 +1,119 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_sector
#
# Translators:
# Fabien Bourgeois <fabien@yaltik.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: partner-contact (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-08 05:15+0000\n"
"PO-Revision-Date: 2016-05-14 04:10+0000\n"
"Last-Translator: Fabien Bourgeois <fabien@yaltik.com>\n"
"Language-Team: French (http://www.transifex.com/oca/OCA-partner-contact-8-0/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: partner_sector
#: field:res.partner.sector,child_ids:0
msgid "Children"
msgstr "Enfant"
#. module: partner_sector
#: field:res.partner.sector,create_uid:0
msgid "Created by"
msgstr "Créé par"
#. module: partner_sector
#: field:res.partner.sector,create_date:0
msgid "Created on"
msgstr "Créé le"
#. module: partner_sector
#: field:res.partner.sector,display_name:0
msgid "Display Name"
msgstr "Nom affiché"
#. module: partner_sector
#: field:res.partner.sector,id:0
msgid "ID"
msgstr "ID"
#. module: partner_sector
#: field:res.partner.sector,__last_update:0
msgid "Last Modified on"
msgstr "Modifié le"
#. module: partner_sector
#: field:res.partner.sector,write_uid:0
msgid "Last Updated by"
msgstr "Mis à jour par"
#. module: partner_sector
#: field:res.partner.sector,write_date:0
msgid "Last Updated on"
msgstr "Mis à jour le"
#. module: partner_sector
#: field:res.partner,sector_id:0
msgid "Main Sector"
msgstr "Secteur d'activité principal"
#. module: partner_sector
#: field:res.partner.sector,name:0
msgid "Name"
msgstr "Nom"
#. module: partner_sector
#: field:res.partner.sector,parent_left:0
msgid "Parent Left"
msgstr "Parent gauche"
#. module: partner_sector
#: field:res.partner.sector,parent_right:0
msgid "Parent Right"
msgstr "Parent droit"
#. module: partner_sector
#: field:res.partner.sector,parent_id:0
msgid "Parent id"
msgstr "ID du parent"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner
msgid "Partner"
msgstr "Contact"
#. module: partner_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Salesperson"
msgstr "Commercial"
#. module: partner_sector
#: field:res.partner,secondary_sector_ids:0
msgid "Secondary Sectors"
msgstr "Secteurs d'activité secondaires"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner_sector
#: view:res.partner:partner_sector.view_partner_form_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Sector"
msgstr "Secteur d'activité"
#. module: partner_sector
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view
msgid "Sectors"
msgstr "Secteurs d'activité"
#. module: partner_sector
#: code:addons/partner_sector/models/res_partner.py:21
#, python-format
msgid "The main sector must be different from the secondary sectors."
msgstr "Le secteur d'activité principal doit être différent des secteurs d'activité secondaires."

109
partner_sector/i18n/it.po

@ -0,0 +1,109 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_sector
#
# Translators:
# Paolo Valier, 2016
msgid ""
msgstr ""
"Project-Id-Version: partner-contact (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-13 00:57+0000\n"
"PO-Revision-Date: 2016-03-13 17:22+0000\n"
"Last-Translator: Paolo Valier\n"
"Language-Team: Italian (http://www.transifex.com/oca/OCA-partner-contact-8-0/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: partner_sector
#: field:res.partner.sector,child_ids:0
msgid "Children"
msgstr "Figlio"
#. module: partner_sector
#: field:res.partner.sector,create_uid:0
msgid "Created by"
msgstr "Creato da"
#. module: partner_sector
#: field:res.partner.sector,create_date:0
msgid "Created on"
msgstr "Creato il"
#. module: partner_sector
#: field:res.partner.sector,id:0
msgid "ID"
msgstr "ID"
#. module: partner_sector
#: field:res.partner.sector,write_uid:0
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"
#. module: partner_sector
#: field:res.partner.sector,write_date:0
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"
#. module: partner_sector
#: field:res.partner,sector_id:0
msgid "Main Sector"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,name:0
msgid "Name"
msgstr "Nome"
#. module: partner_sector
#: field:res.partner.sector,parent_left:0
msgid "Parent Left"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,parent_right:0
msgid "Parent Right"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,parent_id:0
msgid "Parent id"
msgstr ""
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: partner_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Salesperson"
msgstr ""
#. module: partner_sector
#: field:res.partner,secondary_sector_ids:0
msgid "Secondary Sectors"
msgstr ""
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner_sector
#: view:res.partner:partner_sector.view_partner_form_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Sector"
msgstr ""
#. module: partner_sector
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view
msgid "Sectors"
msgstr ""
#. module: partner_sector
#: code:addons/partner_sector/models/res_partner.py:21
#, python-format
msgid "The main sector must be different from the secondary sectors."
msgstr ""

106
partner_sector/i18n/partner_sector.pot

@ -0,0 +1,106 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_sector
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-12-17 13:49+0000\n"
"PO-Revision-Date: 2015-12-17 13:49+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_sector
#: field:res.partner.sector,child_ids:0
msgid "Children"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,create_uid:0
msgid "Created by"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,create_date:0
msgid "Created on"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,id:0
msgid "ID"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: partner_sector
#: field:res.partner,sector_id:0
msgid "Main Sector"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,name:0
msgid "Name"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,parent_left:0
msgid "Parent Left"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,parent_right:0
msgid "Parent Right"
msgstr ""
#. module: partner_sector
#: field:res.partner.sector,parent_id:0
msgid "Parent id"
msgstr ""
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner
msgid "Partner"
msgstr ""
#. module: partner_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Salesperson"
msgstr ""
#. module: partner_sector
#: field:res.partner,secondary_sector_ids:0
msgid "Secondary Sectors"
msgstr ""
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner_sector
#: view:res.partner:partner_sector.view_partner_form_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Sector"
msgstr ""
#. module: partner_sector
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view
msgid "Sectors"
msgstr ""
#. module: partner_sector
#: code:addons/partner_sector/models/res_partner.py:21
#, python-format
msgid "The main sector must be different from the secondary sectors."
msgstr ""

119
partner_sector/i18n/sl.po

@ -0,0 +1,119 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_sector
#
# Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015-2016
msgid ""
msgstr ""
"Project-Id-Version: partner-contact (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-07 07:18+0000\n"
"PO-Revision-Date: 2016-05-07 07:16+0000\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-partner-contact-8-0/language/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
#. module: partner_sector
#: field:res.partner.sector,child_ids:0
msgid "Children"
msgstr "Podrejeni"
#. module: partner_sector
#: field:res.partner.sector,create_uid:0
msgid "Created by"
msgstr "Ustvaril"
#. module: partner_sector
#: field:res.partner.sector,create_date:0
msgid "Created on"
msgstr "Ustvarjeno"
#. module: partner_sector
#: field:res.partner.sector,display_name:0
msgid "Display Name"
msgstr "Prikazni naziv"
#. module: partner_sector
#: field:res.partner.sector,id:0
msgid "ID"
msgstr "ID"
#. module: partner_sector
#: field:res.partner.sector,__last_update:0
msgid "Last Modified on"
msgstr "Zadnjič spremenjeno"
#. module: partner_sector
#: field:res.partner.sector,write_uid:0
msgid "Last Updated by"
msgstr "Zadnji posodobil"
#. module: partner_sector
#: field:res.partner.sector,write_date:0
msgid "Last Updated on"
msgstr "Zadnjič posodobljeno"
#. module: partner_sector
#: field:res.partner,sector_id:0
msgid "Main Sector"
msgstr "Glavni sektor"
#. module: partner_sector
#: field:res.partner.sector,name:0
msgid "Name"
msgstr "Naziv"
#. module: partner_sector
#: field:res.partner.sector,parent_left:0
msgid "Parent Left"
msgstr "Levo nadrejeni"
#. module: partner_sector
#: field:res.partner.sector,parent_right:0
msgid "Parent Right"
msgstr "Desno nadrejeni"
#. module: partner_sector
#: field:res.partner.sector,parent_id:0
msgid "Parent id"
msgstr "ID nadrejenega"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: partner_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Salesperson"
msgstr "Prodajalec"
#. module: partner_sector
#: field:res.partner,secondary_sector_ids:0
msgid "Secondary Sectors"
msgstr "Sekundarni sektorji"
#. module: partner_sector
#: model:ir.model,name:partner_sector.model_res_partner_sector
#: view:res.partner:partner_sector.view_partner_form_sector
#: view:res.partner:partner_sector.view_res_partner_filter_sector
msgid "Sector"
msgstr "Sektor"
#. module: partner_sector
#: model:ir.actions.act_window,name:partner_sector.res_partner_sector_action
#: model:ir.ui.menu,name:partner_sector.menu_res_partner_sector
#: view:res.partner.sector:partner_sector.res_partner_sector_tree_view
msgid "Sectors"
msgstr "Sektorji"
#. module: partner_sector
#: code:addons/partner_sector/models/res_partner.py:21
#, python-format
msgid "The main sector must be different from the secondary sectors."
msgstr "Glavni sektor mora biti drugačen od sekundarnih sektorjev."

7
partner_sector/models/__init__.py

@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import res_partner
from . import res_partner_sector

23
partner_sector/models/res_partner.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, exceptions, _
class ResPartner(models.Model):
_inherit = 'res.partner'
sector_id = fields.Many2one(comodel_name='res.partner.sector',
string='Main Sector')
secondary_sector_ids = fields.Many2many(
comodel_name='res.partner.sector', string="Secondary Sectors",
domain="[('id', '!=', sector_id)]")
@api.constrains('sector_id', 'secondary_sector_ids')
def _check_sectors(self):
if self.sector_id in self.secondary_sector_ids:
raise exceptions.Warning(_('The main sector must be different '
'from the secondary sectors.'))

35
partner_sector/models/res_partner_sector.py

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class ResPartnerSector(models.Model):
_name = 'res.partner.sector'
_order = "parent_left"
_parent_order = "name"
_parent_store = True
_description = "Sector"
name = fields.Char(required=True, translate=True)
parent_id = fields.Many2one(comodel_name='res.partner.sector',
ondelete='restrict')
child_ids = fields.One2many(comodel_name='res.partner.sector',
inverse_name='parent_id',
string="Children")
parent_left = fields.Integer('Parent Left', select=True)
parent_right = fields.Integer('Parent Right', select=True)
@api.multi
def name_get(self):
def get_names(cat):
""" Return the list [cat.name, cat.parent_id.name, ...] """
res = []
while cat:
res.append(cat.name)
cat = cat.parent_id
return res
return [(cat.id, " / ".join(reversed(get_names(cat)))) for cat in self]

5
partner_sector/security/ir.model.access.csv

@ -0,0 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_res_partner_sector_public","res_partner_sector group_public","model_res_partner_sector","base.group_public",1,0,0,0
"access_res_partner_sector_portal","res_partner_sector group_portal","model_res_partner_sector","base.group_portal",1,0,0,0
"access_res_partner_sector_group_partner_manager","res_partner_sector group_partner_manager","model_res_partner_sector","base.group_partner_manager",1,1,1,1
"access_res_partner_sector_group_user","res_partner_sector group_user","model_res_partner_sector","base.group_user",1,0,0,0

BIN
partner_sector/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

6
partner_sector/tests/__init__.py

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_res_partner

17
partner_sector/tests/test_res_partner.py

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError
class TestResPartner(TransactionCase):
def test_check_sectors(self):
sector = self.env['res.partner.sector'].create({'name': 'Test'})
with self.assertRaises(ValidationError):
self.env['res.partner'].create(
{'name': 'Test', 'sector_id': sector.id,
'secondary_sector_ids': [(4, sector.id)]})

30
partner_sector/views/res_partner_sector_view.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Antiun Ingenieria S.L. - Javier Iniesta
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>
<record id="res_partner_sector_action" model="ir.actions.act_window">
<field name="name">Sectors</field>
<field name="res_model">res.partner.sector</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<record id="res_partner_sector_tree_view" model="ir.ui.view">
<field name="name">Partner Sector tree</field>
<field name="model">res.partner.sector</field>
<field name="arch" type="xml">
<tree string="Sectors" editable="top">
<field name="name"/>
<field name="parent_id"/>
</tree>
</field>
</record>
<menuitem action="res_partner_sector_action"
id="menu_res_partner_sector"
name="Sectors"
parent="base.menu_config_address_book"
sequence="3"/>
</odoo>

53
partner_sector/views/res_partner_view.xml

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Antiun Ingenieria S.L. - Javier Iniesta
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>
<record model="ir.ui.view" id="view_partner_form_sector">
<field name="name">Partner form with sector</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="phone" position="before">
<field name="sector_id" placeholder="Sector"
options='{"no_open": True}'
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="secondary_sector_ids" widget="many2many_tags"
attrs="{'invisible': [('is_company', '=', False)]}"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_partner_tree_sector">
<field name="name">Partner tree with sector</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<field name="email" position="after">
<field name="sector_id"
attrs="{'invisible': [('is_company', '=', False)]}"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_res_partner_filter_sector">
<field name="name">Partner search with sector</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<field name="category_id" position="after">
<field name="sector_id"
string="Sector"
filter_domain="['|',('sector_id','ilike',self),
('secondary_sector_ids','ilike',self)]"/>
</field>
<filter name="salesperson" position="after">
<filter name="sector"
string="Sector"
domain="[('is_company','=', True)]"
context="{'group_by': 'sector_id'}"/>
</filter>
</field>
</record>
</odoo>
Loading…
Cancel
Save