diff --git a/.docker_files/main/__manifest__.py b/.docker_files/main/__manifest__.py index 506b96b1..e15dec43 100644 --- a/.docker_files/main/__manifest__.py +++ b/.docker_files/main/__manifest__.py @@ -16,6 +16,7 @@ "project_task_deadline_from_project", "project_task_editable_list_view", "project_task_full_text_search", + "project_track_end_date", "project_type_advanced", "project_default_task_stage", "project_stage_allow_timesheet", diff --git a/Dockerfile b/Dockerfile index ffb9e8e3..c972abde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ COPY project_task_date_planned /mnt/extra-addons/project_task_date_planned COPY project_task_deadline_from_project /mnt/extra-addons/project_task_deadline_from_project COPY project_task_editable_list_view /mnt/extra-addons/project_task_editable_list_view COPY project_task_full_text_search /mnt/extra-addons/project_task_full_text_search +COPY project_track_end_date /mnt/extra-addons/project_track_end_date COPY project_type_advanced /mnt/extra-addons/project_type_advanced COPY project_default_task_stage /mnt/extra-addons/project_default_task_stage diff --git a/gitoo.yml b/gitoo.yml index 920a52f4..ae77a433 100644 --- a/gitoo.yml +++ b/gitoo.yml @@ -7,6 +7,7 @@ branch: "16.0" includes: - project_task_dependency + - project_timeline - project_timesheet_time_control - project_type @@ -20,3 +21,4 @@ branch: "16.0" includes: - web_ir_actions_act_multi + - web_timeline diff --git a/project_track_end_date/README.rst b/project_track_end_date/README.rst new file mode 100644 index 00000000..286b36e6 --- /dev/null +++ b/project_track_end_date/README.rst @@ -0,0 +1,34 @@ +Project Track End Date +====================== +This module gives the possibility to trace the expiration date changes of each project. + +Usage +----- +***UPDATE OF EXPIRATION DATE*** +Changing the expiry date must be done by clicking on the `Edit Expiration Date` button: + +.. image:: static/description/edit_end_date_button.png + +The `Expiration Date` is now readonly and can only be modified using the new button. + +A popup wizard will open : + +.. image:: static/description/wizard_for_end_date_update.png + +This modification is listed among others in the following list. +The list is accessible from the smart button: + +.. image:: static/description/project_end_date_historics.png + +.. image:: static/description/project_end_date_historic_lines.png + +***EXPECTED DURATION OF A PROJECT*** + +I can also see that under the `Expiration Date` of project, in a view form, there is a new field `Expected Duration (in Weeks)`. +This field is calculated and updated each time the expiration date is revised, this makes it easy to use the number of weeks on the project. + +.. image:: static/description/expected_week_duration.png + +Contributors +------------ +* Numigi (tm) and all its contributors (https://bit.ly/numigiens) diff --git a/project_track_end_date/__init__.py b/project_track_end_date/__init__.py new file mode 100644 index 00000000..a62a99d9 --- /dev/null +++ b/project_track_end_date/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from . import models +from . import wizard diff --git a/project_track_end_date/__manifest__.py b/project_track_end_date/__manifest__.py new file mode 100644 index 00000000..6704bde7 --- /dev/null +++ b/project_track_end_date/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright 2023 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Project Track End Date", + "version": "16.0.1.0.0", + "author": "Numigi", + "maintainer": "Numigi", + "website": "https://bit.ly/numigi-com", + "license": "AGPL-3", + "category": "Project", + "description": "Track project expiration date changes", + "summary": """ + Gives the possibility to trace the changes in the end of + validity date of each project/Milestone. + """, + "depends": ["project_timeline"], + "data": [ + "security/ir.model.access.csv", + "views/project_project.xml", + "wizard/edit_date_wizard_views.xml", + ], + "installable": True, +} diff --git a/project_track_end_date/i18n/fr.po b/project_track_end_date/i18n/fr.po new file mode 100644 index 00000000..c8c523d0 --- /dev/null +++ b/project_track_end_date/i18n/fr.po @@ -0,0 +1,169 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * project_track_end_date +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-02-05 07:16+0000\n" +"PO-Revision-Date: 2024-02-05 07:16+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_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__user_id +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__user_id +msgid "Author" +msgstr "Utilisateur" + +#. module: project_track_end_date +#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard +msgid "Cancel" +msgstr "Annuler" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__company_id +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__company_id +msgid "Company" +msgstr "Société" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__create_uid +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__create_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__date +#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard +msgid "Date" +msgstr "Date" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__display_name +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: project_track_end_date +#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard +msgid "Edit Date" +msgstr "Modifier la date" + +#. module: project_track_end_date +#: model:ir.actions.act_window,name:project_track_end_date.wizard_edit_end_date +msgid "Edit Date Action" +msgstr "Modifier la date" + +#. module: project_track_end_date +#: model:ir.model,name:project_track_end_date.model_edit_date_wizard +msgid "Edit Date Wizard" +msgstr "Wizard de modification de la date" + +#. module: project_track_end_date +#: model_terms:ir.ui.view,arch_db:project_track_end_date.project_form_readonly_end_date +msgid "Edit End Date" +msgstr "Modifier la date de fin" + +#. module: project_track_end_date +#: model:ir.actions.act_window,name:project_track_end_date.action_view_project_end_history +#: model:ir.model.fields,field_description:project_track_end_date.field_project_project__project_end_history_count +#: model_terms:ir.ui.view,arch_db:project_track_end_date.ir_actions_project_end_history_tree +#: model_terms:ir.ui.view,arch_db:project_track_end_date.project_form_with_edit_end_date +msgid "End Date Changes Historics" +msgstr "Historiques des dates de fin de projet" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_project__expected_week_duration +msgid "Expected Duration (in Weeks)" +msgstr "Durée prévue (en semaine)" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__date +msgid "End Date" +msgstr "Date de fin" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_project__project_end_history_ids +msgid "Historics Associated to this Project" +msgstr "Historique associée au projet" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__id +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__id +msgid "ID" +msgstr "" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__initial_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__initial_date +msgid "Initial Date" +msgstr "Date initiale de fin de validité" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard____last_update +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history____last_update +msgid "Last Modified on" +msgstr "Dernière Modification le" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__write_uid +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__write_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__week_interval_date +msgid "Number of Reporting Weeks" +msgstr "Nombre de semaine de report" + +#. module: project_track_end_date +#: model:ir.model,name:project_track_end_date.model_project_project +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__project_id +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__project_id +msgid "Project" +msgstr "Projet" + +#. module: project_track_end_date +#: model:ir.model,name:project_track_end_date.model_project_end_history +msgid "Project End History" +msgstr "Historique d'échéance de projet" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_edit_date_wizard__reason +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__reason +#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard +msgid "Reason" +msgstr "Motif de modification" + +#. module: project_track_end_date +#: model_terms:ir.ui.view,arch_db:project_track_end_date.edit_date_wizard +msgid "Save" +msgstr "Mettre à jour" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__total_week_duration +msgid "Total Project Duration (Weeks)" +msgstr "Durée totale du projet (semaines)" + +#. module: project_track_end_date +#: model:ir.model.fields,field_description:project_track_end_date.field_project_end_history__update_on +msgid "Update on" +msgstr "Mis à jour le" diff --git a/project_track_end_date/models/__init__.py b/project_track_end_date/models/__init__.py new file mode 100644 index 00000000..02cf7386 --- /dev/null +++ b/project_track_end_date/models/__init__.py @@ -0,0 +1,7 @@ +# Copyright 2023 - 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, + project_end_history, +) diff --git a/project_track_end_date/models/project_end_history.py b/project_track_end_date/models/project_end_history.py new file mode 100644 index 00000000..4b95ab24 --- /dev/null +++ b/project_track_end_date/models/project_end_history.py @@ -0,0 +1,19 @@ +# Copyright 2023 - 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 fields, models + + +class ProjectEndHistory(models.Model): + _name = "project.end.history" + _description = "Project End History" + + update_on = fields.Datetime(string="Update on") + initial_date = fields.Date(string="Initial Date") + date = fields.Date(string="Date") + week_interval_date = fields.Float(string="Number of Reporting Weeks") + total_week_duration = fields.Float(string="Total Project Duration (Weeks)") + company_id = fields.Many2one("res.company", string="Company") + user_id = fields.Many2one("res.users", string="Author") + reason = fields.Text("Reason") + project_id = fields.Many2one("project.project", string="Project") diff --git a/project_track_end_date/models/project_project.py b/project_track_end_date/models/project_project.py new file mode 100644 index 00000000..0f55abcd --- /dev/null +++ b/project_track_end_date/models/project_project.py @@ -0,0 +1,47 @@ +# Copyright 2023 - 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 fields, models + + +class ProjectProject(models.Model): + _inherit = "project.project" + + project_end_history_ids = fields.One2many( + "project.end.history", + "project_id", + string="Historics Associated to this Project", + ) + project_end_history_count = fields.Integer( + string="End Date Changes Historics", + compute="_compute_project_end_history", + groups="project.group_project_manager", + ) + expected_week_duration = fields.Float( + string="Expected Duration (in Weeks)", + compute="_compute_expected_week_duration", + ) + + def _compute_expected_week_duration(self): + for project in self: + project.expected_week_duration = ( + (project.date - project.date_start).days / 7 + if project.date and project.date_start + else 0 + ) + + def _compute_project_end_history(self): + for project in self: + project.project_end_history_count = len(project.project_end_history_ids) + + def action_edit_expiration_date(self): + self.ensure_one() + action = self.env.ref("project_track_end_date.wizard_edit_end_date").read()[0] + action["context"] = { + "default_initial_date": self.date, + "default_date": self.date, + "default_project_id": self.id, + "default_user_id": self.env.user.id, + "default_company_id": self.company_id.id, + } + return action diff --git a/project_track_end_date/security/ir.model.access.csv b/project_track_end_date/security/ir.model.access.csv new file mode 100644 index 00000000..66f83495 --- /dev/null +++ b/project_track_end_date/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_project_end_history_project_manager,project_end_history_project_manager,model_project_end_history,project.group_project_manager,1,0,0,0 +edit_date_wizard_user,edit_date_wizard_user,model_edit_date_wizard,base.group_user,1,1,1,1 diff --git a/project_track_end_date/static/description/edit_end_date_button.png b/project_track_end_date/static/description/edit_end_date_button.png new file mode 100644 index 00000000..d14850cc Binary files /dev/null and b/project_track_end_date/static/description/edit_end_date_button.png differ diff --git a/project_track_end_date/static/description/expected_week_duration.png b/project_track_end_date/static/description/expected_week_duration.png new file mode 100644 index 00000000..92a06895 Binary files /dev/null and b/project_track_end_date/static/description/expected_week_duration.png differ diff --git a/project_track_end_date/static/description/icon.png b/project_track_end_date/static/description/icon.png new file mode 100644 index 00000000..92a86b10 Binary files /dev/null and b/project_track_end_date/static/description/icon.png differ diff --git a/project_track_end_date/static/description/project_end_date_historic_lines.png b/project_track_end_date/static/description/project_end_date_historic_lines.png new file mode 100644 index 00000000..246cd009 Binary files /dev/null and b/project_track_end_date/static/description/project_end_date_historic_lines.png differ diff --git a/project_track_end_date/static/description/project_end_date_historics.png b/project_track_end_date/static/description/project_end_date_historics.png new file mode 100644 index 00000000..a1a9e4f9 Binary files /dev/null and b/project_track_end_date/static/description/project_end_date_historics.png differ diff --git a/project_track_end_date/static/description/wizard_for_end_date_update.png b/project_track_end_date/static/description/wizard_for_end_date_update.png new file mode 100644 index 00000000..9d01f284 Binary files /dev/null and b/project_track_end_date/static/description/wizard_for_end_date_update.png differ diff --git a/project_track_end_date/tests/__init__.py b/project_track_end_date/tests/__init__.py new file mode 100644 index 00000000..2ee96a41 --- /dev/null +++ b/project_track_end_date/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2023 - 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 test_project_end_historic diff --git a/project_track_end_date/tests/test_project_end_historic.py b/project_track_end_date/tests/test_project_end_historic.py new file mode 100644 index 00000000..aa041bad --- /dev/null +++ b/project_track_end_date/tests/test_project_end_historic.py @@ -0,0 +1,61 @@ +# Copyright 2023 - 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 +from odoo.exceptions import UserError + +from datetime import date + + +class TestProjectEndHistoric(SavepointCase): + @classmethod + def setUpClass(cls): + super(TestProjectEndHistoric, cls).setUpClass() + + # Test 'Numigi' project + cls.project = ( + cls.env["project.project"] + .with_context({"mail_create_nolog": True}) + .create( + { + "name": "Numigi", + "date_start": date(2023, 1, 1), + "date": date(2023, 1, 8), + } + ) + ) + + cls.action_context = { + "default_initial_date": cls.project.date, + "default_date": cls.project.date, + "default_project_id": cls.project.id, + "default_user_id": cls.env.user.id, + "default_company_id": cls.env.user.company_id.id, + } + + def test_action_to_wizard(self): + action = self.project.action_edit_expiration_date() + + self.assertEqual(action["context"], self.action_context) + + def update_failed_according_to_stage(self): + with self.assertRaises(UserError): + self.project.write({"date": date(2023, 1, 15)}) + + def test_update_date_from_wizard(self): + vals = { + "reason": "Project postponed", + } + res = ( + self.env["edit.date.wizard"].with_context(self.action_context).create(vals) + ) + res.date = date(2023, 1, 15) + res.refresh() + res.action_update_date() + self.assertEqual(self.project.date, date(2023, 1, 15)) + self.assertEqual(self.project.project_end_history_count, 1) + self.assertTrue(self.project.project_end_history_ids) + for history in self.project.project_end_history_ids: + self.assertEqual(history.week_interval_date, 1) + self.assertEqual(history.total_week_duration, 2) + self.assertEqual(self.project.expected_week_duration, 2) diff --git a/project_track_end_date/views/project_project.xml b/project_track_end_date/views/project_project.xml new file mode 100644 index 00000000..740001aa --- /dev/null +++ b/project_track_end_date/views/project_project.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<odoo> + <record id="ir_actions_project_end_history_tree" model="ir.ui.view"> + <field name="model">project.end.history</field> + <field name="name">End Date Changes Historics</field> + <field name="arch" type="xml"> + <tree string="End Date Changes Historics"> + <field name="update_on" /> + <field name="reason" /> + <field name="project_id" invisible="1" /> + <field name="initial_date" /> + <field name="date" /> + <field name="week_interval_date" /> + <field name="total_week_duration" /> + </tree> + </field> + </record> + + <record id="action_view_project_end_history" model="ir.actions.act_window"> + <field name="name">End Date Changes Historics</field> + <field name="res_model">project.end.history</field> + <field name="view_mode">tree,form</field> + <field name="view_id" ref="ir_actions_project_end_history_tree" /> + <field name="context">{ + 'search_default_user_id': [uid], + 'search_default_project_id': [active_id], + 'default_project_id': active_id, + 'default_user_id': uid, + } + </field> + <field name="domain">[('project_id', '=', active_id)]</field> + </record> + + <record id="project_form_with_edit_end_date" model="ir.ui.view"> + <field name="name">Project Form With Edit End Date</field> + <field name="model">project.project</field> + <field name="inherit_id" ref="project.edit_project" /> + <field name="arch" type="xml"> + <xpath expr="//div[hasclass('oe_button_box')]" position="inside"> + <button name="%(action_view_project_end_history)d" attrs="{'invisible': [('project_end_history_count', '=', 0)]}" + type="action" class="oe_stat_button order-9" icon="fa-list" groups="project.group_project_manager"> + <field name="project_end_history_count" widget="statinfo" string="End Date Changes Historics" /> + </button> + </xpath> + </field> + </record> + + <record id="project_form_readonly_end_date" model="ir.ui.view"> + <field name="name">Project Form Readonly End Date</field> + <field name="model">project.project</field> + <field name="inherit_id" ref="project.edit_project" /> + <field name="arch" type="xml"> + <field name="date" position="attributes"> + <attribute name="readonly">1</attribute> + </field> + <xpath expr="//field[@name='date']" position="after"> + + <button name="action_edit_expiration_date" type="object" string="Edit End Date" class="btn-primary" groups="project.group_project_manager" /> + + + + + </xpath> + <xpath expr="//div[@name='dates']" position="after"> + + <!-- <label for="expected_week_duration"/> --> + <field name="expected_week_duration" attrs="{'invisible': [('expected_week_duration', '=', 0)]}" /> + </xpath> + </field> + </record> + + <!-- <div > --> + <!-- class="text-center" style="margin-bottom:15px;" --> + <!-- <button name="action_edit_expiration_date" type="object" string="Edit End Date" class="oe_inline btn-primary" groups="project.group_project_manager" /> + </div> + <label for="expected_week_duration"/> + <field name="expected_week_duration" no_label="1" attrs="{'invisible': [('expected_week_duration', '=', 0)]}" /> --> + +</odoo> diff --git a/project_track_end_date/wizard/__init__.py b/project_track_end_date/wizard/__init__.py new file mode 100644 index 00000000..e07bf3b8 --- /dev/null +++ b/project_track_end_date/wizard/__init__.py @@ -0,0 +1,6 @@ +# Copyright 2023 - 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 ( + edit_date_wizard, +) diff --git a/project_track_end_date/wizard/edit_date_wizard.py b/project_track_end_date/wizard/edit_date_wizard.py new file mode 100644 index 00000000..486c762f --- /dev/null +++ b/project_track_end_date/wizard/edit_date_wizard.py @@ -0,0 +1,41 @@ +# Copyright 2023 - 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 fields, models + + +class EditDateWizard(models.TransientModel): + _name = "edit.date.wizard" + _description = "Edit Date Wizard" + + initial_date = fields.Date(string="Initial Date") + date = fields.Date(string="End Date") + company_id = fields.Many2one("res.company", string="Company") + user_id = fields.Many2one("res.users", string="Author") + reason = fields.Text("Reason") + project_id = fields.Many2one("project.project", string="Project") + + def action_update_date(self): + self.ensure_one() + data = { + "update_on": self.create_date, + "initial_date": self.initial_date, + "date": self.date, + "week_interval_date": ( + (self.date - self.initial_date).days / 7 + if self.initial_date and self.date + else False + ), + "total_week_duration": ( + (self.date - self.project_id.date_start).days / 7 + if self.project_id.date_start and self.date + else False + ), + "company_id": self.company_id.id, + "user_id": self.user_id.id, + "reason": self.reason, + "project_id": self.project_id.id, + } + self.env["project.end.history"].sudo().create(data) + self.project_id.date = self.date + return {"type": "ir.actions.act_window_close"} diff --git a/project_track_end_date/wizard/edit_date_wizard_views.xml b/project_track_end_date/wizard/edit_date_wizard_views.xml new file mode 100644 index 00000000..e8a6b3f6 --- /dev/null +++ b/project_track_end_date/wizard/edit_date_wizard_views.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="edit_date_wizard" model="ir.ui.view"> + <field name="name">Edit Date Wizard View</field> + <field name="model">edit.date.wizard</field> + <field name="arch" type="xml"> + <form string="Edit Date"> + <div class="oe_title"> + <h1> + <field name="reason" required="1" placeholder="Reason" /> + </h1> + </div> + <group> + <field name="initial_date" invisible="1" /> + <field name="date" required="1" placeholder="Date" /> + <field name="project_id" readonly="1" /> + <field name="user_id" readonly="1" /> + <field name="company_id" readonly="1" groups="base.group_multi_company" /> + </group> + <footer> + <button string="Save" name="action_update_date" type="object" class="btn-primary" /> + <button string="Cancel" class="btn-default" special="cancel" /> + </footer> + </form> + </field> + </record> + + <record id="wizard_edit_end_date" model="ir.actions.act_window"> + <field name="name">Edit Date Action</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">edit.date.wizard</field> + <field name="view_id" ref="edit_date_wizard" /> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> +</odoo> \ No newline at end of file