Tower: upload laundry_management 19.0.19.0.4 (via marketplace)
This commit is contained in:
75
addons/laundry_management/models/laundry_order_type.py
Normal file
75
addons/laundry_management/models/laundry_order_type.py
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
|
class LaundryOrderType(models.Model):
|
||||||
|
"""Main intake type for a laundry order (Standard / Express / Delivery / VIP ...).
|
||||||
|
|
||||||
|
Drives workflow hints (priority, is_delivery) and suggests default
|
||||||
|
attributes. Admin-configurable from the backend; exposed to POS via
|
||||||
|
_load_pos_data_* so cashiers see live options in a popup.
|
||||||
|
"""
|
||||||
|
_name = 'laundry.order.type'
|
||||||
|
_inherit = ['pos.load.mixin']
|
||||||
|
_description = 'Laundry Order Type'
|
||||||
|
_order = 'sequence, id'
|
||||||
|
|
||||||
|
name = fields.Char(string='Name', required=True, translate=True)
|
||||||
|
code = fields.Char(string='Code')
|
||||||
|
sequence = fields.Integer(default=10)
|
||||||
|
active = fields.Boolean(default=True)
|
||||||
|
|
||||||
|
priority = fields.Selection([
|
||||||
|
('normal', 'Normal'),
|
||||||
|
('urgent', 'Urgent'),
|
||||||
|
], string='Priority', default='normal', required=True)
|
||||||
|
|
||||||
|
is_delivery = fields.Boolean(string='Is Delivery')
|
||||||
|
requires_address = fields.Boolean(string='Requires Address')
|
||||||
|
requires_scheduled_time = fields.Boolean(string='Requires Scheduled Time')
|
||||||
|
|
||||||
|
color = fields.Char(string='Color', help='Hex color, e.g. #FF8800')
|
||||||
|
icon_image = fields.Binary(string='Icon')
|
||||||
|
description = fields.Text(string='Description', translate=True)
|
||||||
|
|
||||||
|
extra_price = fields.Float(
|
||||||
|
string='Extra Price',
|
||||||
|
help='Reserved for future pricing rules. Not applied automatically.',
|
||||||
|
)
|
||||||
|
|
||||||
|
pos_available = fields.Boolean(
|
||||||
|
string='Available in POS', default=True,
|
||||||
|
help='Uncheck to hide this type from the POS popup without archiving.',
|
||||||
|
)
|
||||||
|
company_id = fields.Many2one(
|
||||||
|
'res.company', string='Company',
|
||||||
|
default=lambda self: self.env.company, index=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
attribute_ids = fields.Many2many(
|
||||||
|
'laundry.order.attribute',
|
||||||
|
'laundry_order_type_attribute_rel',
|
||||||
|
'type_id', 'attribute_id',
|
||||||
|
string='Default Attributes',
|
||||||
|
help='Attributes pre-suggested (pre-checked) when this type is chosen.',
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _load_pos_data_domain(self, data, config):
|
||||||
|
return [
|
||||||
|
('pos_available', '=', True),
|
||||||
|
('active', '=', True),
|
||||||
|
'|',
|
||||||
|
('company_id', '=', False),
|
||||||
|
('company_id', 'in', config.company_id.ids),
|
||||||
|
]
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _load_pos_data_fields(self, config):
|
||||||
|
return [
|
||||||
|
'id', 'name', 'code', 'sequence',
|
||||||
|
'priority', 'is_delivery',
|
||||||
|
'requires_address', 'requires_scheduled_time',
|
||||||
|
'color', 'description',
|
||||||
|
'extra_price',
|
||||||
|
'attribute_ids',
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user