Merge pull request !9264 from 李鹏宇/dev_wang
This commit is contained in:
李鹏宇
2026-03-04 11:04:42 +00:00
committed by Gitee
+10 -1
View File
@@ -279,8 +279,17 @@ 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', []))
records.write({
filtered = records.filtered(
lambda r: r.date and (r.date.year, r.date.month) in valid_months
)
filtered.write({
'state': 'confirmed',
'breakfast': True,
'lunch': True,