mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 13:52:00 +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,27 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
detailed_type = fields.Selection(selection_add=[
|
||||
('event', 'Event Ticket'),
|
||||
], ondelete={'event': 'set service'})
|
||||
|
||||
@api.onchange('detailed_type')
|
||||
def _onchange_type_event(self):
|
||||
if self.detailed_type == 'event':
|
||||
self.invoice_policy = 'order'
|
||||
|
||||
def _detailed_type_mapping(self):
|
||||
type_mapping = super()._detailed_type_mapping()
|
||||
type_mapping['event'] = 'service'
|
||||
return type_mapping
|
||||
|
||||
|
||||
class Product(models.Model):
|
||||
_inherit = 'product.product'
|
||||
|
||||
event_ticket_ids = fields.One2many('event.event.ticket', 'product_id', string='Event Tickets')
|
||||
Loading…
Add table
Add a link
Reference in a new issue