from odoo import models, fields

class PosOrder(models.Model):
    _inherit = 'pos.order'

    order_source = fields.Selection([
        ('walk_in',    'Walk-In (Standard POS)'),
        ('phone',      'Telephone Order'),
        ('online',     'Online / eCommerce'),
        ('whatsapp',   'WhatsApp'),
        ('social_media', 'Social Media'),
        ('platform',   'Third-Party Platform'),
        ('kiosk',      'Self-Order Kiosk'),
        ('qr',         'QR Table Order'),
    ], string='Order Source', default='walk_in', index=True)

    fulfilment_type = fields.Selection([
        ('dine_in',  'Dine-In'),
        ('pickup',   'Pickup'),
        ('delivery', 'Delivery'),
    ], string='Fulfilment Type', default='dine_in', index=True)

class PosOrderLine(models.Model):
    _inherit = 'pos.order.line'

    order_source = fields.Selection(
        related='order_id.order_source', string='Order Source', store=True
    )
    fulfilment_type = fields.Selection(
        related='order_id.fulfilment_type', string='Fulfilment Type', store=True
    )
