-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] project_type_sequence: New field "Sequence" in project type.
- Loading branch information
1 parent
5957987
commit dc6c8b7
Showing
15 changed files
with
344 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. 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 | ||
|
||
===================== | ||
Project type sequence | ||
===================== | ||
|
||
* When a project is created and is associated with a project type with a | ||
defined sequence, the new project will be registered with said sequence, | ||
otherwise the general sequence for projects will be used. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/avanzosc/project-addons/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted | ||
it first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Ana Juaristi <anajuaristi@avanzosc.es> | ||
* Alfredo de la Fuente <alfredodelafuente@avanzosc.es> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2026 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Project Type Sequence", | ||
"version": "16.0.1.0.0", | ||
"category": "Services/Project", | ||
"license": "AGPL-3", | ||
"author": "AvanzOSC", | ||
"website": "https://github.com/avanzosc/project-addons", | ||
"depends": ["project_type", "project_sequence"], | ||
"data": [ | ||
"views/project_type_views.xml", | ||
"views/project_project_views.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_type_sequence | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-14 09:26+0000\n" | ||
"PO-Revision-Date: 2024-10-14 09:26+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_project | ||
msgid "Project" | ||
msgstr "Projecte" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_type | ||
msgid "Project Type" | ||
msgstr "Tipus de Projectes" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model.fields,field_description:project_type_sequence.field_project_type__sequence_id | ||
msgid "Sequence" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model_terms:ir.ui.view,arch_db:project_type_sequence.project_project_view_form_simplified | ||
msgid "Type of project" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_type_sequence | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-14 09:27+0000\n" | ||
"PO-Revision-Date: 2024-10-14 09:27+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_project | ||
msgid "Project" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_type | ||
msgid "Project Type" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model.fields,field_description:project_type_sequence.field_project_type__sequence_id | ||
msgid "Sequence" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model_terms:ir.ui.view,arch_db:project_type_sequence.project_project_view_form_simplified | ||
msgid "Type of project" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_type_sequence | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-14 09:27+0000\n" | ||
"PO-Revision-Date: 2024-10-14 09:27+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_project | ||
msgid "Project" | ||
msgstr "Proyecto" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_type | ||
msgid "Project Type" | ||
msgstr "Tipos de Proyectos" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model.fields,field_description:project_type_sequence.field_project_type__sequence_id | ||
msgid "Sequence" | ||
msgstr "Secuencia" | ||
|
||
#. module: project_type_sequence | ||
#: model_terms:ir.ui.view,arch_db:project_type_sequence.project_project_view_form_simplified | ||
msgid "Type of project" | ||
msgstr "Tipo de proyecto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_type_sequence | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-14 09:27+0000\n" | ||
"PO-Revision-Date: 2024-10-14 09:27+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_project | ||
msgid "Project" | ||
msgstr "Projet" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_type | ||
msgid "Project Type" | ||
msgstr "Type de projet" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model.fields,field_description:project_type_sequence.field_project_type__sequence_id | ||
msgid "Sequence" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model_terms:ir.ui.view,arch_db:project_type_sequence.project_project_view_form_simplified | ||
msgid "Type of project" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_type_sequence | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-10-14 09:26+0000\n" | ||
"PO-Revision-Date: 2024-10-14 09:26+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_project | ||
msgid "Project" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model,name:project_type_sequence.model_project_type | ||
msgid "Project Type" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model:ir.model.fields,field_description:project_type_sequence.field_project_type__sequence_id | ||
msgid "Sequence" | ||
msgstr "" | ||
|
||
#. module: project_type_sequence | ||
#: model_terms:ir.ui.view,arch_db:project_type_sequence.project_project_view_form_simplified | ||
msgid "Type of project" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import project_type | ||
from . import project_project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2026 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import api, models | ||
|
||
|
||
class ProjectProject(models.Model): | ||
_inherit = "project.project" | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
for vals in vals_list: | ||
if "name" in vals: | ||
vals.pop("name") | ||
if ( | ||
"sequence_code" not in vals | ||
and "type_id" in vals | ||
and vals.get("type_id", False) | ||
): | ||
project_type = self.env["project.type"].browse(vals.get("type_id")) | ||
if project_type.sequence_id: | ||
vals["sequence_code"] = project_type.sequence_id.next_by_id() | ||
return super().create(vals_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright 2026 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from odoo import fields, models | ||
|
||
|
||
class ProjectType(models.Model): | ||
_inherit = "project.type" | ||
|
||
sequence_id = fields.Many2one(string="Sequence", comodel_name="ir.sequence") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record model="ir.ui.view" id="project_project_view_form_simplified"> | ||
<field name="model">project.project</field> | ||
<field name="inherit_id" ref="project.project_project_view_form_simplified" /> | ||
<field name="arch" type="xml"> | ||
<field name="user_id" position="before"> | ||
<div name="project-type"> | ||
<label | ||
for="type_id" | ||
class="oe_inline mt-4" | ||
string="Type of project" | ||
/> | ||
<field name="type_id" /> | ||
</div> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="project_sequence_form_view"> | ||
<field name="model">project.project</field> | ||
<field name="inherit_id" ref="project_sequence.project_sequence_form_view" /> | ||
<field name="arch" type="xml"> | ||
<div name="sequence_code" position="attributes"> | ||
<attribute name="invisible">1</attribute> | ||
</div> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="project_sequence_tree_view"> | ||
<field name="model">project.project</field> | ||
<field name="inherit_id" ref="project_sequence.project_sequence_tree_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="sequence_code" position="attributes"> | ||
<attribute name="invisible">1</attribute> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="project_sequence.project_sequence_search_view"> | ||
<field name="active">False</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record model="ir.ui.view" id="project_type_form"> | ||
<field name="model">project.type</field> | ||
<field name="inherit_id" ref="project_type.project_type_form" /> | ||
<field name="arch" type="xml"> | ||
<field name="code" position="before"> | ||
<field name="sequence_id" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record model="ir.ui.view" id="project_type_search"> | ||
<field name="model">project.type</field> | ||
<field name="inherit_id" ref="project_type.project_type_search" /> | ||
<field name="arch" type="xml"> | ||
<field name="parent_id" position="after"> | ||
<field name="sequence_id" /> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
<record id="project_type_tree" model="ir.ui.view"> | ||
<field name="model">project.type</field> | ||
<field name="arch" type="xml"> | ||
<tree> | ||
<field name="complete_name" /> | ||
<field name="sequence_id" optional="show" /> | ||
<field name="project_ok" optional="show" /> | ||
<field name="task_ok" optional="show" /> | ||
</tree> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../project_type_sequence |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |