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
-
94partner_academic_title/data/partner_academic_title_data.xml
-
19partner_academic_title/models/partner_academic_title.py
-
29partner_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
-
74partner_academic_title/views/partner_academic_title_view.xml
-
31partner_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 |
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 |
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 |
to add multiple titles on partners. there is a sequence on titles to display |
||||
them in an order on the partner. |
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 |
Credits |
||||
======= |
======= |
||||
|
|
||||
|
Authors |
||||
|
~~~~~~~ |
||||
|
|
||||
|
* ACSONE SA/NV |
||||
|
|
||||
Contributors |
Contributors |
||||
------------ |
|
||||
|
~~~~~~~~~~~~ |
||||
|
|
||||
* Stéphane Bidoul <stephane.bidoul@acsone.eu> |
* Stéphane Bidoul <stephane.bidoul@acsone.eu> |
||||
* Adrien Peiffer <adrien.peiffer@acsone.eu> |
* Adrien Peiffer <adrien.peiffer@acsone.eu> |
||||
* Meyomesse Gilles <meyomesse.gilles@gmail.com> |
* 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 |
: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. |
@ -1,51 +1,49 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- Copyright 2015-2017 ACSONE SA/NV |
<!-- Copyright 2015-2017 ACSONE SA/NV |
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> |
|
||||
<odoo> |
|
||||
<data noupdate="1"> |
|
||||
<record id="academic_title_bs" model="partner.academic.title"> |
|
||||
<field name="name">B.S.</field> |
|
||||
<field name="sequence">1</field> |
|
||||
</record> |
|
||||
<record id="academic_title_ms" model="partner.academic.title"> |
|
||||
<field name="name">M.S.</field> |
|
||||
<field name="sequence">2</field> |
|
||||
</record> |
|
||||
<record id="academic_title_mph" model="partner.academic.title"> |
|
||||
<field name="name">M.P.H.</field> |
|
||||
<field name="sequence">3</field> |
|
||||
</record> |
|
||||
<record id="academic_title_mba" model="partner.academic.title"> |
|
||||
<field name="name">M.B.A.</field> |
|
||||
<field name="sequence">4</field> |
|
||||
</record> |
|
||||
<record id="academic_title_md" model="partner.academic.title"> |
|
||||
<field name="name">M.D.</field> |
|
||||
<field name="sequence">5</field> |
|
||||
</record> |
|
||||
<record id="academic_title_phd" model="partner.academic.title"> |
|
||||
<field name="name">Ph.D.</field> |
|
||||
<field name="sequence">6</field> |
|
||||
</record> |
|
||||
<record id="academic_title_edd" model="partner.academic.title"> |
|
||||
<field name="name">Ed.D</field> |
|
||||
<field name="sequence">7</field> |
|
||||
</record> |
|
||||
<record id="academic_title_psyd" model="partner.academic.title"> |
|
||||
<field name="name">Psy.D.</field> |
|
||||
<field name="sequence">8</field> |
|
||||
</record> |
|
||||
<record id="academic_title_thd" model="partner.academic.title"> |
|
||||
<field name="name">Th.D.</field> |
|
||||
<field name="sequence">9</field> |
|
||||
</record> |
|
||||
<record id="academic_title_pharmd" model="partner.academic.title"> |
|
||||
<field name="name">Pharm.D.</field> |
|
||||
<field name="sequence">10</field> |
|
||||
</record> |
|
||||
<record id="academic_title_jd" model="partner.academic.title"> |
|
||||
<field name="name">J.D.</field> |
|
||||
<field name="sequence">11</field> |
|
||||
</record> |
|
||||
</data> |
|
||||
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> |
||||
|
<odoo noupdate="1"> |
||||
|
<record id="academic_title_bs" model="partner.academic.title"> |
||||
|
<field name="name">B.S.</field> |
||||
|
<field name="sequence">1</field> |
||||
|
</record> |
||||
|
<record id="academic_title_ms" model="partner.academic.title"> |
||||
|
<field name="name">M.S.</field> |
||||
|
<field name="sequence">2</field> |
||||
|
</record> |
||||
|
<record id="academic_title_mph" model="partner.academic.title"> |
||||
|
<field name="name">M.P.H.</field> |
||||
|
<field name="sequence">3</field> |
||||
|
</record> |
||||
|
<record id="academic_title_mba" model="partner.academic.title"> |
||||
|
<field name="name">M.B.A.</field> |
||||
|
<field name="sequence">4</field> |
||||
|
</record> |
||||
|
<record id="academic_title_md" model="partner.academic.title"> |
||||
|
<field name="name">M.D.</field> |
||||
|
<field name="sequence">5</field> |
||||
|
</record> |
||||
|
<record id="academic_title_phd" model="partner.academic.title"> |
||||
|
<field name="name">Ph.D.</field> |
||||
|
<field name="sequence">6</field> |
||||
|
</record> |
||||
|
<record id="academic_title_edd" model="partner.academic.title"> |
||||
|
<field name="name">Ed.D</field> |
||||
|
<field name="sequence">7</field> |
||||
|
</record> |
||||
|
<record id="academic_title_psyd" model="partner.academic.title"> |
||||
|
<field name="name">Psy.D.</field> |
||||
|
<field name="sequence">8</field> |
||||
|
</record> |
||||
|
<record id="academic_title_thd" model="partner.academic.title"> |
||||
|
<field name="name">Th.D.</field> |
||||
|
<field name="sequence">9</field> |
||||
|
</record> |
||||
|
<record id="academic_title_pharmd" model="partner.academic.title"> |
||||
|
<field name="name">Pharm.D.</field> |
||||
|
<field name="sequence">10</field> |
||||
|
</record> |
||||
|
<record id="academic_title_jd" model="partner.academic.title"> |
||||
|
<field name="name">J.D.</field> |
||||
|
<field name="sequence">11</field> |
||||
|
</record> |
||||
</odoo> |
</odoo> |
@ -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,43 +1,39 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- Copyright 2015-2017 ACSONE SA/NV |
<!-- 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> |
<odoo> |
||||
<data> |
|
||||
<record id="view_academic_title_form" model="ir.ui.view"> |
|
||||
<field name="name">partner.academic.title.form</field> |
|
||||
<field name="model">partner.academic.title</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form> |
|
||||
<sheet> |
|
||||
<group> |
|
||||
<field name="name" /> |
|
||||
<field name="sequence" /> |
|
||||
<field name="active" /> |
|
||||
</group> |
|
||||
</sheet> |
|
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record id="view_academic_title_tree" model="ir.ui.view"> |
|
||||
<field name="name">partner.academic.title.tree</field> |
|
||||
<field name="model">partner.academic.title</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<tree editable="bottom"> |
|
||||
<field name="sequence"/> |
|
||||
<field name="name" /> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</record> |
|
||||
<record id="open_academic_title" model="ir.actions.act_window"> |
|
||||
<field name="name">Academic Titles</field> |
|
||||
<field name="res_model">partner.academic.title</field> |
|
||||
<field name="view_type">form</field> |
|
||||
<field name="view_mode">tree,form</field> |
|
||||
</record> |
|
||||
<!-- this menu his managed in partner_contact_configuration (visible if your are in group_system) |
|
||||
group_system is activate in developper mode |
|
||||
--> |
|
||||
<menuitem id="menu_academic_title" name="Academic Titles" parent="partner_contact_configuration.menu_config_contacts" groups="base.group_no_one" action="open_academic_title" sequence="4"/> |
|
||||
</data> |
|
||||
|
<record id="view_academic_title_form" model="ir.ui.view"> |
||||
|
<field name="name">partner.academic.title.form</field> |
||||
|
<field name="model">partner.academic.title</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<sheet> |
||||
|
<group> |
||||
|
<field name="name" /> |
||||
|
<field name="sequence" /> |
||||
|
<field name="active" /> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="view_academic_title_tree" model="ir.ui.view"> |
||||
|
<field name="name">partner.academic.title.tree</field> |
||||
|
<field name="model">partner.academic.title</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree editable="bottom"> |
||||
|
<field name="sequence"/> |
||||
|
<field name="name" /> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="open_academic_title" model="ir.actions.act_window"> |
||||
|
<field name="name">Academic Titles</field> |
||||
|
<field name="res_model">partner.academic.title</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
</record> |
||||
|
<menuitem id="menu_academic_title" name="Academic Titles" |
||||
|
parent="contacts.res_partner_menu_config" |
||||
|
action="open_academic_title" sequence="3"/> |
||||
</odoo> |
</odoo> |
@ -1,18 +1,21 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- Copyright 2015-2017 ACSONE SA/NV |
<!-- 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> |
<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)]}" /> |
|
||||
</xpath> |
|
||||
</field> |
|
||||
</record> |
|
||||
</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"> |
||||
|
<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> |
||||
</odoo> |
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue