Browse Source

[ADD] event_website_hidden module

16.0
RemiFr82 5 months ago
parent
commit
068a1fa9a3
  1. 1
      event_website_hidden/__init__.py
  2. 37
      event_website_hidden/__manifest__.py
  3. 31
      event_website_hidden/i18n/fr.po
  4. 1
      event_website_hidden/models/__init__.py
  5. 23
      event_website_hidden/models/event_event.py
  6. 19
      event_website_hidden/views/event_event.xml

1
event_website_hidden/__init__.py

@ -0,0 +1 @@
from . import models

37
event_website_hidden/__manifest__.py

@ -0,0 +1,37 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Hidden website event",
"version": "1.0.0",
"summary": "This module adds the possibility to hide events on website.",
"description": """
The events marked as unindexed on website don't appear on the website browser but can be acced with the event public link (direct share).
""",
"author": "RemiFr82",
"contributors": "",
"website": "https://remifr82.me",
"license": "LGPL-3",
"category": "Events",
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"auto_install": False,
"pre_init_hook": "",
"post_init_hook": "",
"uninstall_hook": "",
"excludes": [],
"external_dependencies": [],
"depends": [
"website_event",
],
"data": [
"views/event_event.xml",
],
"assets": {},
"css": [],
"images": [],
"js": [],
"test": [],
"demo": [],
"maintainer": "RemiFr82",
}

31
event_website_hidden/i18n/fr.po

@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * event_website_hidden
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0-20230613\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-07 21:30+0000\n"
"PO-Revision-Date: 2024-08-07 21:30+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_website_hidden
#: model:ir.model,name:event_website_hidden.model_event_event
msgid "Event"
msgstr "Événement"
#. module: event_website_hidden
#: model:ir.model.fields,help:event_website_hidden.field_event_event__website_indexed
msgid "This event cannot be found by website suearch if unindexed."
msgstr "Cet évènement n'apparaîtra pas dans le recherche web s'il est désindexé."
#. module: event_website_hidden
#: model:ir.model.fields,field_description:event_website_hidden.field_event_event__website_indexed
msgid "Indexed in website"
msgstr "Indexé sur le site web"

1
event_website_hidden/models/__init__.py

@ -0,0 +1 @@
from . import event_event

23
event_website_hidden/models/event_event.py

@ -0,0 +1,23 @@
from odoo import models, fields, api
class EventEvent(models.Model):
_inherit = "event.event"
website_indexed = fields.Boolean(
string="Indexed in website",
default=True,
help="This event cannot be found by website suearch if unindexed.",
)
@api.model
def _search_build_domain(self, domain_list, search, fields, extra=None):
if isinstance(domain_list, (list, tuple)):
if not any(
any(term[0] == "website_indexed" for term in domain)
for domain in domain_list
):
domain_list.append([("website_indexed", "=", True)])
else:
domain_list = [[("website_indexed", "=", True)]]
return super()._search_build_domain(domain_list, search, fields, extra)

19
event_website_hidden/views/event_event.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_event_form_inherit_event_website_indexed" model="ir.ui.view">
<field name="name">event.event.view.form.inherit</field>
<field name="model">event.event</field>
<field name="inherit_id" ref="event.view_event_form" />
<field name="arch" type="xml">
<field name="tag_ids" position="after">
<field name="website_indexed" widget="boolean_toggle" groups="event.group_event_manager" />
</field>
<!-- <div name="button_box" position="before">
<widget name="web_ribbon" title="Hidden on website" bg_color="bg-warning"
attrs="{'invisible': [('website_indexed', '=', True)]}" />
</div> -->
</field>
</record>
</odoo>
Loading…
Cancel
Save