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