addons-cm/website_sale_aplicoop/models/group_order_slot.py
GitHub Copilot b3999e2283 [REM] website_sale_aplicoop: remove dead code and orphaned tests
Duplicate _translate_labels fallback, unreachable /eskaera/add-to-cart and
/eskaera/save-cart routes (the frontend cart is localStorage-only and uses
save-order), redundant pickup wrappers, unused pagination/count helpers and
fields, deprecated JS shims, and the already-empty checkout_summary.js and
i18n key/init leftovers.

Also drops 11 tests/*.py never wired into tests/__init__.py: three were
unimplemented placeholders (setUp with no assertions), and the other eight
had real assertions but were bit-rotted against the current schema (e.g.
res.partner.is_supplier no longer exists) — wiring them in surfaced 43
failures unrelated to this cleanup. Verified 0 failed/0 errors of 270 tests
both before and after.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-16 22:31:13 +02:00

57 lines
1.5 KiB
Python

# Copyright 2026 Criptomart
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo import fields
from odoo import models
# Pylint: explicit 'string' attributes are intentional for readable labels in views.
# Some linters flag these as redundant; disable that specific check here.
# pylint: disable=attribute-string-redundant
class GroupOrderSlot(models.Model):
_name = "group.order.slot"
_description = "Pickup slot for a Consumer Group Order"
_order = "sequence, weekday, start_hour"
group_order_id = fields.Many2one(
"group.order",
string="Group Order",
required=True,
ondelete="cascade",
help="Consumer group order this slot belongs to",
)
weekday = fields.Selection(
[
("0", "Monday"),
("1", "Tuesday"),
("2", "Wednesday"),
("3", "Thursday"),
("4", "Friday"),
("5", "Saturday"),
("6", "Sunday"),
],
string="Weekday",
required=True,
help="Day of week for this slot (0=Monday)",
)
start_hour = fields.Float(
string="Start hour",
help="Start hour in decimal form, e.g. 9.5 = 09:30",
)
end_hour = fields.Float(
string="End hour",
help="End hour in decimal form, e.g. 14.25 = 14:15",
)
label = fields.Char(
string="Label",
help="Human readable short label for the slot (optional)",
)
sequence = fields.Integer(string="Sequence", default=10)
active = fields.Boolean(default=True)