Skip to content

Commit 2ca302e

Browse files
committed
[FIX] project_task_code: unique code in company
1 parent 95494ab commit 2ca302e

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

project_task_code/README.rst

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
Sequential Code for Tasks
33
=========================
44

5-
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
67
!! This file is generated by oca-gen-addon-readme !!
78
!! changes will be overwritten. !!
89
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:307ec89a5cd1e0a62f1559f57457a183b12100fee6f01a43caca5324a80c3d00
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
912
1013
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1114
:target: https://odoo-community.org/page/development-status
@@ -20,10 +23,10 @@ Sequential Code for Tasks
2023
:target: https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code
2124
:alt: Translate me on Weblate
2225
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
23-
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/project&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/project&target_branch=16.0
2427
:alt: Try me on Runboat
2528

26-
|badge1| |badge2| |badge3| |badge4| |badge5|
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
2730

2831
This module adds a sequential code for tasks.
2932

@@ -55,7 +58,7 @@ Bug Tracker
5558

5659
Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/issues>`_.
5760
In case of trouble, please check there if your issue has already been reported.
58-
If you spotted it first, help us smashing it by providing a detailed and welcomed
61+
If you spotted it first, help us to smash it by providing a detailed and welcomed
5962
`feedback <https://github.com/OCA/project/issues/new?body=module:%20project_task_code%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6063

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

project_task_code/models/project_task.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ class ProjectTask(models.Model):
1616
)
1717

1818
_sql_constraints = [
19-
("project_task_unique_code", "UNIQUE (code)", _("The code must be unique!")),
19+
(
20+
"project_task_unique_code",
21+
"UNIQUE (company_id, code)",
22+
_("The code must be unique!"),
23+
),
2024
]
2125

2226
@api.model_create_multi

project_task_code/static/description/index.html

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
33
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
77
<title>Sequential Code for Tasks</title>
88
<style type="text/css">
99

1010
/*
1111
:Author: David Goodger ([email protected])
12-
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
12+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
1313
:Copyright: This stylesheet has been placed in the public domain.
1414
1515
Default cascading style sheet for the HTML output of Docutils.
1616
17-
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
17+
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
1919
*/
2020

@@ -366,25 +366,27 @@ <h1 class="title">Sequential Code for Tasks</h1>
366366
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370+
!! source digest: sha256:307ec89a5cd1e0a62f1559f57457a183b12100fee6f01a43caca5324a80c3d00
369371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<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/project/tree/16.0/project_task_code"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code"><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/project&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
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/project/tree/16.0/project_task_code"><img alt="OCA/project" src="https://img.shields.io/badge/github-OCA%2Fproject-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/project-16-0/project-16-0-project_task_code"><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/project&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
371373
<p>This module adds a sequential code for tasks.</p>
372374
<p><strong>Table of contents</strong></p>
373375
<div class="contents local topic" id="contents">
374376
<ul class="simple">
375-
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
376-
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
377-
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
378-
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
379-
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
380-
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
381-
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
377+
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
378+
<li><a class="reference internal" href="#usage" id="toc-entry-2">Usage</a></li>
379+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
380+
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
381+
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
382+
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
383+
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
382384
</ul>
383385
</li>
384386
</ul>
385387
</div>
386388
<div class="section" id="configuration">
387-
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
389+
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
388390
<p>To change the task code sequence, you must:</p>
389391
<ol class="arabic simple">
390392
<li>Activate the developer mode.</li>
@@ -393,32 +395,32 @@ <h1><a class="toc-backref" href="#id1">Configuration</a></h1>
393395
</ol>
394396
</div>
395397
<div class="section" id="usage">
396-
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
398+
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
397399
<p>To use this module, you need to:</p>
398400
<p>#. Go to menu Project &gt; Search &gt; Tasks and create a new task, and you get a
399401
new code saving it.
400402
#. If you duplicate a task, you will get a new code for the new task.</p>
401403
</div>
402404
<div class="section" id="bug-tracker">
403-
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
405+
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
404406
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/project/issues">GitHub Issues</a>.
405407
In case of trouble, please check there if your issue has already been reported.
406-
If you spotted it first, help us smashing it by providing a detailed and welcomed
408+
If you spotted it first, help us to smash it by providing a detailed and welcomed
407409
<a class="reference external" href="https://github.com/OCA/project/issues/new?body=module:%20project_task_code%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
408410
<p>Do not contact contributors directly about support or help with technical issues.</p>
409411
</div>
410412
<div class="section" id="credits">
411-
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
413+
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
412414
<div class="section" id="authors">
413-
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
415+
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
414416
<ul class="simple">
415417
<li>OdooMRP team</li>
416418
<li>AvanzOSC</li>
417419
<li>Tecnativa</li>
418420
</ul>
419421
</div>
420422
<div class="section" id="contributors">
421-
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
423+
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
422424
<ul class="simple">
423425
<li>Oihane Crucelaegui &lt;<a class="reference external" href="mailto:oihanecrucelaegi&#64;avanzosc.es">oihanecrucelaegi&#64;avanzosc.es</a>&gt;</li>
424426
<li>Pedro M. Baeza &lt;<a class="reference external" href="mailto:pedro.baeza&#64;serviciosbaeza.com">pedro.baeza&#64;serviciosbaeza.com</a>&gt;</li>
@@ -436,7 +438,7 @@ <h2><a class="toc-backref" href="#id6">Contributors</a></h2>
436438
</ul>
437439
</div>
438440
<div class="section" id="maintainers">
439-
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
441+
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
440442
<p>This module is maintained by the OCA.</p>
441443
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
442444
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose

0 commit comments

Comments
 (0)