Browse Source

[ADD] event_ticket_description_sale

16.0
RemiFr82 11 months ago
parent
commit
573b93c87a
  1. 1
      event_ticket_description_sale/__init__.py
  2. 37
      event_ticket_description_sale/__manifest__.py
  3. 26
      event_ticket_description_sale/i18n/fr.po
  4. 2
      event_ticket_description_sale/models/__init__.py
  5. 30
      event_ticket_description_sale/models/event_event_ticket.py
  6. 18
      event_ticket_description_sale/models/event_type_ticket.py

1
event_ticket_description_sale/__init__.py

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

37
event_ticket_description_sale/__manifest__.py

@ -0,0 +1,37 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Event ticket description for sales",
"version": "1.0.0",
"summary": """
This module fixes the description management on event tickets, from the product to the sale order.
""",
"description": """
TO WRITE
""",
"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": [
"event_sale",
],
"data": [],
"assets": {},
"css": [],
"images": [],
"js": [],
"test": [],
"demo": [],
"maintainer": "RemiFr82",
}

26
event_ticket_description_sale/i18n/fr.po

@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * event_ticket_description_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e-20230613\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-14 12:47+0000\n"
"PO-Revision-Date: 2024-01-14 12:47+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_ticket_description_sale
#: model:ir.model,name:event_ticket_description_sale.model_event_type_ticket
msgid "Event Template Ticket"
msgstr "Modèle de ticket d'événement"
#. module: event_ticket_description_sale
#: model:ir.model,name:event_ticket_description_sale.model_event_event_ticket
msgid "Event Ticket"
msgstr "Ticket d'événement"

2
event_ticket_description_sale/models/__init__.py

@ -0,0 +1,2 @@
from . import event_event_ticket
from . import event_type_ticket

30
event_ticket_description_sale/models/event_event_ticket.py

@ -0,0 +1,30 @@
from odoo import models, api
class EventEventTicket(models.Model):
_inherit = "event.event.ticket"
@api.depends("product_id")
def _compute_description(self):
for ticket in self:
product = ticket.product_id
description_sale = (
product and product.get_product_multiline_description_sale() or False
)
if product and description_sale:
ticket.description = description_sale
if not ticket.description:
ticket.description = False
def _get_ticket_multiline_description(self):
self.ensure_one()
product = self.product_id
description_sale = (
product and product.get_product_multiline_description_sale() or False
)
if description_sale:
return "%s\n%s" % (
description_sale,
self.event_id.display_name,
)
return super()._get_ticket_multiline_description()

18
event_ticket_description_sale/models/event_type_ticket.py

@ -0,0 +1,18 @@
from odoo import models, api
class EventTypeTicket(models.Model):
_inherit = "event.type.ticket"
@api.depends("product_id")
def _compute_description(self):
for ticket in self:
product = ticket.product_id
description_sale = (
product and product.get_product_multiline_description_sale() or False
)
if product and description_sale:
ticket.description = description_sale
# initialize, i.e for embedded tree views
if not ticket.description:
ticket.description = False
Loading…
Cancel
Save