diff --git a/partner_contact_lang/README.rst b/partner_contact_lang/README.rst index 8cb277477..f4a130f7a 100644 --- a/partner_contact_lang/README.rst +++ b/partner_contact_lang/README.rst @@ -11,16 +11,16 @@ Manage language in contacts :target: https://odoo-community.org/page/development-status :alt: Beta .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github - :target: https://github.com/OCA/partner-contact/tree/11.0/partner_contact_lang + :target: https://github.com/OCA/partner-contact/tree/13.0/partner_contact_lang :alt: OCA/partner-contact .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/partner-contact-11-0/partner-contact-11-0-partner_contact_lang + :target: https://translation.odoo-community.org/projects/partner-contact-13-0/partner-contact-13-0-partner_contact_lang :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/134/11.0 + :target: https://runbot.odoo-community.org/runbot/134/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -35,6 +35,9 @@ contact language management: language and this parent company is assigned. #. When the company changes the language, it fills with the same language all the contacts that don't have any. +#. Show the language in the inner narrowed Contact form and +set the new conctact with a different language if needed. +#. Search and also group contacts by their language. **Table of contents** @@ -53,7 +56,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -74,6 +77,7 @@ Contributors * Vicent Cubells * David Vidal * Cristina Martín + * Pedro Evaristo Gonzalez Sanchez Maintainers ~~~~~~~~~~~ @@ -88,6 +92,6 @@ 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. -This module is part of the `OCA/partner-contact `_ project on GitHub. +This module is part of the `OCA/partner-contact `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_contact_lang/__init__.py b/partner_contact_lang/__init__.py index 83e553ac4..4b76c7b2d 100644 --- a/partner_contact_lang/__init__.py +++ b/partner_contact_lang/__init__.py @@ -1,3 +1,3 @@ -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models diff --git a/partner_contact_lang/__manifest__.py b/partner_contact_lang/__manifest__.py index a6d474e48..1f5bd4658 100644 --- a/partner_contact_lang/__manifest__.py +++ b/partner_contact_lang/__manifest__.py @@ -1,14 +1,16 @@ # Copyright 2016 Tecnativa - Pedro M. Baeza # Copyright 2017 Tecnativa - Vicent Cubells -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# Copyright 2020 Pesol - Pedro Evaristo Gonzalez Sanchez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Manage language in contacts", - "version": "11.0.1.0.0", + "version": "13.0.1.0.0", "category": "Sales", "license": "AGPL-3", "author": "Tecnativa," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/partner-contact/", - "depends": ["base",], + "depends": ["base"], + "data": ["views/res_partner_view.xml"], "installable": True, } diff --git a/partner_contact_lang/i18n/partner_contact_lang.pot b/partner_contact_lang/i18n/partner_contact_lang.pot index 347a703d4..a0d074996 100644 --- a/partner_contact_lang/i18n/partner_contact_lang.pot +++ b/partner_contact_lang/i18n/partner_contact_lang.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" diff --git a/partner_contact_lang/models/__init__.py b/partner_contact_lang/models/__init__.py index ccebc7247..284a83ff1 100644 --- a/partner_contact_lang/models/__init__.py +++ b/partner_contact_lang/models/__init__.py @@ -1,3 +1,3 @@ -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import res_partner diff --git a/partner_contact_lang/models/res_partner.py b/partner_contact_lang/models/res_partner.py index e802b323f..0d82d9e75 100644 --- a/partner_contact_lang/models/res_partner.py +++ b/partner_contact_lang/models/res_partner.py @@ -1,6 +1,6 @@ # Copyright 2016 Tecnativa - Pedro M. Baeza # Copyright 2017 Tecnativa - Vicent Cubells -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models @@ -8,12 +8,11 @@ from odoo import api, models class ResPartner(models.Model): _inherit = "res.partner" - @api.multi def write(self, vals): """Propagate a language change in the partner to the child contacts.""" res = super(ResPartner, self).write(vals) if vals.get("lang"): - childs = self.search([("id", "child_of", self.ids), ("lang", "=", False),]) + childs = self.search([("id", "child_of", self.ids), ("lang", "=", False)]) if childs: childs.write({"lang": vals["lang"]}) return res @@ -23,7 +22,11 @@ class ResPartner(models.Model): """Change language if the parent company changes and there's no language defined yet""" res = super(ResPartner, self).onchange_parent_id() - if self.parent_id and self.parent_id != self and not self.lang: - val = res.setdefault("value", {}) - val["lang"] = self.parent_id.lang + if ( + self.parent_id + and self.parent_id != self + and not self.lang + and self.parent_id.lang + ): + self.lang = self.parent_id.lang return res diff --git a/partner_contact_lang/readme/CONTRIBUTORS.rst b/partner_contact_lang/readme/CONTRIBUTORS.rst index 0e92fb96a..f022bc6f4 100644 --- a/partner_contact_lang/readme/CONTRIBUTORS.rst +++ b/partner_contact_lang/readme/CONTRIBUTORS.rst @@ -4,3 +4,4 @@ * Vicent Cubells * David Vidal * Cristina Martín + * Pedro Evaristo Gonzalez Sanchez diff --git a/partner_contact_lang/readme/DESCRIPTION.rst b/partner_contact_lang/readme/DESCRIPTION.rst index 3a5199e90..85d1e6d78 100644 --- a/partner_contact_lang/readme/DESCRIPTION.rst +++ b/partner_contact_lang/readme/DESCRIPTION.rst @@ -8,3 +8,6 @@ contact language management: language and this parent company is assigned. #. When the company changes the language, it fills with the same language all the contacts that don't have any. +#. Show the language in the inner narrowed Contact form and +set the new conctact with a different language if needed. +#. Search and also group contacts by their language. diff --git a/partner_contact_lang/static/description/index.html b/partner_contact_lang/static/description/index.html index 084ac1905..9c93f6f3e 100644 --- a/partner_contact_lang/static/description/index.html +++ b/partner_contact_lang/static/description/index.html @@ -1,9 +1,9 @@ - - + + - + Manage language in contacts