Skip to content

Commit

Permalink
[MIG] event_project: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernesto Tejeda committed Jan 17, 2022
1 parent a54b2f6 commit 8382930
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 36 deletions.
10 changes: 5 additions & 5 deletions event_project/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Event project
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github
:target: https://github.com/OCA/event/tree/12.0/event_project
:target: https://github.com/OCA/event/tree/14.0/event_project
:alt: OCA/event
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/event-12-0/event-12-0-event_project
:target: https://translation.odoo-community.org/projects/event-14-0/event-14-0-event_project
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/199/12.0
:target: https://runbot.odoo-community.org/runbot/199/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -56,7 +56,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/event/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/event/issues/new?body=module:%20event_project%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/event/issues/new?body=module:%20event_project%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -94,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/event <https://github.com/OCA/event/tree/12.0/event_project>`_ project on GitHub.
This module is part of the `OCA/event <https://github.com/OCA/event/tree/14.0/event_project>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions event_project/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Event project",
"version": "12.0.1.0.0",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
"version": "14.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/event",
"license": "AGPL-3",
"category": "Event Management",
Expand Down
19 changes: 2 additions & 17 deletions event_project/models/event_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ class EventEvent(models.Model):
)
count_tasks = fields.Integer(
string="Task number",
compute="_count_tasks",
compute="_compute_count_tasks",
)

@api.multi
@api.depends("task_ids")
def _count_tasks(self):
def _compute_count_tasks(self):
for event in self:
event.count_tasks = len(event.task_ids)

Expand Down Expand Up @@ -63,7 +62,6 @@ def create(self, vals):
event.project_data_update(vals)
return event

@api.multi
def write(self, vals):
if vals.get("project_id") is not None and not vals.get("project_id"):
self.mapped("project_id").write({"event_id": False})
Expand All @@ -73,16 +71,3 @@ def write(self, vals):
if recalculate and not self.env.context.get("no_recalculate"):
self.project_id.project_recalculate()
return res

@api.multi
def button_cancel(self):
"""Archive linked project when event is cancelled"""
super(EventEvent, self).button_cancel()
self.mapped("project_id").write({"active": False})

@api.multi
def button_draft(self):
"""Uncharchive linked project when event is set to draft again"""
super(EventEvent, self).button_draft()
if self.project_id:
self.project_id.active = True
8 changes: 4 additions & 4 deletions event_project/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Event project</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Event project</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/event/tree/12.0/event_project"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/event-12-0/event-12-0-event_project"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/199/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/event/tree/14.0/event_project"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/event-14-0/event-14-0-event_project"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/199/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to assign a project to an event. This project will
inherit its event’s name an its due date will be set as the event’s begining
date.</p>
Expand Down Expand Up @@ -404,7 +404,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/event/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20event_project%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20event_project%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -437,7 +437,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/12.0/event_project">OCA/event</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/14.0/event_project">OCA/event</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
6 changes: 0 additions & 6 deletions event_project/tests/test_event_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,3 @@ def test_03_project_change(self):
self.assertEqual(self.event.project_id.date, self.event.date_begin.date())
self.assertEqual(self.event.display_name, self.event.project_id.name)
self.assertEqual(self.event.count_tasks, 1)

def test_04_cancel_and_draft_event(self):
self.event.button_cancel()
self.assertFalse(self.event.project_id.active)
self.event.button_draft()
self.assertTrue(self.event.project_id.active)
1 change: 0 additions & 1 deletion event_project/views/event_event_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<!-- Action for smartbutton in event form view -->
<record id="act_event_task_list" model="ir.actions.act_window">
<field name="res_model">project.task</field>
<field name="view_type">form</field>
<field name="name">Tasks</field>
<field name="view_mode">tree,kanban,form,calendar,graph</field>
<field name="context">{'default_event_id': active_id}</field>
Expand Down
2 changes: 1 addition & 1 deletion oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt
project

0 comments on commit 8382930

Please sign in to comment.