mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 10:12:06 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import _, api, models, fields
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class EventConfigurator(models.TransientModel):
|
||||
_name = 'event.event.configurator'
|
||||
_description = 'Event Configurator'
|
||||
|
||||
product_id = fields.Many2one('product.product', string="Product", readonly=True)
|
||||
event_id = fields.Many2one('event.event', string="Event")
|
||||
event_ticket_id = fields.Many2one('event.event.ticket', string="Event Ticket")
|
||||
|
||||
@api.constrains('event_id', 'event_ticket_id')
|
||||
def check_event_id(self):
|
||||
error_messages = []
|
||||
for record in self:
|
||||
if record.event_id.id != record.event_ticket_id.event_id.id:
|
||||
error_messages.append(
|
||||
_('Invalid ticket choice "%(ticket_name)s" for event "%(event_name)s".'))
|
||||
if error_messages:
|
||||
raise ValidationError('\n'.join(error_messages))
|
||||
Loading…
Add table
Add a link
Reference in a new issue