Skip to content

Commit d99be82

Browse files
committed
[19.0][MIG] website_event_questions_by_ticket: Migration to 19.0
1 parent 1f442df commit d99be82

10 files changed

Lines changed: 65 additions & 41 deletions

File tree

website_event_questions_by_ticket/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Conditional Events Questions
2121
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
2222
:alt: License: LGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github
24-
:target: https://github.com/OCA/event/tree/18.0/website_event_questions_by_ticket
24+
:target: https://github.com/OCA/event/tree/19.0/website_event_questions_by_ticket
2525
:alt: OCA/event
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/event-18-0/event-18-0-website_event_questions_by_ticket
27+
:target: https://translation.odoo-community.org/projects/event-19-0/event-19-0-website_event_questions_by_ticket
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/event&target_branch=19.0
3131
:alt: Try me on Runboat
3232

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

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

@@ -109,6 +109,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
109109
mission is to support the collaborative development of Odoo features and
110110
promote its widespread use.
111111

112-
This module is part of the `OCA/event <https://github.com/OCA/event/tree/18.0/website_event_questions_by_ticket>`_ project on GitHub.
112+
This module is part of the `OCA/event <https://github.com/OCA/event/tree/19.0/website_event_questions_by_ticket>`_ project on GitHub.
113113

114114
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

website_event_questions_by_ticket/__manifest__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
{
66
"name": "Conditional Events Questions",
77
"summary": "Events Questions conditional to the chosen ticket",
8-
"version": "18.0.1.0.0",
8+
"version": "19.0.1.0.0",
99
"category": "Website",
1010
"website": "https://github.com/OCA/event",
1111
"author": "Tecnativa, Odoo Community Association (OCA)",
1212
"license": "LGPL-3",
1313
"installable": True,
1414
"depends": ["website_event"],
15-
"data": ["views/event_event_views.xml", "views/event_templates.xml"],
15+
"data": [
16+
"views/event_event_views.xml",
17+
"views/event_question_views.xml",
18+
"views/event_templates.xml"
19+
],
1620
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
22

33
from . import event_event
4+
from . import event_question

website_event_questions_by_ticket/models/event_event.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2019 Tecnativa - Pedro M. Baeza
22
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
33

4-
from odoo import fields, models
4+
from odoo import models
55

66

77
class EventEvent(models.Model):
@@ -23,14 +23,3 @@ def _get_general_questions(self, ticket_ids):
2323
or (set(ticket_ids) & set(x.restricted_ticket_ids.ids))
2424
)
2525
)
26-
27-
28-
class EventQuestion(models.Model):
29-
_inherit = "event.question"
30-
31-
restricted_ticket_ids = fields.Many2many(
32-
comodel_name="event.event.ticket",
33-
string="Limited to tickets",
34-
domain="[('event_id', '=', parent.id)]",
35-
ondelete="restrict",
36-
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2019 Tecnativa - Pedro M. Baeza
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
from typing import Self
4+
5+
from odoo.orm.types import ValuesType
6+
7+
from odoo import fields, models
8+
9+
class EventQuestion(models.Model):
10+
_inherit = "event.question"
11+
12+
restricted_ticket_ids = fields.Many2many(
13+
comodel_name="event.event.ticket",
14+
string="Limited to tickets",
15+
domain="[('event_id', '=', parent.id)]",
16+
ondelete="restrict",
17+
)

website_event_questions_by_ticket/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
- Stefan Ungureanu
44
- Carolina Fernandez
55
- Pilar Vargas
6+
- [Acsone](https://www.acsone.eu):
7+
- Maxime Franco

website_event_questions_by_ticket/static/description/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Conditional Events Questions</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:e03d9bd3cadffe09d2a0852f07b18e76bbf80d99c61038c3b01c18fa6c9ef2d1
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/event/tree/18.0/website_event_questions_by_ticket"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/event-18-0/event-18-0-website_event_questions_by_ticket"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/event&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/event/tree/19.0/website_event_questions_by_ticket"><img alt="OCA/event" src="https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/event-19-0/event-19-0-website_event_questions_by_ticket"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/event&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>This module allows to set that an event question is only asked for
379379
certain tickets.</p>
380380
<p>If the question is general, then having one of the allowed tickets will
@@ -427,7 +427,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
427427
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/event/issues">GitHub Issues</a>.
428428
In case of trouble, please check there if your issue has already been reported.
429429
If you spotted it first, help us to smash it by providing a detailed and welcomed
430-
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20website_event_questions_by_ticket%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
430+
<a class="reference external" href="https://github.com/OCA/event/issues/new?body=module:%20website_event_questions_by_ticket%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
431431
<p>Do not contact contributors directly about support or help with technical issues.</p>
432432
</div>
433433
<div class="section" id="credits">
@@ -459,7 +459,7 @@ <h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
459459
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
460460
mission is to support the collaborative development of Odoo features and
461461
promote its widespread use.</p>
462-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/18.0/website_event_questions_by_ticket">OCA/event</a> project on GitHub.</p>
462+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/event/tree/19.0/website_event_questions_by_ticket">OCA/event</a> project on GitHub.</p>
463463
<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>
464464
</div>
465465
</div>

website_event_questions_by_ticket/tests/test_ticket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def setUpClass(cls):
3737
cls.question_1 = cls.env["event.question"].create(
3838
{
3939
"title": "Question Two",
40-
"event_id": cls.event_1.id,
40+
"event_ids": [(6, 0,cls.event_1.ids)],
4141
"restricted_ticket_ids": [(6, 0, cls.ticket_1.ids)],
4242
}
4343
)

website_event_questions_by_ticket/views/event_event_views.xml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,6 @@
22
<!-- Copyright 2019 Tecnativa - Pedro M. Baeza
33
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
44
<odoo>
5-
<record model="ir.ui.view" id="view_event_question_form">
6-
<field name="model">event.event</field>
7-
<field name="inherit_id" ref="website_event.event_event_view_form" />
8-
<field name="arch" type="xml">
9-
<xpath
10-
expr="//field[@name='question_ids']/form/sheet/notebook"
11-
position="before"
12-
>
13-
<group>
14-
<field
15-
name="restricted_ticket_ids"
16-
widget="many2many_tags"
17-
placeholder="Leave it empty for being available for all tickets"
18-
/>
19-
</group>
20-
</xpath>
21-
</field>
22-
</record>
235
<record model="ir.ui.view" id="event_event_view_form">
246
<field name="model">event.event</field>
257
<field name="inherit_id" ref="website_event.event_event_view_form" />
@@ -30,6 +12,9 @@
3012
>
3113
<field name="restricted_ticket_ids" widget="many2many_tags" />
3214
</xpath>
15+
<field name="question_ids" position="attributes">
16+
<attribute name="context">{'list_view_ref': 'event.event_question_view_list_add', 'form_view_ref': 'website_event_questions_by_ticket.event_question_view_form'}</attribute>
17+
</field>
3318
</field>
3419
</record>
3520
</odoo>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- Copyright 2019 Tecnativa - Pedro M. Baeza
3+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
4+
<odoo>
5+
<record model="ir.ui.view" id="event_question_view_form">
6+
<field name="name">event.question.view.list.add</field>
7+
<field name="model">event.question</field>
8+
<field name="inherit_id" ref="event.event_question_view_form" />
9+
<field name="mode">primary</field>
10+
<field name="priority" eval="20"/>
11+
<field name="arch" type="xml">
12+
<xpath
13+
expr="//notebook"
14+
position="before"
15+
>
16+
<group>
17+
<field
18+
name="restricted_ticket_ids"
19+
widget="many2many_tags"
20+
placeholder="Leave it empty for being available for all tickets"
21+
/>
22+
</group>
23+
</xpath>
24+
</field>
25+
</record>
26+
</odoo>

0 commit comments

Comments
 (0)