feat: add action_recompute_state wrapper and update button to trigger state and payment status recalculation
This commit is contained in:
parent
d436c336b9
commit
6689999b17
@ -163,3 +163,8 @@ class HrExpenseSheet(models.Model):
|
||||
raise UserError(_("You cannot refuse this report because it has Posted Realizations. Revert them first."))
|
||||
realizations.write({'state': 'draft'})
|
||||
return super().action_refuse_expense_sheets()
|
||||
|
||||
def action_recompute_state(self):
|
||||
""" Public wrapper to allow triggering recompute from a button. """
|
||||
self._compute_state()
|
||||
self._compute_payment_state()
|
||||
|
||||
@ -148,7 +148,7 @@
|
||||
<attribute name="statusbar_visible">draft,submit,approve,post,wait_post,done</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//header" position="inside">
|
||||
<button name="_compute_state"
|
||||
<button name="action_recompute_state"
|
||||
string="Recompute Status"
|
||||
type="object"
|
||||
groups="base.group_erp_manager"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user