Skip to content

Commit

Permalink
[IMP] project_task_meeting (avanzosc#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis authored Aug 6, 2024
1 parent 447aa86 commit b80985c
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 24 deletions.
48 changes: 40 additions & 8 deletions project_task_meeting/i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_meeting
# * project_task_meeting
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-05-10 07:16+0000\n"
"PO-Revision-Date: 2021-05-10 07:16+0000\n"
"Last-Translator: <>\n"
"POT-Creation-Date: 2024-07-19 11:14+0000\n"
"PO-Revision-Date: 2024-07-19 11:14+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -22,11 +22,39 @@ msgstr "# Reuniones"

#. module: project_task_meeting
#: model:ir.model,name:project_task_meeting.model_calendar_event
msgid "Event"
msgstr "Evento"
msgid "Calendar Event"
msgstr "Evento de calendario"

#. module: project_task_meeting
#: code:addons/project_task_meeting/models/project_task.py:46
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event__display_name
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task__display_name
msgid "Display Name"
msgstr "Nombre mostrado"

#. module: project_task_meeting
#: code:addons/project_task_meeting/models/calendar_event.py:0
#: code:addons/temp-addons/project_task_meeting/models/calendar_event.py:0
#, python-format
msgid "Grouping by %s is not allowed."
msgstr "Agrupar por %s no está permitido."

#. module: project_task_meeting
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event__id
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task__id
msgid "ID"
msgstr ""

#. module: project_task_meeting
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event____last_update
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task____last_update
msgid "Last Modified on"
msgstr "Última modificación el"

#. module: project_task_meeting
#: code:addons/github/avanzosc/project-addons/project_task_meeting/models/project_task.py:0
#: code:addons/project_task_meeting/models/project_task.py:0
#: code:addons/project_task_meeting/models/project_task.py:0
#: code:addons/temp-addons/project_task_meeting/models/project_task.py:0
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task__calendar_event_ids
#: model_terms:ir.ui.view,arch_db:project_task_meeting.view_task_form2
#, python-format
Expand All @@ -40,3 +68,7 @@ msgstr "Reuniones"
msgid "Task"
msgstr "Tarea"

#. module: project_task_meeting
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event__task_partner_id
msgid "Task Customer"
msgstr "Tarea de Cliente"
46 changes: 39 additions & 7 deletions project_task_meeting/i18n/project_task_meeting.pot
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_task_meeting
# * project_task_meeting
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-05-10 07:16+0000\n"
"PO-Revision-Date: 2021-05-10 07:16+0000\n"
"Last-Translator: <>\n"
"POT-Creation-Date: 2024-07-19 11:15+0000\n"
"PO-Revision-Date: 2024-07-19 11:15+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -22,11 +22,39 @@ msgstr ""

#. module: project_task_meeting
#: model:ir.model,name:project_task_meeting.model_calendar_event
msgid "Event"
msgid "Calendar Event"
msgstr ""

#. module: project_task_meeting
#: code:addons/project_task_meeting/models/project_task.py:46
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event__display_name
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task__display_name
msgid "Display Name"
msgstr ""

#. module: project_task_meeting
#: code:addons/project_task_meeting/models/calendar_event.py:0
#: code:addons/temp-addons/project_task_meeting/models/calendar_event.py:0
#, python-format
msgid "Grouping by %s is not allowed."
msgstr ""

#. module: project_task_meeting
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event__id
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task__id
msgid "ID"
msgstr ""

#. module: project_task_meeting
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event____last_update
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task____last_update
msgid "Last Modified on"
msgstr ""

#. module: project_task_meeting
#: code:addons/github/avanzosc/project-addons/project_task_meeting/models/project_task.py:0
#: code:addons/project_task_meeting/models/project_task.py:0
#: code:addons/project_task_meeting/models/project_task.py:0
#: code:addons/temp-addons/project_task_meeting/models/project_task.py:0
#: model:ir.model.fields,field_description:project_task_meeting.field_project_task__calendar_event_ids
#: model_terms:ir.ui.view,arch_db:project_task_meeting.view_task_form2
#, python-format
Expand All @@ -40,3 +68,7 @@ msgstr ""
msgid "Task"
msgstr ""

#. module: project_task_meeting
#: model:ir.model.fields,field_description:project_task_meeting.field_calendar_event__task_partner_id
msgid "Task Customer"
msgstr ""
40 changes: 32 additions & 8 deletions project_task_meeting/models/calendar_event.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# Copyright 2021 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
from odoo.exceptions import AccessError
from odoo.tools.translate import _

from odoo.addons.calendar.models.calendar_attendee import Attendee
from odoo.addons.calendar.models.calendar_event import Meeting


class CalendarEvent(models.Model):
_inherit = "calendar.event"

attendee_status = fields.Selection(
Attendee.STATE_SELECTION,
string="Attendee Status",
compute="_compute_attendee",
store="True",
)

task_id = fields.Many2one(
string="Task",
comodel_name="project.task",
Expand All @@ -32,3 +27,32 @@ def _get_public_fields(self):
result = super(CalendarEvent, self)._get_public_fields()
result |= {"task_id"}
return result

def read_group(
self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True
):
groupby = [groupby] if isinstance(groupby, str) else groupby
grouped_fields = {group_field.split(":")[0] for group_field in groupby}
private_fields = grouped_fields - self._get_public_fields()
private_fields.discard("state")
if not self.env.su and private_fields:
raise AccessError(
_(
"Grouping by %s is not allowed.",
", ".join(
[
self._fields[field_name].string
for field_name in private_fields
]
),
)
)
return super(Meeting, self).read_group(
domain,
fields,
groupby,
offset=offset,
limit=limit,
orderby=orderby,
lazy=lazy,
)
4 changes: 3 additions & 1 deletion project_task_meeting/views/calendar_event_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="task_id" />
</field>
<xpath expr="//tree" position="inside">
<field name="attendee_status" optional="show" />
<field name="attendee_status" optional="hide" />
<field name="task_partner_id" optional="show" />
</xpath>
</field>
Expand All @@ -28,6 +28,7 @@
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="task_id" />
<field name="state" />
</field>
<filter name="availability" position="after">
<filter
Expand All @@ -36,6 +37,7 @@
domain="[]"
context="{'group_by':'task_id'}"
/>
<filter name="group-state" domain="[]" context="{'group_by':'state'}" />
</filter>
</field>
</record>
Expand Down

0 comments on commit b80985c

Please sign in to comment.