餐费修改
This commit is contained in:
@@ -101,6 +101,15 @@ class YuthonMealExpenses(models.Model):
|
||||
},
|
||||
}
|
||||
|
||||
def action_mark_meal_sent(self):
|
||||
domain = self.env.context.get('active_domain') or []
|
||||
records = self.search(domain)
|
||||
to_update = records.filtered(lambda r:r.meal_state == 'to_do')
|
||||
if to_update:
|
||||
to_update.write({'meal_state': 'done'})
|
||||
return True
|
||||
|
||||
|
||||
def action_generate_missing_feb(self):
|
||||
target_year = '2026'
|
||||
target_month = '2'
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<tree string="餐费" editable="bottom" js_class="custom_meal_button">
|
||||
<header>
|
||||
<button name="action_generate_missing_feb" string="批量生成2026年2月缺失数据" type="object" class="btn btn-blue"/>
|
||||
<button name="action_mark_meal_sent" string="批量标记已发送" type="object" class="btn btn-blue"/>
|
||||
</header>
|
||||
<field name="select_year"/>
|
||||
<field name="select_time"/>
|
||||
@@ -38,7 +39,7 @@
|
||||
<field name="toll_state"/>
|
||||
<field name="meal_state"/>
|
||||
<button name="action_view_detail" string="明细" type="object" class="btn btn-blue"/>
|
||||
<button name="send_meal" string="发送" type="object" class="btn btn-blue"/>
|
||||
<button name="send_meal" string="发送" type="object" class="btn btn-blue" invisible="meal_state != 'to_do'"/>
|
||||
<button name="action_review_confirm" string="复核确认" type="object" class="btn btn-blue" invisible="toll_state != 'done'"/>
|
||||
|
||||
</tree>
|
||||
|
||||
Reference in New Issue
Block a user