Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port 17.0 #445

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion attachment_zipped_download/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Attachment Zipped Download",
"version": "16.0.2.0.1",
"version": "17.0.2.0.0",
"category": "Tools",
"website": "https://github.com/OCA/knowledge",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
2 changes: 1 addition & 1 deletion document_knowledge/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Documents Knowledge",
"version": "16.0.1.1.0",
"version": "17.0.1.1.0",
"author": "OpenERP SA,"
"MONK Software, "
"Tecnativa, "
Expand Down
2 changes: 1 addition & 1 deletion document_knowledge/views/res_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="priority" eval="90" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<xpath expr="//form" position="inside">
<div
class="app_settings_block"
data-string="Knowledge"
Expand Down
2 changes: 1 addition & 1 deletion document_page/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Document Page",
"version": "16.0.1.1.1",
"version": "17.0.1.1.0",
"category": "Knowledge Management",
"author": "OpenERP SA, Odoo Community Association (OCA)",
"images": [
Expand Down
5 changes: 2 additions & 3 deletions document_page/views/document_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<record id="view_wiki_tree_children" model="ir.ui.view">
<field name="name">document.page.tree</field>
<field name="model">document.page</field>
<field name="field_parent">child_ids</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<tree>
Expand Down Expand Up @@ -42,7 +41,7 @@
name="web_ribbon"
text="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active == True"
/>
<field name="active" invisible="1" />
<field name="type" invisible="1" />
Expand Down Expand Up @@ -75,7 +74,7 @@
<field
name="menu_id"
readonly="1"
attrs="{'invisible': [('menu_id','=',False)]}"
invisible="menu_id == False"
/>
</group>
<group string="Revision">
Expand Down
2 changes: 1 addition & 1 deletion document_page_approval/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Document Page Approval",
"version": "16.0.1.1.0",
"version": "17.0.1.1.0",
"author": "Savoir-faire Linux, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
"license": "AGPL-3",
Expand Down
8 changes: 4 additions & 4 deletions document_page_approval/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
_logger = logging.getLogger(__name__)


def post_init_hook(cr, registry): # pragma: no cover
def post_init_hook(env): # pragma: no cover
# Set all pre-existing pages history to approved
_logger.info("Setting history to approved.")
cr.execute(
env.cr.execute(
"""
UPDATE document_page_history
SET state='approved',
Expand All @@ -19,7 +19,7 @@ def post_init_hook(cr, registry): # pragma: no cover
)


def uninstall_hook(cr, registry): # pragma: no cover
def uninstall_hook(env): # pragma: no cover
# Remove unapproved pages
_logger.info("Deleting unapproved Change Requests.")
cr.execute("DELETE FROM document_page_history WHERE state != 'approved'")
env.cr.execute("DELETE FROM document_page_history WHERE state != 'approved'")
49 changes: 21 additions & 28 deletions document_page_approval/views/document_page_approval.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,44 @@
type="object"
string="Send to Review"
class="oe_highlight"
attrs="{'invisible':['|','|',('is_approval_required','=',False),('am_i_owner','=',False),('state', 'not in', ['draft'])]}"
invisible="is_approval_required == False or am_i_owner == False or state not in ['draft']"
/>
<!-- approve if i am approver -->
<button
name="action_approve"
type="object"
string="Approve"
class="oe_highlight"
attrs="{'invisible':['|','|',('is_approval_required','=',False),('am_i_approver','=',False),('state','not in',['draft','to approve'])]}"
invisible="is_approval_required == False or am_i_approver == False or state not in ['draft','to approve']"
/>
<!-- approve if it's not required and i am owner -->
<button
name="action_approve"
type="object"
string="Approve"
class="oe_highlight"
attrs="{'invisible':['|','|',('is_approval_required','=',True),('am_i_owner','=',False),('state','not in',['draft', 'to approve'])]}"
invisible="is_approval_required == True or am_i_owner == False or state not in ['draft', 'to approve']"
/>
<!-- cancel if i am owner or approver -->
<button
name="action_cancel"
type="object"
string="Cancel"
attrs="{'invisible':['|','&amp;',('am_i_owner','=',False),('am_i_approver','=',False),('state','not in',['draft','to approve'])]}"
invisible="am_i_owner == False or am_i_approver == False and state not in ['draft','to approve']"
/>
<!-- reopen if i am owner or approver -->
<button
name="action_draft"
type="object"
string="Back to draft"
attrs="{'invisible':['|','&amp;',('am_i_owner','=',False),('am_i_approver','=',False),('state','not in',['cancelled'])]}"
invisible="am_i_owner == False or am_i_approver == False and state not in ['cancelled']"
/>
<!-- cancel & reopen, if i am owner or approver -->
<button
name="action_draft"
type="object"
string="Back to draft"
attrs="{'invisible':['|','&amp;',('am_i_owner','=',False),('am_i_approver','=',False),('state','not in',['to approve'])]}"
invisible="am_i_owner == False or am_i_approver == False and state not in ['to approve']"
/>
<field name="am_i_owner" invisible="1" />
<field name="am_i_approver" invisible="1" />
Expand All @@ -68,35 +68,27 @@
<field
name="approved_uid"
readonly="1"
attrs="{'invisible':[('state','not in',['approved'])]}"
invisible="state not in ['approved']"
/>
<field
name="approved_date"
readonly="1"
attrs="{'invisible':[('state','not in',['approved'])]}"
invisible="state not in ['approved']"
/>
</group>
</xpath>
<!-- Readonly fields -->
<field name="content" position="attributes">
<attribute
name="attrs"
>{'readonly': [('state', 'not in', ['draft'])]}</attribute>
<attribute name="readonly">state not in ['draft']</attribute>
</field>
<field name="page_id" position="attributes">
<attribute
name="attrs"
>{'readonly': [('state', 'not in', ['draft'])]}</attribute>
<attribute name="readonly">state not in ['draft']</attribute>
</field>
<field name="name" position="attributes">
<attribute
name="attrs"
>{'readonly': [('state', 'not in', ['draft'])]}</attribute>
<attribute name="readonly">state not in ['draft']</attribute>
</field>
<field name="summary" position="attributes">
<attribute
name="attrs"
>{'readonly': [('state', 'not in', ['draft'])]}</attribute>
<attribute name="readonly">state not in ['draft']</attribute>
</field>
<!-- Chatter -->
<sheet position="after">
Expand All @@ -119,14 +111,14 @@
position="attributes"
groups="document_page.group_document_manager"
>
<attribute name="attrs">{'readonly': False}</attribute>
<attribute name="readonly">False</attribute>
</field>
<field
name="summary"
position="attributes"
groups="document_page.group_document_manager"
>
<attribute name="attrs">{'readonly': False}</attribute>
<attribute name="readonly">False</attribute>
</field>
</field>
</record>
Expand All @@ -141,7 +133,7 @@
class="alert alert-info"
role="alert"
style="margin-bottom:0px;"
attrs="{'invisible': [('has_changes_pending_approval','=',False)]}"
invisible="has_changes_pending_approval == False"
>
This document has <b
>Changes Pending Approval</b>. You are viewing the last approved content.
Expand All @@ -150,7 +142,7 @@
class="alert alert-warning oe_edit_only"
role="alert"
style="margin-bottom:0px;"
attrs="{'invisible': [('is_approval_required','=',False)]}"
invisible="is_approval_required == False"
>
This document requires approval. If edited, you will create a new <b
>Change Request</b>.
Expand All @@ -159,7 +151,7 @@
class="alert alert-warning oe_edit_only"
role="alert"
style="margin-bottom:0px;"
attrs="{'invisible': [('user_has_drafts','=',False)]}"
invisible="user_has_drafts == False"
>
<b>You already have a Draft Change Request for this page.</b>
It is highly recommended that you edit that one instead of creating a new one.
Expand All @@ -174,7 +166,7 @@
name="action_changes_pending_approval"
string="Change Requests"
type="object"
attrs="{'invisible':[('has_changes_pending_approval','=',False),('user_has_drafts','=',False)]}"
invisible="has_changes_pending_approval == False and user_has_drafts == False"
icon="fa-edit"
/>
</xpath>
Expand Down Expand Up @@ -207,7 +199,7 @@
<field name="content" position="before">
<group
class="oe_read_only"
attrs="{'invisible':[('type','!=','content')]}"
invisible="type != 'content'"
>
<field name="approved_date" />
<field name="approved_uid" />
Expand All @@ -225,7 +217,8 @@
<field name="approval_required" />
<field
name="approver_gid"
attrs="{'invisible':[('approval_required','!=', True)], 'required':[('approval_required','=', True)]}"
invisible="approval_required != True"
required="approval_required == True"
/>
</field>
</field>
Expand Down
2 changes: 1 addition & 1 deletion document_page_group/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Document Page Group",
"summary": """
Define access groups on documents""",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
Expand Down
5 changes: 3 additions & 2 deletions document_page_reference/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
{
"name": "Document Page Reference",
"summary": """
Include references on document pages""",
"version": "16.0.1.0.1",
Include references on document pages
""",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
Expand Down
2 changes: 1 addition & 1 deletion document_page_tag/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Document Page Tag",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"author": "Therp BV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
"license": "AGPL-3",
Expand Down
2 changes: 1 addition & 1 deletion document_url/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2020 Tecnativa - Manuel Calero
{
"name": "URL attachment",
"version": "16.0.1.0.3",
"version": "17.0.1.0.3",
"category": "Tools",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
Expand Down
Loading