Odoo modules related to events management
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
998 B

  1. from odoo import models, api
  2. class EventEventTicket(models.Model):
  3. _inherit = "event.event.ticket"
  4. @api.depends("product_id")
  5. def _compute_description(self):
  6. for ticket in self:
  7. product = ticket.product_id
  8. description_sale = (
  9. product and product.get_product_multiline_description_sale() or False
  10. )
  11. if product and description_sale:
  12. ticket.description = description_sale
  13. if not ticket.description:
  14. ticket.description = False
  15. def _get_ticket_multiline_description(self):
  16. self.ensure_one()
  17. product = self.product_id
  18. description_sale = (
  19. product and product.get_product_multiline_description_sale() or False
  20. )
  21. if description_sale:
  22. return "%s\n%s" % (
  23. description_sale,
  24. self.event_id.display_name,
  25. )
  26. return super()._get_ticket_multiline_description()