-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TA#22989 add module show_project_artwork (#106)
- Loading branch information
Showing
16 changed files
with
162 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
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
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,38 @@ | ||
Show Project Artwork | ||
==================== | ||
|
||
This module adds a tab of projects. | ||
|
||
This tab allows to link ``Musical Artworks`` to projects. | ||
|
||
Tour Projects | ||
------------- | ||
I go to the form view of a project of type ``Tour``. | ||
|
||
I notice a new tab ``Artworks``. | ||
|
||
.. image:: static/description/tour_form.png | ||
|
||
I can link artworks to the project. | ||
|
||
.. image:: static/description/tour_form_with_artworks.png | ||
|
||
Show Projects | ||
------------- | ||
I create a new project of type ``Show`` and select a tour as parent. | ||
|
||
.. image:: static/description/show_form.png | ||
|
||
I notice that the artworks were propagated from the parent tour. | ||
|
||
.. image:: static/description/show_form_artworks_propagated.png | ||
|
||
I can optionnaly add or remove artworks from the show. | ||
|
||
Contributors | ||
------------ | ||
* Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
|
||
More information | ||
---------------- | ||
* Meet us at https://bit.ly/numigi-com |
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,4 @@ | ||
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
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,15 @@ | ||
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Show Project Artwork", | ||
"summary": "Add promotion tab to projects", | ||
"version": "1.0.0", | ||
"website": "https://bit.ly/numigi-com", | ||
"author": "Numigi", | ||
"maintainer": "Numigi", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"depends": ["show_project", "musical_artwork"], | ||
"data": ["views/project_project.xml"], | ||
} |
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,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * show_project_artwork | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2021-03-18 17:54+0000\n" | ||
"PO-Revision-Date: 2021-03-18 17:54+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: show_project_artwork | ||
#: model:ir.model.fields,field_description:show_project_artwork.field_project_project__artwork_ids | ||
#: model_terms:ir.ui.view,arch_db:show_project_artwork.project_form | ||
msgid "Artworks" | ||
msgstr "Œuvres" | ||
|
||
#. module: show_project_artwork | ||
#: model:ir.model,name:show_project_artwork.model_project_project | ||
msgid "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,4 @@ | ||
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
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 @@ | ||
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ProjectProject(models.Model): | ||
|
||
_inherit = "project.project" | ||
|
||
artwork_ids = fields.Many2many( | ||
"musical.artwork", | ||
"project_musical_artwork_rel", | ||
"project_id", | ||
"artwork_id", | ||
"Artworks", | ||
) | ||
|
||
@api.onchange("parent_id") | ||
def _onchange_parent_propagate_artworks(self): | ||
if self.parent_id and self.show_type == "show": | ||
self.artwork_ids = self.parent_id.artwork_ids |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+84.2 KB
show_project_artwork/static/description/show_form_artworks_propagated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
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,23 @@ | ||
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import SavepointCase | ||
|
||
|
||
class TestShowProject(SavepointCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.artwork_1 = cls.env["musical.artwork"].create({"title": "Artwork 1"}) | ||
cls.artwork_2 = cls.env["musical.artwork"].create({"title": "Artwork 2"}) | ||
cls.tour = cls.env["project.project"].create( | ||
{"name": "Tour Project 1", "show_type": "tour"} | ||
) | ||
cls.tour.artwork_ids = cls.artwork_1 | cls.artwork_2 | ||
cls.show = cls.env["project.project"].create( | ||
{"name": "Show Project 1", "show_type": "show", "parent_id": cls.tour.id} | ||
) | ||
|
||
def test_artwork_propagation(self): | ||
self.show._onchange_parent_propagate_artworks() | ||
assert self.show.artwork_ids == self.artwork_1 | self.artwork_2 |
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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
|
||
<record id="project_form" model="ir.ui.view"> | ||
<field name="name">Project Form: add Artworks tab</field> | ||
<field name="model">project.project</field> | ||
<field name="inherit_id" ref="show_project.project_form"/> | ||
<field name="arch" type="xml"> | ||
<page name="show_venue" position="before"> | ||
<page | ||
string="Artworks" | ||
name="artworks" | ||
attrs="{'invisible': [('show_type', 'not in', ('tour', 'show'))]}" | ||
> | ||
<field name="artwork_ids" nolabel="1"> | ||
<tree> | ||
<field name="display_name"/> | ||
</tree> | ||
</field> | ||
</page> | ||
</page> | ||
</field> | ||
</record> | ||
|
||
</odoo> |