34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
from odoo import models, fields, api
|
|
|
|
|
|
class ProductTemplateExt(models.Model):
|
|
"""Extend product.template with the two flags the laundry workflow needs.
|
|
|
|
is_laundry_service: marks products as laundry services. POS sales of
|
|
these products auto-create / link a laundry.order.
|
|
is_laundry_settlement: internal flag for the dedicated settlement
|
|
product used to collect outstanding laundry dues without
|
|
generating revenue lines.
|
|
"""
|
|
_inherit = 'product.template'
|
|
|
|
is_laundry_service = fields.Boolean(
|
|
string='Laundry Service',
|
|
default=False,
|
|
help='Tick to include this product in the Laundry Service Catalog '
|
|
'and allow selection on laundry order lines.',
|
|
)
|
|
is_laundry_settlement = fields.Boolean(
|
|
string='Laundry Settlement',
|
|
default=False,
|
|
help='Internal flag for the settlement product. '
|
|
'Do not enable on regular products.',
|
|
)
|
|
|
|
@api.model
|
|
def _load_pos_data_fields(self, config_id):
|
|
fields = super()._load_pos_data_fields(config_id)
|
|
fields.append('is_laundry_service')
|
|
fields.append('is_laundry_settlement')
|
|
return fields
|