Luis M. Ontalba
6 years ago
11 changed files with 220 additions and 145 deletions
-
68partner_academic_title/README.rst
-
13partner_academic_title/__manifest__.py
-
6partner_academic_title/data/partner_academic_title_data.xml
-
11partner_academic_title/models/partner_academic_title.py
-
27partner_academic_title/models/res_partner.py
-
4partner_academic_title/readme/CONTRIBUTORS.rst
-
3partner_academic_title/readme/DESCRIPTION.rst
-
1partner_academic_title/tests/__init__.py
-
29partner_academic_title/tests/test_partner_academic_title.py
-
12partner_academic_title/views/partner_academic_title_view.xml
-
13partner_academic_title/views/res_partner_view.xml
@ -1,34 +1,78 @@ |
|||
.. 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 Academic Title |
|||
====================== |
|||
|
|||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
!! This file is generated by oca-gen-addon-readme !! |
|||
!! changes will be overwritten. !! |
|||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
|
|||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png |
|||
: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 |
|||
: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_academic_title |
|||
: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_academic_title |
|||
: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 |
|||
:alt: Try me on Runbot |
|||
|
|||
|badge1| |badge2| |badge3| |badge4| |badge5| |
|||
|
|||
This module was written to adds possibility to define some academic titles and |
|||
to add multiple titles on partners. there is a sequence on titles to display |
|||
them in an order on the partner. |
|||
|
|||
**Table of contents** |
|||
|
|||
.. contents:: |
|||
:local: |
|||
|
|||
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 <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_academic_title%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
Do not contact contributors directly about support or help with technical issues. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Authors |
|||
~~~~~~~ |
|||
|
|||
* ACSONE SA/NV |
|||
|
|||
Contributors |
|||
------------ |
|||
~~~~~~~~~~~~ |
|||
|
|||
* Stéphane Bidoul <stephane.bidoul@acsone.eu> |
|||
* Adrien Peiffer <adrien.peiffer@acsone.eu> |
|||
* Meyomesse Gilles <meyomesse.gilles@gmail.com> |
|||
* Luis M. Ontalba <luismaront@gmail.com> |
|||
|
|||
Maintainers |
|||
~~~~~~~~~~~ |
|||
|
|||
Maintainer |
|||
---------- |
|||
This module is maintained by the OCA. |
|||
|
|||
.. image:: http://odoo-community.org/logo.png |
|||
.. image:: https://odoo-community.org/logo.png |
|||
:alt: Odoo Community Association |
|||
:target: http://odoo-community.org |
|||
: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. |
|||
|
|||
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 <https://github.com/OCA/partner-contact/tree/11.0/partner_academic_title>`_ project on GitHub. |
|||
|
|||
To contribute to this module, please visit http://odoo-community.org. |
|||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
@ -0,0 +1,4 @@ |
|||
* Stéphane Bidoul <stephane.bidoul@acsone.eu> |
|||
* Adrien Peiffer <adrien.peiffer@acsone.eu> |
|||
* Meyomesse Gilles <meyomesse.gilles@gmail.com> |
|||
* Luis M. Ontalba <luismaront@gmail.com> |
@ -0,0 +1,3 @@ |
|||
This module was written to adds possibility to define some academic titles and |
|||
to add multiple titles on partners. there is a sequence on titles to display |
|||
them in an order on the partner. |
@ -0,0 +1 @@ |
|||
from . import test_partner_academic_title |
@ -0,0 +1,29 @@ |
|||
# Copyright 2019 Luis M. Ontalba <luismaront@gmail.com> |
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) |
|||
|
|||
from odoo.tests import common |
|||
|
|||
|
|||
class TestPartnerAcademicTitle(common.SavepointCase): |
|||
@classmethod |
|||
def setUpClass(cls): |
|||
super(TestPartnerAcademicTitle, cls).setUpClass() |
|||
cls.partner_ac_tit_A = cls.env['partner.academic.title'].create({ |
|||
'name': 'A', |
|||
'sequence': 2, |
|||
}) |
|||
cls.partner_ac_tit_B = cls.env['partner.academic.title'].create({ |
|||
'name': 'B', |
|||
'sequence': 1, |
|||
}) |
|||
cls.partner = cls.env['res.partner'].create({ |
|||
'name': 'Test partner', |
|||
}) |
|||
|
|||
def test_compute_academic_title_display(self): |
|||
partner = self.partner |
|||
partner.academic_title_ids = [ |
|||
(4, self.partner_ac_tit_A.id, 0), |
|||
(4, self.partner_ac_tit_B.id, 0), |
|||
] |
|||
self.assertEqual(partner.academic_title_display, "B, A") |
@ -1,18 +1,21 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2015-2017 ACSONE SA/NV |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> |
|||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
|||
<odoo> |
|||
<data> |
|||
<record id="view_partner_form" model="ir.ui.view"> |
|||
<field name="name">res.partner.form (partner_academic_title)</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='title']" position="after"> |
|||
<field name="academic_title_ids" class="oe_edit_only" widget="many2many_tags" placeholder="Academic Titles" attrs="{'invisible': [('is_company', '=', True)]}"/> |
|||
<field name="academic_title_display" class="oe_read_only" attrs="{'invisible': [('is_company', '=', True)]}" /> |
|||
<label for="academic_title_ids" class="oe_edit_only"/> |
|||
<field name="academic_title_ids" widget="many2many_tags" |
|||
placeholder="Academic Titles" nolabel="1" class="oe_edit_only" |
|||
attrs="{'invisible': [('is_company', '=', True)]}" /> |
|||
<label for="academic_title_display" class="oe_read_only"/> |
|||
<field name="academic_title_display" nolabel="1" class="oe_read_only" |
|||
attrs="{'invisible': [('is_company', '=', True)]}" /> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue