odoo-addon-partner-rank-single 18.0.1.0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of odoo-addon-partner-rank-single might be problematic. Click here for more details.

@@ -0,0 +1,94 @@
1
+ ===================
2
+ Partner Rank Single
3
+ ===================
4
+
5
+ ..
6
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
+ !! This file is generated by oca-gen-addon-readme !!
8
+ !! changes will be overwritten. !!
9
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
+ !! source digest: sha256:09d036807482ee3c651a0348ac22d5a60ddd2298c0415edcb6f93862ac76ead3
11
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
+
13
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14
+ :target: https://odoo-community.org/page/development-status
15
+ :alt: Beta
16
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
+ :alt: License: AGPL-3
19
+ .. |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_rank_single
21
+ :alt: OCA/partner-contact
22
+ .. |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_rank_single
24
+ :alt: Translate me on Weblate
25
+ .. |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
27
+ :alt: Try me on Runboat
28
+
29
+ |badge1| |badge2| |badge3| |badge4| |badge5|
30
+
31
+ This module introduces a constraint to ensure that a contact cannot
32
+ simultaneously be both a customer and a supplier.
33
+
34
+ **Table of contents**
35
+
36
+ .. contents::
37
+ :local:
38
+
39
+ Bug Tracker
40
+ ===========
41
+
42
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
43
+ In case of trouble, please check there if your issue has already been reported.
44
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
45
+ `feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_rank_single%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
46
+
47
+ Do not contact contributors directly about support or help with technical issues.
48
+
49
+ Credits
50
+ =======
51
+
52
+ Authors
53
+ -------
54
+
55
+ * Camptocamp
56
+
57
+ Contributors
58
+ ------------
59
+
60
+ - Ivan Todorovich <ivan.todorovich@camptocamp.com>
61
+ - Maksym Yankin <maksym.yankin@camptocamp.com>
62
+
63
+ Other credits
64
+ -------------
65
+
66
+ - Camptocamp
67
+
68
+ Maintainers
69
+ -----------
70
+
71
+ This module is maintained by the OCA.
72
+
73
+ .. image:: https://odoo-community.org/logo.png
74
+ :alt: Odoo Community Association
75
+ :target: https://odoo-community.org
76
+
77
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
78
+ mission is to support the collaborative development of Odoo features and
79
+ promote its widespread use.
80
+
81
+ .. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px
82
+ :target: https://github.com/ivantodorovich
83
+ :alt: ivantodorovich
84
+ .. |maintainer-yankinmax| image:: https://github.com/yankinmax.png?size=40px
85
+ :target: https://github.com/yankinmax
86
+ :alt: yankinmax
87
+
88
+ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
89
+
90
+ |maintainer-ivantodorovich| |maintainer-yankinmax|
91
+
92
+ This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/18.0/partner_rank_single>`_ project on GitHub.
93
+
94
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -0,0 +1 @@
1
+ from . import models
@@ -0,0 +1,15 @@
1
+ # Copyright 2025 Camptocamp SA
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+
4
+ {
5
+ "name": "Partner Rank Single",
6
+ "summary": "Introduce single rank for partners.",
7
+ "version": "18.0.1.0.0",
8
+ "category": "Partner Management",
9
+ "website": "https://github.com/OCA/partner-contact",
10
+ "author": "Camptocamp, Odoo Community Association (OCA)",
11
+ "license": "AGPL-3",
12
+ "installable": True,
13
+ "maintainers": ["ivantodorovich", "yankinmax"],
14
+ "depends": ["account"],
15
+ }
@@ -0,0 +1,25 @@
1
+ # Translation of Odoo Server.
2
+ # This file contains the translation of the following modules:
3
+ # * partner_rank_single
4
+ #
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: Odoo Server 18.0\n"
8
+ "Report-Msgid-Bugs-To: \n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: \n"
14
+ "Plural-Forms: \n"
15
+
16
+ #. module: partner_rank_single
17
+ #. odoo-python
18
+ #: code:addons/partner_rank_single/models/res_partner.py:0
19
+ msgid "A contact cannot be both a customer and a supplier."
20
+ msgstr ""
21
+
22
+ #. module: partner_rank_single
23
+ #: model:ir.model,name:partner_rank_single.model_res_partner
24
+ msgid "Contact"
25
+ msgstr ""
@@ -0,0 +1 @@
1
+ from . import res_partner
@@ -0,0 +1,24 @@
1
+ # Copyright 2025 Camptocamp SA
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+
4
+ from odoo import api, models
5
+ from odoo.exceptions import ValidationError
6
+
7
+
8
+ class Contact(models.Model):
9
+ _inherit = "res.partner"
10
+
11
+ @api.constrains("customer_rank", "supplier_rank")
12
+ def _constrains_single_rank(self):
13
+ for record in self:
14
+ if record.customer_rank > 0 and record.supplier_rank > 0:
15
+ raise ValidationError(
16
+ self.env._("A contact cannot be both a customer and a supplier.")
17
+ )
18
+
19
+ def _increase_rank(self, field, n=1):
20
+ # OVERRIDE: to check single rank
21
+ # Because of direct SQL update in the super method
22
+ res = super()._increase_rank(field, n=n)
23
+ self._constrains_single_rank()
24
+ return res
@@ -0,0 +1,2 @@
1
+ - Ivan Todorovich \<<ivan.todorovich@camptocamp.com>\>
2
+ - Maksym Yankin \<<maksym.yankin@camptocamp.com>\>
@@ -0,0 +1 @@
1
+ - Camptocamp
@@ -0,0 +1 @@
1
+ This module introduces a constraint to ensure that a contact cannot simultaneously be both a customer and a supplier.
@@ -0,0 +1,434 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
+ <title>Partner Rank Single</title>
7
+ <style type="text/css">
8
+
9
+ /*
10
+ :Author: David Goodger (goodger@python.org)
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
12
+ :Copyright: This stylesheet has been placed in the public domain.
13
+
14
+ Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
16
+
17
+ See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: gray; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic, pre.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document" id="partner-rank-single">
364
+ <h1 class="title">Partner Rank Single</h1>
365
+
366
+ <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
+ !! This file is generated by oca-gen-addon-readme !!
368
+ !! changes will be overwritten. !!
369
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
+ !! source digest: sha256:09d036807482ee3c651a0348ac22d5a60ddd2298c0415edcb6f93862ac76ead3
371
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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_rank_single"><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_rank_single"><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>
373
+ <p>This module introduces a constraint to ensure that a contact cannot
374
+ simultaneously be both a customer and a supplier.</p>
375
+ <p><strong>Table of contents</strong></p>
376
+ <div class="contents local topic" id="contents">
377
+ <ul class="simple">
378
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
379
+ <li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
380
+ <li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
381
+ <li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
382
+ <li><a class="reference internal" href="#other-credits" id="toc-entry-5">Other credits</a></li>
383
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
384
+ </ul>
385
+ </li>
386
+ </ul>
387
+ </div>
388
+ <div class="section" id="bug-tracker">
389
+ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
390
+ <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/partner-contact/issues">GitHub Issues</a>.
391
+ In case of trouble, please check there if your issue has already been reported.
392
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
393
+ <a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_rank_single%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
394
+ <p>Do not contact contributors directly about support or help with technical issues.</p>
395
+ </div>
396
+ <div class="section" id="credits">
397
+ <h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
398
+ <div class="section" id="authors">
399
+ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
400
+ <ul class="simple">
401
+ <li>Camptocamp</li>
402
+ </ul>
403
+ </div>
404
+ <div class="section" id="contributors">
405
+ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
406
+ <ul class="simple">
407
+ <li>Ivan Todorovich &lt;<a class="reference external" href="mailto:ivan.todorovich&#64;camptocamp.com">ivan.todorovich&#64;camptocamp.com</a>&gt;</li>
408
+ <li>Maksym Yankin &lt;<a class="reference external" href="mailto:maksym.yankin&#64;camptocamp.com">maksym.yankin&#64;camptocamp.com</a>&gt;</li>
409
+ </ul>
410
+ </div>
411
+ <div class="section" id="other-credits">
412
+ <h2><a class="toc-backref" href="#toc-entry-5">Other credits</a></h2>
413
+ <ul class="simple">
414
+ <li>Camptocamp</li>
415
+ </ul>
416
+ </div>
417
+ <div class="section" id="maintainers">
418
+ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
419
+ <p>This module is maintained by the OCA.</p>
420
+ <a class="reference external image-reference" href="https://odoo-community.org">
421
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
422
+ </a>
423
+ <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
424
+ mission is to support the collaborative development of Odoo features and
425
+ promote its widespread use.</p>
426
+ <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
427
+ <p><a class="reference external image-reference" href="https://github.com/ivantodorovich"><img alt="ivantodorovich" src="https://github.com/ivantodorovich.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/yankinmax"><img alt="yankinmax" src="https://github.com/yankinmax.png?size=40px" /></a></p>
428
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/18.0/partner_rank_single">OCA/partner-contact</a> project on GitHub.</p>
429
+ <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>
430
+ </div>
431
+ </div>
432
+ </div>
433
+ </body>
434
+ </html>
@@ -0,0 +1 @@
1
+ from . import test_partner_rank_single
@@ -0,0 +1,76 @@
1
+ # Copyright 2025 Camptocamp SA
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+
4
+ from odoo import Command, fields
5
+ from odoo.exceptions import ValidationError
6
+ from odoo.tests import common, tagged
7
+
8
+
9
+ @tagged("res_partner")
10
+ class TestPartnerRankSingle(common.TransactionCase):
11
+ def setUp(self):
12
+ super().setUp()
13
+ self.Partner = self.env["res.partner"].with_context(no_state_required=True)
14
+ self.Product = self.env["product.product"]
15
+ self.customer = self.Partner.create(
16
+ {
17
+ "name": "Customer",
18
+ "is_company": True,
19
+ }
20
+ )
21
+ self.supplier = self.Partner.create(
22
+ {
23
+ "name": "Supplier",
24
+ "is_company": True,
25
+ }
26
+ )
27
+ self.table = self.Product.create({"name": "Table"})
28
+
29
+ def _create_invoice(self, move_type, date, partner_id, **kwargs):
30
+ move = self.env["account.move"].create(
31
+ {
32
+ "invoice_date": date,
33
+ "partner_id": partner_id.id,
34
+ **kwargs,
35
+ "move_type": move_type,
36
+ "date": date,
37
+ "invoice_line_ids": [
38
+ Command.create(
39
+ {
40
+ "product_id": self.table.id,
41
+ "price_unit": 120.0,
42
+ "tax_ids": [],
43
+ **line_kwargs,
44
+ }
45
+ )
46
+ for line_kwargs in kwargs.get("invoice_line_ids", [{}])
47
+ ],
48
+ }
49
+ )
50
+ return move.action_post()
51
+
52
+ def test_00_customer_rank_single(self):
53
+ self._create_invoice(
54
+ move_type="out_invoice", date=fields.Date.today(), partner_id=self.customer
55
+ )
56
+ with self.assertRaises(
57
+ ValidationError, msg="A contact cannot be both a customer and a supplier."
58
+ ):
59
+ self._create_invoice(
60
+ move_type="in_invoice",
61
+ date=fields.Date.today(),
62
+ partner_id=self.customer,
63
+ )
64
+
65
+ def test_01_supplier_rank_single(self):
66
+ self._create_invoice(
67
+ move_type="in_invoice", date=fields.Date.today(), partner_id=self.supplier
68
+ )
69
+ with self.assertRaises(
70
+ ValidationError, msg="A contact cannot be both a customer and a supplier."
71
+ ):
72
+ self._create_invoice(
73
+ move_type="out_invoice",
74
+ date=fields.Date.today(),
75
+ partner_id=self.supplier,
76
+ )
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.1
2
+ Name: odoo-addon-partner_rank_single
3
+ Version: 18.0.1.0.0.2
4
+ Requires-Python: >=3.10
5
+ Requires-Dist: odoo==18.0.*
6
+ Summary: Introduce single rank for partners.
7
+ Home-page: https://github.com/OCA/partner-contact
8
+ License: AGPL-3
9
+ Author: Camptocamp, Odoo Community Association (OCA)
10
+ Author-email: support@odoo-community.org
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Framework :: Odoo
13
+ Classifier: Framework :: Odoo :: 18.0
14
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
15
+ Description-Content-Type: text/x-rst
16
+
17
+ ===================
18
+ Partner Rank Single
19
+ ===================
20
+
21
+ ..
22
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23
+ !! This file is generated by oca-gen-addon-readme !!
24
+ !! changes will be overwritten. !!
25
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
+ !! source digest: sha256:09d036807482ee3c651a0348ac22d5a60ddd2298c0415edcb6f93862ac76ead3
27
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28
+
29
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
30
+ :target: https://odoo-community.org/page/development-status
31
+ :alt: Beta
32
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
33
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
34
+ :alt: License: AGPL-3
35
+ .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github
36
+ :target: https://github.com/OCA/partner-contact/tree/18.0/partner_rank_single
37
+ :alt: OCA/partner-contact
38
+ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
39
+ :target: https://translation.odoo-community.org/projects/partner-contact-18-0/partner-contact-18-0-partner_rank_single
40
+ :alt: Translate me on Weblate
41
+ .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
42
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=18.0
43
+ :alt: Try me on Runboat
44
+
45
+ |badge1| |badge2| |badge3| |badge4| |badge5|
46
+
47
+ This module introduces a constraint to ensure that a contact cannot
48
+ simultaneously be both a customer and a supplier.
49
+
50
+ **Table of contents**
51
+
52
+ .. contents::
53
+ :local:
54
+
55
+ Bug Tracker
56
+ ===========
57
+
58
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_.
59
+ In case of trouble, please check there if your issue has already been reported.
60
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
61
+ `feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_rank_single%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
62
+
63
+ Do not contact contributors directly about support or help with technical issues.
64
+
65
+ Credits
66
+ =======
67
+
68
+ Authors
69
+ -------
70
+
71
+ * Camptocamp
72
+
73
+ Contributors
74
+ ------------
75
+
76
+ - Ivan Todorovich <ivan.todorovich@camptocamp.com>
77
+ - Maksym Yankin <maksym.yankin@camptocamp.com>
78
+
79
+ Other credits
80
+ -------------
81
+
82
+ - Camptocamp
83
+
84
+ Maintainers
85
+ -----------
86
+
87
+ This module is maintained by the OCA.
88
+
89
+ .. image:: https://odoo-community.org/logo.png
90
+ :alt: Odoo Community Association
91
+ :target: https://odoo-community.org
92
+
93
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
94
+ mission is to support the collaborative development of Odoo features and
95
+ promote its widespread use.
96
+
97
+ .. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px
98
+ :target: https://github.com/ivantodorovich
99
+ :alt: ivantodorovich
100
+ .. |maintainer-yankinmax| image:: https://github.com/yankinmax.png?size=40px
101
+ :target: https://github.com/yankinmax
102
+ :alt: yankinmax
103
+
104
+ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
105
+
106
+ |maintainer-ivantodorovich| |maintainer-yankinmax|
107
+
108
+ This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/18.0/partner_rank_single>`_ project on GitHub.
109
+
110
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -0,0 +1,17 @@
1
+ odoo/addons/partner_rank_single/README.rst,sha256=2nNuiC4TCkG4bKve19ytkSAElvUwsU53CVDndYtr_Lw,3458
2
+ odoo/addons/partner_rank_single/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
3
+ odoo/addons/partner_rank_single/__manifest__.py,sha256=GrMciJvSVBEPDkNQY_LW-S5VU82q-1U-yTc4Tp9MjSU,510
4
+ odoo/addons/partner_rank_single/i18n/partner_rank_single.pot,sha256=aSF4sjyC9VedSkPKlnVOGOtKVrRc2orgUDnaJBU2e7g,661
5
+ odoo/addons/partner_rank_single/models/__init__.py,sha256=g-Dp2ZwN6oB4CqdQfgRInNSzdMWAVQg1vjWL7S-ZODM,26
6
+ odoo/addons/partner_rank_single/models/res_partner.py,sha256=hvD4S9CXmZdbVeTvKuRjextnBzB4XgWGW_yKrG1WPs8,819
7
+ odoo/addons/partner_rank_single/readme/CONTRIBUTORS.md,sha256=YVLioFvEXLky_TzTdGq1PJMwP-jB9SRwDUh1APhYDPs,106
8
+ odoo/addons/partner_rank_single/readme/CREDITS.md,sha256=8yK6sgd0Bp2l50Y6dvfWGsZKE4CWTChh5fF74ElYKxg,13
9
+ odoo/addons/partner_rank_single/readme/DESCRIPTION.md,sha256=tMxgWj8x6W3lyk7xkLucC0-rIyv2UoniSH0FvN3amIA,117
10
+ odoo/addons/partner_rank_single/static/description/icon.png,sha256=CgnOEZCwoe6f1vlLwkqFVfc2q_uwBMU0UnXN8j6X5ag,10254
11
+ odoo/addons/partner_rank_single/static/description/index.html,sha256=4H6Z0AA_tMmrNuSCk2RBbVFOIJpznwpPKw9HMy334ug,13122
12
+ odoo/addons/partner_rank_single/tests/__init__.py,sha256=RQGKK2uKBT7JIxut3YEiKPEEgKgScVwXMKV6-gv1KLs,39
13
+ odoo/addons/partner_rank_single/tests/test_partner_rank_single.py,sha256=JPqossRxArPoPpvEYozkEnE0vtld6fCBqSK_ebmL7uA,2599
14
+ odoo_addon_partner_rank_single-18.0.1.0.0.2.dist-info/METADATA,sha256=gTWTOBxLzgpyn8WSu-TLDl77runGxW9YSDx0m_-Eb5w,4021
15
+ odoo_addon_partner_rank_single-18.0.1.0.0.2.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
16
+ odoo_addon_partner_rank_single-18.0.1.0.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
17
+ odoo_addon_partner_rank_single-18.0.1.0.0.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: Whool 1.3
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+