批量确认

This commit is contained in:
李鹏宇
2026-03-04 19:33:47 +08:00
parent 484605bb85
commit 98204c4ce1
+1 -10
View File
@@ -279,17 +279,8 @@ class YuthonCatering(models.Model):
def batch_confirm_catering(self):
from datetime import date as date_cls
valid_months = [
(2025, 12),
(2026, 1),
(2026, 2),
]
records = self.env['yuthon.catering'].browse(self._context.get('active_ids', []))
filtered = records.filtered(
lambda r: r.date and (r.date.year, r.date.month) in valid_months
)
filtered.write({
records.write({
'state': 'confirmed',
'breakfast': True,
'lunch': True,