Skip to content

Commit 63b5f98

Browse files
committed
[MIG] partner_stage: Migration to 19.0
1 parent 7cab145 commit 63b5f98

5 files changed

Lines changed: 45 additions & 31 deletions

File tree

partner_stage/README.rst

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
=============
26
Partner Stage
37
=============
@@ -13,17 +17,17 @@ Partner Stage
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github
20-
:target: https://github.com/OCA/partner-contact/tree/18.0/partner_stage
24+
:target: https://github.com/OCA/partner-contact/tree/19.0/partner_stage
2125
:alt: OCA/partner-contact
2226
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/partner-contact-18-0/partner-contact-18-0-partner_stage
27+
:target: https://translation.odoo-community.org/projects/partner-contact-19-0/partner-contact-19-0-partner_stage
2428
:alt: Translate me on Weblate
2529
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=19.0
2731
:alt: Try me on Runboat
2832

2933
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -50,7 +54,7 @@ Bug Tracker
5054
Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
5155
In case of trouble, please check there if your issue has already been reported.
5256
If you spotted it first, help us to smash it by providing a detailed and welcomed
53-
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_stage%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
57+
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_stage%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5458

5559
Do not contact contributors directly about support or help with technical issues.
5660

@@ -65,14 +69,14 @@ Authors
6569
Contributors
6670
------------
6771

68-
- Daniel Reis <dreis@opensourceintegrators.com>
69-
- Urvisha Desai <udesai@opensourceintegrators.com>
72+
- Daniel Reis <dreis@opensourceintegrators.com>
73+
- Urvisha Desai <udesai@opensourceintegrators.com>
7074

71-
- ``Camptocamp <https://www.camptocamp.com>``\ \_\_:
75+
- ``Camptocamp <https://www.camptocamp.com>``\ \_\_:
7276

73-
- Maksym Yankin maksym.yankin@camptocamp.com
77+
- Maksym Yankin maksym.yankin@camptocamp.com
7478

75-
- Bert Van Groenendael <bert.vangroenendael@dynapps.eu>
79+
- Bert Van Groenendael <bert.vangroenendael@dynapps.eu>
7680

7781
Maintainers
7882
-----------
@@ -95,6 +99,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
9599

96100
|maintainer-dreispt|
97101

98-
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/18.0/partner_stage>`_ project on GitHub.
102+
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/19.0/partner_stage>`_ project on GitHub.
99103

100104
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

partner_stage/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"author": "Open Source Integrators, Odoo Community Association (OCA)",
88
"website": "https://github.com/OCA/partner-contact",
99
"category": "Sales/CRM",
10-
"version": "18.0.1.0.1",
10+
"version": "19.0.1.0.0",
1111
"license": "AGPL-3",
1212
"depends": ["contacts"],
1313
"data": [

partner_stage/models/res_partner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ def _get_default_stage_id(self):
1515

1616
@api.model
1717
def _read_group_stage_id(self, states, domain):
18-
return states.search([])
18+
# For group expansion, we typically return all stages, but limit to
19+
# prevent performance issues
20+
# The domain parameter here is not for filtering stages but for the relationship
21+
return states.search([], limit=100)
1922

2023
stage_id = fields.Many2one(
2124
comodel_name="res.partner.stage",
2225
group_expand="_read_group_stage_id",
23-
default=_get_default_stage_id,
26+
default=lambda self: self._get_default_stage_id(),
2427
copy=False,
2528
index=True,
2629
tracking=True,

partner_stage/models/res_partner_stage.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2021 Open Source Integrators
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
33

4-
from odoo import _, api, fields, models
4+
from odoo import api, fields, models
55
from odoo.exceptions import ValidationError
66

77

@@ -24,11 +24,12 @@ class PartnerStage(models.Model):
2424
default="confirmed",
2525
)
2626

27-
_sql_constraints = [
28-
("res_partner_stage_code_unique", "UNIQUE(code)", "Stage Code must be unique.")
29-
]
27+
_res_partner_stage_code_unique = models.Constraint(
28+
"UNIQUE(code)",
29+
"Stage Code must be unique.",
30+
)
3031

3132
@api.constrains("is_default")
3233
def _check_default(self):
3334
if self.search_count([("is_default", "=", True)]) > 1:
34-
raise ValidationError(_("There should be only one default stage"))
35+
raise ValidationError(self.env._("There should be only one default stage"))

partner_stage/static/description/index.html

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>Partner Stage</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="partner-stage">
364-
<h1 class="title">Partner Stage</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="partner-stage">
370+
<h1>Partner Stage</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:9982f36842fb03610d50b843bf9787dbb5102c38e6f481989478286c546929d2
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/partner-contact/tree/18.0/partner_stage"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/partner-contact-18-0/partner-contact-18-0-partner_stage"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/partner-contact/tree/19.0/partner_stage"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/partner-contact-19-0/partner-contact-19-0-partner_stage"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>Adds stages to Contacts allowing, for example, to setup a lifecycle
374379
workflow. The default stages are: Draft, Active and Inactive.</p>
375380
<p><strong>Table of contents</strong></p>
@@ -386,29 +391,29 @@ <h1 class="title">Partner Stage</h1>
386391
</ul>
387392
</div>
388393
<div class="section" id="usage">
389-
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
394+
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
390395
<p>Open a Contact form to see the corresponding Stage. It is visible in the
391396
stages bar, at the top right are of the form.</p>
392397
<p>The contact stage can be changed clicking on the stages bar.</p>
393398
</div>
394399
<div class="section" id="bug-tracker">
395-
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
400+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
396401
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/partner-contact/issues">GitHub Issues</a>.
397402
In case of trouble, please check there if your issue has already been reported.
398403
If you spotted it first, help us to smash it by providing a detailed and welcomed
399-
<a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_stage%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
404+
<a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_stage%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
400405
<p>Do not contact contributors directly about support or help with technical issues.</p>
401406
</div>
402407
<div class="section" id="credits">
403-
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
408+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
404409
<div class="section" id="authors">
405-
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
410+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
406411
<ul class="simple">
407412
<li>Open Source Integrators</li>
408413
</ul>
409414
</div>
410415
<div class="section" id="contributors">
411-
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
416+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
412417
<ul class="simple">
413418
<li>Daniel Reis &lt;<a class="reference external" href="mailto:dreis&#64;opensourceintegrators.com">dreis&#64;opensourceintegrators.com</a>&gt;</li>
414419
<li>Urvisha Desai &lt;<a class="reference external" href="mailto:udesai&#64;opensourceintegrators.com">udesai&#64;opensourceintegrators.com</a>&gt;</li>
@@ -420,7 +425,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
420425
</ul>
421426
</div>
422427
<div class="section" id="maintainers">
423-
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
428+
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
424429
<p>This module is maintained by the OCA.</p>
425430
<a class="reference external image-reference" href="https://odoo-community.org">
426431
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -430,10 +435,11 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
430435
promote its widespread use.</p>
431436
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
432437
<p><a class="reference external image-reference" href="https://github.com/dreispt"><img alt="dreispt" src="https://github.com/dreispt.png?size=40px" /></a></p>
433-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/18.0/partner_stage">OCA/partner-contact</a> project on GitHub.</p>
438+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/19.0/partner_stage">OCA/partner-contact</a> project on GitHub.</p>
434439
<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>
435440
</div>
436441
</div>
437442
</div>
443+
</div>
438444
</body>
439445
</html>

0 commit comments

Comments
 (0)