-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] event_track_task_code: Auto installable module to display the t…
…ask code in the session calendar.
- Loading branch information
1 parent
583d1f0
commit 2a11832
Showing
9 changed files
with
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. 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 | ||
|
||
===================== | ||
Event track task code | ||
===================== | ||
|
||
* Show project task code in event track calendar form. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
* Ana Juaristi <[email protected]> | ||
* Alfredo de la Fuente <[email protected]> |
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 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2018 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
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,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2018 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
{ | ||
"name": "Event Track Task Code", | ||
"version": "8.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "AvanzOSC", | ||
"website": "http://www.avanzosc.es", | ||
"contributors": [ | ||
"Ana Juaristi <[email protected]>", | ||
"Alfredo de la Fuente <[email protected]>", | ||
], | ||
"category": "Event Management", | ||
"depends": [ | ||
"sale_order_create_event", | ||
"project_task_code", | ||
], | ||
"data": [ | ||
"views/event_track_view.xml", | ||
], | ||
"installable": True, | ||
"auto-install": True, | ||
} |
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,33 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * event_track_task_code | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2018-03-09 09:32+0000\n" | ||
"PO-Revision-Date: 2018-03-09 09:32+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: event_track_task_code | ||
#: model:ir.model,name:event_track_task_code.model_event_track | ||
msgid "Event Tracks" | ||
msgstr "Sesiones del evento" | ||
|
||
#. module: event_track_task_code | ||
#: field:event.track,lit_task_code:0 | ||
msgid "Task code literal" | ||
msgstr "Literal código tarea" | ||
|
||
#. module: event_track_task_code | ||
#: code:addons/event_track_task_code/models/event_track.py:13 | ||
#, python-format | ||
msgid "Task code:" | ||
msgstr "Código tarea:" | ||
|
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 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2018 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from . import event_track |
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,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2018 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from openerp import models, fields, api, _ | ||
|
||
|
||
class EventTrack(models.Model): | ||
_inherit = 'event.track' | ||
|
||
@api.depends('task_id', 'task_id.code') | ||
def _compute_lit_task_code(self): | ||
for track in self: | ||
track.lit_task_code = u", {} {} ".format(_('Task code:'), | ||
track.task_id.code) | ||
|
||
lit_task_code = fields.Char( | ||
string='Task code literal', compute='_compute_lit_task_code', | ||
store=True) |
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 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2018 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from . import test_event_track_task_code |
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,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2018 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
import openerp.tests.common as common | ||
|
||
|
||
class TestEventTrackTaskCode(common.TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestEventTrackTaskCode, self).setUp() | ||
self.task = self.env['project.task'].create( | ||
{'name': 'Test event track task code', | ||
'code': 'TTTT-000021'}) | ||
self.session = self.env['event.track'].search([], limit=1) | ||
self.session.task_id = self.task.id | ||
|
||
def test_event_track_task_code(self): | ||
self.session._compute_lit_task_code() | ||
self.assertEqual( | ||
self.session.lit_task_code, ', Task code: TTTT-000021', | ||
'Bad literal for task code in event track') |
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
<record model="ir.ui.view" id="view_event_track_calendar_inh_task_code"> | ||
<field name="name">view.event.track.calendar.inh.task.code</field> | ||
<field name="model">event.track</field> | ||
<field name="inherit_id" ref="event_track_assistant.view_event_track_calendar_inh_assistant" /> | ||
<field name="arch" type="xml"> | ||
<field name="lit_presences" position="after"> | ||
<field name="lit_task_code" /> | ||
</field> | ||
</field> | ||
</record> | ||
</data> | ||
</openerp> |