diff --git a/document_page_approval/__manifest__.py b/document_page_approval/__manifest__.py
index 57fd9b68..3c4bd5d2 100644
--- a/document_page_approval/__manifest__.py
+++ b/document_page_approval/__manifest__.py
@@ -3,12 +3,12 @@
{
"name": "Document Page Approval",
- "version": "12.0.1.0.0",
+ "version": "13.0.1.0.0",
"author": "Savoir-faire Linux, Odoo Community Association (OCA)",
"website": "http://www.savoirfairelinux.com",
"license": "AGPL-3",
"category": "Knowledge Management",
- "depends": ["document_page", "mail",],
+ "depends": ["document_page", "mail"],
"data": [
"data/email_template.xml",
"views/document_page_approval.xml",
diff --git a/document_page_approval/hooks.py b/document_page_approval/hooks.py
index 0fa1e3b1..d0b780a2 100644
--- a/document_page_approval/hooks.py
+++ b/document_page_approval/hooks.py
@@ -22,4 +22,4 @@ def post_init_hook(cr, registry): # pragma: no cover
def uninstall_hook(cr, registry): # pragma: no cover
# Remove unapproved pages
_logger.info("Deleting unapproved Change Requests.")
- cr.execute("DELETE FROM document_page_history " "WHERE state != 'approved'")
+ cr.execute("DELETE FROM document_page_history WHERE state != 'approved'")
diff --git a/document_page_approval/models/document_page.py b/document_page_approval/models/document_page.py
index 3f9e21fb..a4528f0e 100644
--- a/document_page_approval/models/document_page.py
+++ b/document_page_approval/models/document_page.py
@@ -13,7 +13,7 @@ class DocumentPage(models.Model):
_inherit = "document.page"
history_ids = fields.One2many(
- order="approved_date DESC", domain=[("state", "=", "approved")],
+ order="approved_date DESC", domain=[("state", "=", "approved")]
)
approved_date = fields.Datetime(
@@ -65,10 +65,9 @@ class DocumentPage(models.Model):
)
user_has_drafts = fields.Boolean(
- compute="_compute_user_has_drafts", string="User has drafts?",
+ compute="_compute_user_has_drafts", string="User has drafts?"
)
- @api.multi
@api.depends("approval_required", "parent_id.is_approval_required")
def _compute_is_approval_required(self):
"""Check if the document required approval based on his parents."""
@@ -78,7 +77,6 @@ class DocumentPage(models.Model):
res = res or page.parent_id.is_approval_required
page.is_approval_required = res
- @api.multi
@api.depends("approver_gid", "parent_id.approver_group_ids")
def _compute_approver_group_ids(self):
"""Compute the approver groups based on his parents."""
@@ -88,14 +86,12 @@ class DocumentPage(models.Model):
res = res | page.parent_id.approver_group_ids
page.approver_group_ids = res
- @api.multi
@api.depends("is_approval_required", "approver_group_ids")
def _compute_am_i_approver(self):
"""Check if the current user can approve changes to this page."""
for rec in self:
rec.am_i_approver = rec.can_user_approve_this_page(self.env.user)
- @api.multi
def can_user_approve_this_page(self, user):
"""Check if a user can approve this page."""
self.ensure_one()
@@ -114,7 +110,6 @@ class DocumentPage(models.Model):
# to approve, user must belong to any of the approver groups
return len(user.groups_id & self.approver_group_ids) > 0
- @api.multi
def _compute_has_changes_pending_approval(self):
history = self.env["document.page.history"]
for rec in self:
@@ -123,7 +118,6 @@ class DocumentPage(models.Model):
)
rec.has_changes_pending_approval = changes > 0
- @api.multi
def _compute_user_has_drafts(self):
history = self.env["document.page.history"]
for rec in self:
@@ -132,12 +126,10 @@ class DocumentPage(models.Model):
)
rec.user_has_drafts = changes > 0
- @api.multi
def _create_history(self, vals):
res = super(DocumentPage, self)._create_history(vals)
res.action_to_approve()
- @api.multi
def action_changes_pending_approval(self):
self.ensure_one()
action = self.env.ref("document_page_approval.action_change_requests")
diff --git a/document_page_approval/models/document_page_history.py b/document_page_approval/models/document_page_history.py
index 2acf6932..4d70f86f 100644
--- a/document_page_approval/models/document_page_history.py
+++ b/document_page_approval/models/document_page_history.py
@@ -1,7 +1,7 @@
# Copyright (C) 2013 Savoir-faire Linux ( This module adds a workflow to approve page modifications
and show the approved version by default. Table of contents Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback.
Do not contact contributors directly about support or help with technical issues.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
-This module is part of the OCA/knowledge project on GitHub.
+This module is part of the OCA/knowledge project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.