Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][ADD] project_task_dates_and_users: In project task 4 new field… #300

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions project_task_dates_and_users/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. 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 task dates and users
============================

* In project task 4 new fields: "Date done", "User date done", "Revised date",
and "User revised date".
* The person who puts the "Date done" should appear next to it automatically,
and the same with "Date Revised".

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>
1 change: 1 addition & 0 deletions project_task_dates_and_users/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions project_task_dates_and_users/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Project Task Dates And Users",
"version": "16.0.1.0.0",
"category": "Services/Project",
"license": "AGPL-3",
"author": "AvanzOSC",
"website": "https://github.com/avanzosc/project-addons",
"contributors": [
"Ana Juaristi <anajuaristi@avanzosc.es>",
"Alfredo de la Fuente <alfredodelafuente@avanzosc.es>",
],
"depends": [
"project",
],
"data": [
"views/project_task_view.xml",
],
"installable": True,
}
45 changes: 45 additions & 0 deletions project_task_dates_and_users/i18n/ca_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_dates_and_users
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-28 10:45+0000\n"
"PO-Revision-Date: 2024-11-28 10:45+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_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__date_done
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__revised_date
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Revised date"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model,name:project_task_dates_and_users.model_project_task
msgid "Task"
msgstr "Tasca"

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_date_done_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_revised_date_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User revised date"
msgstr ""
45 changes: 45 additions & 0 deletions project_task_dates_and_users/i18n/en_GB.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_dates_and_users
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-28 10:45+0000\n"
"PO-Revision-Date: 2024-11-28 10:45+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_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__date_done
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__revised_date
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Revised date"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model,name:project_task_dates_and_users.model_project_task
msgid "Task"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_date_done_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_revised_date_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User revised date"
msgstr ""
45 changes: 45 additions & 0 deletions project_task_dates_and_users/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_dates_and_users
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-28 10:46+0000\n"
"PO-Revision-Date: 2024-11-28 10:46+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_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__date_done
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Date done"
msgstr "Fecha realizado"

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__revised_date
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Revised date"
msgstr "Fecha revisado"

#. module: project_task_dates_and_users
#: model:ir.model,name:project_task_dates_and_users.model_project_task
msgid "Task"
msgstr "Tarea"

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_date_done_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User date done"
msgstr "Usuario fecha realizado"

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_revised_date_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User revised date"
msgstr "Usuario fecha revisado"
45 changes: 45 additions & 0 deletions project_task_dates_and_users/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_dates_and_users
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-28 10:46+0000\n"
"PO-Revision-Date: 2024-11-28 10:46+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_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__date_done
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__revised_date
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Revised date"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model,name:project_task_dates_and_users.model_project_task
msgid "Task"
msgstr "Tâche"

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_date_done_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_revised_date_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User revised date"
msgstr ""
45 changes: 45 additions & 0 deletions project_task_dates_and_users/i18n/project_task_dates_and_users.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_dates_and_users
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-28 10:45+0000\n"
"PO-Revision-Date: 2024-11-28 10:45+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_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__date_done
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__revised_date
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "Revised date"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model,name:project_task_dates_and_users.model_project_task
msgid "Task"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_date_done_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User date done"
msgstr ""

#. module: project_task_dates_and_users
#: model:ir.model.fields,field_description:project_task_dates_and_users.field_project_task__user_revised_date_id
#: model_terms:ir.ui.view,arch_db:project_task_dates_and_users.view_task_search_form
msgid "User revised date"
msgstr ""
1 change: 1 addition & 0 deletions project_task_dates_and_users/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import project_task
32 changes: 32 additions & 0 deletions project_task_dates_and_users/models/project_task.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2024 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models


class ProjectTask(models.Model):
_inherit = "project.task"

date_done = fields.Date(string="Date done")
revised_date = fields.Date(string="Revised date")
user_date_done_id = fields.Many2one(
string="User date done",
compute="_compute_user_date_done_id",
comodel_name="res.partner",
store=True,
)
user_revised_date_id = fields.Many2one(
string="User revised date",
compute="_compute_user_revised_date_id",
comodel_name="res.partner",
store=True,
)

@api.depends("date_done")
def _compute_user_date_done_id(self):
for task in self.filtered(lambda x: x.date_done):
task.user_date_done_id = self.env.user.partner_id.id

@api.depends("revised_date")
def _compute_user_revised_date_id(self):
for task in self.filtered(lambda x: x.revised_date):
task.user_revised_date_id = self.env.user.partner_id.id
63 changes: 63 additions & 0 deletions project_task_dates_and_users/views/project_task_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_task_search_form" model="ir.ui.view">
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_search_form" />
<field name="arch" type="xml">
<field name="stage_id" position="after">
<field name="date_done" />
<field name="revised_date" />
<field name="user_date_done_id" />
<field name="user_revised_date_id" />
</field>
<filter name="kanban_state" position="after">
<filter
string="Date done"
name="group-date-done"
context="{'group_by':'date_done'}"
/>
<filter
string="Revised date"
name="group-revised-date"
context="{'group_by':'revised_date'}"
/>
<filter
string="User date done"
name="group-user-date-done"
context="{'group_by':'user_date_done_id'}"
/>
<filter
string="User revised date"
name="group-user-revised-date"
context="{'group_by':'user_revised_date_id'}"
/>
</filter>
</field>
</record>

<record id="view_task_form2" model="ir.ui.view">
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2" />
<field name="arch" type="xml">
<field name="date_deadline" position="after">
<field name="date_done" />
<field name="user_date_done_id" />
<field name="revised_date" />
<field name="user_revised_date_id" />
</field>
</field>
</record>

<record id="view_task_tree2" model="ir.ui.view">
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_tree2" />
<field name="arch" type="xml">
<field name="stage_id" position="before">
<field name="date_done" optional="show" />
<field name="user_date_done_id" readonly="1" optional="show" />
<field name="revised_date" optional="show" />
<field name="user_revised_date_id" readonly="1" optional="show" />
</field>
</field>
</record>
</odoo>
6 changes: 6 additions & 0 deletions setup/project_task_dates_and_users/setup.py
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,
)
Loading