Skip to content

Commit

Permalink
[FIX] document_page_approval: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgarRetes committed Nov 6, 2024
1 parent 19db9cf commit bcf2c25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions document_page_approval/models/document_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ def _create_history(self, vals):

def action_changes_pending_approval(self):
self.ensure_one()
action = self.env.ref("document_page_approval.action_change_requests")
action = action.sudo().read()[0]
action = self.env["ir.actions.act_window"]._for_xml_id(
"document_page_approval.action_change_requests"
)
context = literal_eval(action["context"])
context["search_default_page_id"] = self.id
context["default_page_id"] = self.id
Expand Down
1 change: 0 additions & 1 deletion document_page_approval/security/ir.model.access.csv

This file was deleted.

6 changes: 3 additions & 3 deletions document_page_approval/views/document_page_approval.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
type="object"
string="Send to Review"
class="oe_highlight"
invisible="not is_approval_required or not am_i_owner or state not in 'draft'"
invisible="not is_approval_required or not am_i_owner or state != 'draft'"
/>
<!-- approve if i am approver -->
<button
Expand Down Expand Up @@ -44,14 +44,14 @@
name="action_draft"
type="object"
string="Back to draft"
invisible="(not am_i_owner or not am_i_approver) and (state not in 'cancelled')"
invisible="(not am_i_owner or not am_i_approver) and (state != 'cancelled')"
/>
<!-- cancel & reopen, if i am owner or approver -->
<button
name="action_draft"
type="object"
string="Back to draft"
invisible="(not am_i_owner or not am_i_approver) and (state not in 'to approve')"
invisible="(not am_i_owner or not am_i_approver) and (state != 'to approve')"
/>
<field name="am_i_owner" invisible="1" />
<field name="am_i_approver" invisible="1" />
Expand Down

0 comments on commit bcf2c25

Please sign in to comment.