Skip to content

Commit

Permalink
[MIG] partner_contact_department: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-tecnativa committed Jul 4, 2023
1 parent 8b47321 commit fec646f
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 58 deletions.
39 changes: 22 additions & 17 deletions partner_contact_department/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Partner Contact Department
.. |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/14.0/partner_contact_department
:alt: OCA/partner-contact
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner_contact-lightgray.png?logo=github
:target: https://github.com/OCA/partner_contact/tree/15.0/partner_contact_department
: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-14-0/partner-contact-14-0-partner_contact_department
:target: https://translation.odoo-community.org/projects/partner_contact-15-0/partner_contact-15-0-partner_contact_department
: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/14.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/partner_contact&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Expand All @@ -43,7 +43,7 @@ To configure departments, you need to:

* Go to *Contacts > Configuration > Departments*.

.. figure:: https://raw.githubusercontent.com/OCA/partner-contact/14.0/partner_contact_department/path/to/local/image.png
.. figure:: https://raw.githubusercontent.com/OCA/partner_contact/15.0/partner_contact_department/path/to/local/image.png
:alt: alternative description
:width: 600 px

Expand All @@ -58,10 +58,10 @@ To use this module, you need to:
Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
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_contact_department%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/partner_contact/issues/new?body=module:%20partner_contact_department%0Aversion:%2015.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.

Expand All @@ -76,12 +76,17 @@ Authors
Contributors
~~~~~~~~~~~~

* Pedro M. Baeza <[email protected]>
* Antonio Espinosa <[email protected]>
* Rafael Blasco <[email protected]>
* Jairo Llopis <[email protected]>
* Vicent Cubells <[email protected]>
* David Vidal <[email protected]>
* `Tecnativa <https://www.tecnativa.com>`_:

* Pedro M. Baeza
* Antonio Espinosa
* Rafael Blasco
* Jairo Llopis
* Vicent Cubells
* David Vidal
* Stefan Ungureanu


* Nikul Chaudhary <[email protected]>
* Harald Panten <[email protected]>
* Tharathip Chaweewongphan <[email protected]>
Expand All @@ -99,6 +104,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 <https://github.com/OCA/partner-contact/tree/14.0/partner_contact_department>`_ project on GitHub.
This module is part of the `OCA/partner_contact <https://github.com/OCA/partner_contact/tree/15.0/partner_contact_department>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion partner_contact_department/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Partner Contact Department",
"summary": "Assign contacts to departments",
"version": "14.0.1.0.1",
"version": "15.0.1.0.0",
"category": "Customer Relationship Management",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
Expand Down
1 change: 1 addition & 0 deletions partner_contact_department/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import res_partner
from . import res_partner_department
17 changes: 0 additions & 17 deletions partner_contact_department/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,3 @@ class ResPartner(models.Model):
_inherit = "res.partner"

department_id = fields.Many2one("res.partner.department", "Department")


class ResPartnerDepartment(models.Model):
_name = "res.partner.department"
_order = "parent_path"
_parent_order = "name"
_parent_store = True
_description = "Department"

name = fields.Char(required=True, translate=True)
parent_id = fields.Many2one(
"res.partner.department", "Parent department", ondelete="restrict"
)
child_ids = fields.One2many(
"res.partner.department", "parent_id", "Child departments"
)
parent_path = fields.Char(index=True)
23 changes: 23 additions & 0 deletions partner_contact_department/models/res_partner_department.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# © 2014-2015 Tecnativa S.L. - Jairo Llopis
# © 2016 Tecnativa S.L. - Vicent Cubells
# © 2023 Tecnativa S.L. - Stefan Ungureanu
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class ResPartnerDepartment(models.Model):
_name = "res.partner.department"
_order = "parent_path"
_parent_order = "name"
_parent_store = True
_description = "Department"

name = fields.Char(required=True, translate=True)
parent_id = fields.Many2one(
"res.partner.department", "Parent department", ondelete="restrict"
)
child_ids = fields.One2many(
"res.partner.department", "parent_id", "Child departments"
)
parent_path = fields.Char(index=True)
17 changes: 11 additions & 6 deletions partner_contact_department/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
* Pedro M. Baeza <[email protected]>
* Antonio Espinosa <[email protected]>
* Rafael Blasco <[email protected]>
* Jairo Llopis <[email protected]>
* Vicent Cubells <[email protected]>
* David Vidal <[email protected]>
* `Tecnativa <https://www.tecnativa.com>`_:

* Pedro M. Baeza
* Antonio Espinosa
* Rafael Blasco
* Jairo Llopis
* Vicent Cubells
* David Vidal
* Stefan Ungureanu


* Nikul Chaudhary <[email protected]>
* Harald Panten <[email protected]>
* Tharathip Chaweewongphan <[email protected]>
40 changes: 25 additions & 15 deletions partner_contact_department/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Partner Contact Department</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Partner Contact Department</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/partner-contact/tree/14.0/partner_contact_department"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_contact_department"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/134/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/partner_contact/tree/15.0/partner_contact_department"><img alt="OCA/partner_contact" src="https://img.shields.io/badge/github-OCA%2Fpartner_contact-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/partner_contact-15-0/partner_contact-15-0-partner_contact_department"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/partner_contact&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of the address book to support
departments.</p>
<p>Department is a drop-down field in partner forms, and it refers to contact
Expand All @@ -393,7 +393,7 @@ <h1><a class="toc-backref" href="#id1">Configuration</a></h1>
<li>Go to <em>Contacts &gt; Configuration &gt; Departments</em>.</li>
</ul>
<div class="figure">
<img alt="alternative description" src="https://raw.githubusercontent.com/OCA/partner-contact/14.0/partner_contact_department/path/to/local/image.png" style="width: 600px;" />
<img alt="alternative description" src="https://raw.githubusercontent.com/OCA/partner_contact/15.0/partner_contact_department/path/to/local/image.png" style="width: 600px;" />
</div>
</div>
<div class="section" id="usage">
Expand All @@ -406,10 +406,10 @@ <h1><a class="toc-backref" href="#id2">Usage</a></h1>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/partner-contact/issues">GitHub Issues</a>.
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/partner_contact/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_contact_department%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/partner_contact/issues/new?body=module:%20partner_contact_department%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -422,16 +422,26 @@ <h2><a class="toc-backref" href="#id5">Authors</a></h2>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul>
<li><p class="first"><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:</p>
<blockquote>
<ul class="simple">
<li>Pedro M. Baeza &lt;<a class="reference external" href="mailto:pedro.baeza&#64;tecnativa.com">pedro.baeza&#64;tecnativa.com</a>&gt;</li>
<li>Antonio Espinosa &lt;<a class="reference external" href="mailto:antonio.espinosa&#64;tecnativa.com">antonio.espinosa&#64;tecnativa.com</a>&gt;</li>
<li>Rafael Blasco &lt;<a class="reference external" href="mailto:rafael.blasco&#64;tecnativa.com">rafael.blasco&#64;tecnativa.com</a>&gt;</li>
<li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt;</li>
<li>Vicent Cubells &lt;<a class="reference external" href="mailto:vicent.cubells&#64;tecnativa.com">vicent.cubells&#64;tecnativa.com</a>&gt;</li>
<li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li>
<li>Nikul Chaudhary &lt;<a class="reference external" href="mailto:nikulchaudhary2112&#64;gmail.com">nikulchaudhary2112&#64;gmail.com</a>&gt;</li>
<li>Harald Panten &lt;<a class="reference external" href="mailto:harald.panten&#64;sygel.es">harald.panten&#64;sygel.es</a>&gt;</li>
<li>Tharathip Chaweewongphan &lt;<a class="reference external" href="mailto:tharathipc&#64;ecosoft.co.th">tharathipc&#64;ecosoft.co.th</a>&gt;</li>
<li>Pedro M. Baeza</li>
<li>Antonio Espinosa</li>
<li>Rafael Blasco</li>
<li>Jairo Llopis</li>
<li>Vicent Cubells</li>
<li>David Vidal</li>
<li>Stefan Ungureanu</li>
</ul>
</blockquote>
</li>
<li><p class="first">Nikul Chaudhary &lt;<a class="reference external" href="mailto:nikulchaudhary2112&#64;gmail.com">nikulchaudhary2112&#64;gmail.com</a>&gt;</p>
</li>
<li><p class="first">Harald Panten &lt;<a class="reference external" href="mailto:harald.panten&#64;sygel.es">harald.panten&#64;sygel.es</a>&gt;</p>
</li>
<li><p class="first">Tharathip Chaweewongphan &lt;<a class="reference external" href="mailto:tharathipc&#64;ecosoft.co.th">tharathipc&#64;ecosoft.co.th</a>&gt;</p>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -441,7 +451,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/14.0/partner_contact_department">OCA/partner-contact</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner_contact/tree/15.0/partner_contact_department">OCA/partner_contact</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion partner_contact_department/tests/test_recursion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from odoo.tests import common


class TestRecursion(common.SavepointCase):
class TestRecursion(common.TransactionCase):
@classmethod
def setUpClass(cls):
super(TestRecursion, cls).setUpClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<field name="name">CRM department tree</field>
<field name="model">res.partner.department</field>
<field name="arch" type="xml">
<tree string="Departments" editable="top">
<tree editable="top">
<field name="name" />
<field name="parent_id" />
</tree>
Expand Down

0 comments on commit fec646f

Please sign in to comment.