Skip to content

Commit

Permalink
TA#41071 add show_appearance_type (#141)
Browse files Browse the repository at this point in the history
* T#008768 - PO18000211 - #41071 - Gestion du type d'affiche

* Adjust description image

* Apply 1 suggestion(s) to 1 file(s)

* Update fr.po

* Update project_project.py

* Add module to dockerfile

Co-authored-by: cuong.nmtm <[email protected]>
Co-authored-by: David Dufresne <[email protected]>
  • Loading branch information
3 people authored Jan 11, 2022
1 parent 39e8163 commit 179c7a3
Show file tree
Hide file tree
Showing 18 changed files with 271 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"recording_tag",
"recording_url_link",
"recording_version",
"show_appearance_type",
"show_place",
"show_project",
"show_project_access",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ COPY recording_subgenre /mnt/extra-addons/recording_subgenre
COPY recording_tag /mnt/extra-addons/recording_tag
COPY recording_url_link /mnt/extra-addons/recording_url_link
COPY recording_version /mnt/extra-addons/recording_version
COPY show_appearance_type /mnt/extra-addons/show_appearance_type
COPY show_place /mnt/extra-addons/show_place
COPY show_project /mnt/extra-addons/show_project
COPY show_project_access /mnt/extra-addons/show_project_access
Expand Down
34 changes: 34 additions & 0 deletions show_appearance_type/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Show Appearance Type
=========================

Description
-----------

The Appearance Types menu item is available to members of the group ``Project / Manager``
through the ``Project / Configuration`` menu.

It shows the list of Appearance Types.

.. image:: static/description/show_appearance_type_list.png

By clicking on a Appearance Types, the form view is opened.

.. image:: static/description/show_appearance_type_form.png

On project form view, a new field Appearance Type is showed

.. image:: static/description/project_show_appearance_type.png

Configuration
-------------

No configuration required apart from module installation.

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)
* Komit (https://komit-consulting.com)

More information
----------------
* Meet us at https://bit.ly/numigi-com
4 changes: 4 additions & 0 deletions show_appearance_type/__init__.py
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 LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
18 changes: 18 additions & 0 deletions show_appearance_type/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Show Appearance Type",
"summary": "Add new object Show Appearance Type and new field Appearance Type on Project",
"version": "1.0.0",
"website": "https://bit.ly/numigi-com",
"author": "Numigi",
"maintainer": "Numigi",
"license": "LGPL-3",
"installable": True,
"depends": ["show_project"],
"data": [
"security/ir.model.access.csv",
"views/project_project.xml",
"views/show_appearance_type.xml",
],
}
87 changes: 87 additions & 0 deletions show_appearance_type/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * show_appearance_type
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-29 19:09+0000\n"
"PO-Revision-Date: 2021-12-29 19:09+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_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__active
msgid "Active"
msgstr "Actif"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_project_project__show_appearance_type_id
msgid "Appearance Type"
msgstr "Type d’affiche"

#. module: show_appearance_type
#: model:ir.actions.act_window,name:show_appearance_type.show_appearance_type_action
#: model:ir.ui.menu,name:show_appearance_type.show_appearance_type_menu
msgid "Appearance Types"
msgstr "Types d’affiche"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__create_uid
msgid "Created by"
msgstr "Créé par"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__create_date
msgid "Created on"
msgstr "Créé le"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__description
msgid "Description"
msgstr "Description"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__display_name
msgid "Display Name"
msgstr "Nom affiché"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__id
msgid "ID"
msgstr "ID"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"

#. module: show_appearance_type
#: model:ir.model.fields,field_description:show_appearance_type.field_show_appearance_type__name
msgid "Name"
msgstr "Nom"

#. module: show_appearance_type
#: model:ir.model,name:show_appearance_type.model_project_project
msgid "Project"
msgstr "Projet"

#. module: show_appearance_type
#: model:ir.model,name:show_appearance_type.model_show_appearance_type
msgid "Show Appearance Type"
msgstr "Afficher le type d'affiche"
5 changes: 5 additions & 0 deletions show_appearance_type/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import project_project
from . import show_appearance_type
14 changes: 14 additions & 0 deletions show_appearance_type/models/project_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import fields, models


class ProjectProject(models.Model):
_inherit = "project.project"

show_appearance_type_id = fields.Many2one(
"show.appearance.type",
"Appearance Type",
ondelete="restrict",
)
13 changes: 13 additions & 0 deletions show_appearance_type/models/show_appearance_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import fields, models


class ShowAppearanceType(models.Model):
_name = "show.appearance.type"
_description = "Show Appearance Type"

name = fields.Char(required=True)
description = fields.Text()
active = fields.Boolean(default=True)
3 changes: 3 additions & 0 deletions show_appearance_type/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_show_appearance_type_user,name_show_appearance_type_user,model_show_appearance_type,project.group_project_user,1,0,0,0
access_show_appearance_type_manager,name_show_appearance_type_manager,model_show_appearance_type,project.group_project_manager,1,1,1,1
Binary file added show_appearance_type/static/description/icon.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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions show_appearance_type/tests/__init__.py
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 LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import test_show_appearance_type
13 changes: 13 additions & 0 deletions show_appearance_type/tests/test_show_appearance_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# © 2021 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo.tests.common import SavepointCase


class TestShowProject(SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()

def test_create_appearance_type(self):
self.env["show.appearance.type"].create({"name": "Test", "description": "Test"})
16 changes: 16 additions & 0 deletions show_appearance_type/views/project_project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>

<record id="project_form" model="ir.ui.view">
<field name="name">show.appearance.type.project.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="show_project.project_form"/>
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='showcase']" position="after">
<field name="show_appearance_type_id" attrs="{'invisible': [('show_type', '!=', 'show')]}"/>
</xpath>
</field>
</record>

</odoo>
58 changes: 58 additions & 0 deletions show_appearance_type/views/show_appearance_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>

<record id="show_appearance_type_view_search" model="ir.ui.view">
<field name="name">show.appearance.type.view.search</field>
<field name="model">show.appearance.type</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="description"/>
</search>
</field>
</record>

<record id="show_appearance_type_view_tree" model="ir.ui.view">
<field name="name">show.appearance.type.view.tree</field>
<field name="model">show.appearance.type</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="active"/>
</tree>
</field>
</record>

<record id="show_appearance_type_view_form" model="ir.ui.view">
<field name="name">show.appearance.type.view.tree</field>
<field name="model">show.appearance.type</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="description"/>
<field name="active"/>
</group>
</group>
</sheet>
</form>
</field>
</record>

<record id="show_appearance_type_action" model="ir.actions.act_window">
<field name="name">Appearance Types</field>
<field name="res_model">show.appearance.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>

<menuitem id="show_appearance_type_menu"
name="Appearance Types"
action="show_appearance_type_action"
parent="project.menu_project_config"
sequence="15"
/>

</odoo>

0 comments on commit 179c7a3

Please sign in to comment.