@@ -18,6 +18,13 @@ class YuthonVacationReports(models.Model):
|
||||
working_overtime = fields.Float(string='加班时', compute='_compute_working_overtime', store=True)
|
||||
meal_fee = fields.Integer(string="误餐次数", compute='_compute_meal_fee', store=True)
|
||||
|
||||
def update_vac(self):
|
||||
vacation_ids = self.env["yuthon.vacation.reports"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for record in vacation_ids:
|
||||
penultimate_record = record.overtime_ids[-2]
|
||||
penultimate_record.unlink()
|
||||
|
||||
def vacation_delete(self):
|
||||
vacation_ids = self.env["yuthon.vacation.reports"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
|
||||
@@ -109,6 +109,13 @@
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.vacation_delete()</field>
|
||||
</record>
|
||||
<record id="all_update_vac" model="ir.actions.server">
|
||||
<field name="name">一次性</field>
|
||||
<field name="model_id" ref="yuthon_holiday.model_yuthon_vacation_reports"/>
|
||||
<field name="binding_model_id" ref="yuthon_holiday.model_yuthon_vacation_reports"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.update_vac()</field>
|
||||
</record>
|
||||
<record id="details_tree_view" model="ir.ui.view">
|
||||
<field name="name">details.tree.tree</field>
|
||||
<field name="model">details.tree</field>
|
||||
|
||||
Reference in New Issue
Block a user