!9345 !9344 Merge branch 'dev' of <a href="https://gitee.com/jinan-pengyusen…

Merge pull request !9345 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-03-06 07:02:39 +00:00
committed by Gitee
2 changed files with 11 additions and 0 deletions
@@ -22,6 +22,16 @@ class YuthonMenuSetting(models.Model):
)
menu_date = fields.Date(string='日期')
remake = fields.Text(string='备注')
week_day = fields.Char(string='星期', compute='_compute_week_day', store=True)
@api.depends('menu_date')
def _compute_week_day(self):
week_map = {'0': '周一', '1': '周二', '2': '周三', '3': '周四', '4': '周五', '5': '周六', '6': '周日'}
for record in self:
if record.menu_date:
record.week_day = week_map[str(record.menu_date.weekday())]
else:
record.week_day = ''
class YuthonDishesSetting(models.Model):
@@ -6,6 +6,7 @@
<field name="arch" type="xml">
<tree string="菜单配置" editable="bottom" js_class="custom_catering_button">
<field name="menu_date"/>
<field name="week_day"/>
<field name="breakfast_ids" widget="many2many_tags" domain="[('dishes_type','=','breakfast')]"/>
<field name="lunch_ids" widget="many2many_tags" domain="[('dishes_type','=','lunch')]"/>
<field name="remake"/>