mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-13 15:34:49 -06:00
[FIX] View
This commit is contained in:
parent
38b8c0f10c
commit
463bb6c611
@ -57,7 +57,7 @@ Contributors
|
||||
* Odoo SA <info@odoo.com>
|
||||
* Savoir-faire Linux <support@savoirfairelinux.com>
|
||||
* Gervais Naoussi <gervaisnaoussi@gmail.com>
|
||||
* Maxime Chambreuil <mchambreuil@ursainfosystems.com>
|
||||
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
'name': 'Document Page Approval',
|
||||
'version': '10.0.1.0.0',
|
||||
'version': '10.0.1.1.0',
|
||||
"author": "Savoir-faire Linux, Odoo Community Association (OCA)",
|
||||
"website": "http://www.savoirfairelinux.com",
|
||||
"license": "AGPL-3",
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields, api
|
||||
from openerp import api, fields, models
|
||||
|
||||
|
||||
class DocumentPageApproval(models.Model):
|
||||
@ -71,12 +71,12 @@ class DocumentPageApproval(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _is_parent_approval_required(self):
|
||||
"""Check if the document required approval base on his parrent."""
|
||||
"""Check if the document requires approval base on his parent."""
|
||||
for page in self:
|
||||
page.is_parent_approval_required = self.is_approval_required(page)
|
||||
|
||||
def is_approval_required(self, page):
|
||||
"""Check if a document required approval."""
|
||||
"""Check if a document requires approval."""
|
||||
if page:
|
||||
res = page.approval_required
|
||||
res = res or self.is_approval_required(page.parent_id)
|
||||
|
@ -10,19 +10,18 @@
|
||||
<xpath expr="//form/label[@for='page_id']"
|
||||
position="before">
|
||||
<header attrs="{'invisible':[('is_parent_approval_required','=',False)]}">
|
||||
<span attrs="{'invisible':[('can_user_approve_page','=',False)]}">
|
||||
<button name="page_approval_approve"
|
||||
string="Approve"
|
||||
states="draft" />
|
||||
</span>
|
||||
<button name="page_approval_approve"
|
||||
string="Approve"
|
||||
states="draft"
|
||||
class="btn-primary"
|
||||
attrs="{'invisible':[('can_user_approve_page','=',False)]}"/>
|
||||
<field name="state"
|
||||
widget="statusbar"
|
||||
statusbar_visible="draft,approved"/>
|
||||
<field name="is_parent_approval_required"
|
||||
<field name="is_parent_approval_required"
|
||||
invisible="1" />
|
||||
<field name="can_user_approve_page"
|
||||
invisible="1" />
|
||||
|
||||
</header>
|
||||
</xpath>
|
||||
</field>
|
||||
|
Loading…
Reference in New Issue
Block a user