批量确认
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user