mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-23 04:22:04 -06:00
[document_page_approval] Allow to quickly cancel&draft from 'to approve' state
This commit is contained in:
parent
dce03abb17
commit
3a142e7ba2
@ -139,6 +139,12 @@ class DocumentPageHistory(models.Model):
|
||||
) % (rec.display_name, self.env.user.name)
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def action_cancel_and_draft(self):
|
||||
"""Set a change request as draft, cancelling it first"""
|
||||
self.action_cancel()
|
||||
self.action_draft()
|
||||
|
||||
@api.multi
|
||||
def _compute_am_i_owner(self):
|
||||
"""Check if current user is the owner"""
|
||||
|
@ -24,6 +24,9 @@
|
||||
<!-- reopen if i am owner or approver -->
|
||||
<button name="action_draft" type="object" string="Back to draft"
|
||||
attrs="{'invisible':['|','&',('am_i_owner','=',False),('am_i_approver','=',False),('state','not in',['cancelled'])]}"/>
|
||||
<!-- cancel & reopen, if i am owner or approver -->
|
||||
<button name="action_draft" type="object" string="Back to draft"
|
||||
attrs="{'invisible':['|','&',('am_i_owner','=',False),('am_i_approver','=',False),('state','not in',['to approve'])]}"/>
|
||||
<field name="am_i_owner" invisible="1"/>
|
||||
<field name="am_i_approver" invisible="1"/>
|
||||
<field name="is_approval_required" invisible="1"/>
|
||||
|
Loading…
Reference in New Issue
Block a user