port 17.0

This commit is contained in:
Benoît Vézina 2023-12-03 11:07:27 -05:00
parent acebd9ca3b
commit 25f10c1629
12 changed files with 36 additions and 44 deletions

View File

@ -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.0",
"version": "17.0.2.0.0",
"category": "Tools",
"website": "https://github.com/OCA/knowledge",
"author": "Tecnativa, Odoo Community Association (OCA)",

View File

@ -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, "

View File

@ -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"

View File

@ -4,7 +4,7 @@
{
"name": "Document Page",
"version": "16.0.1.1.0",
"version": "17.0.1.1.0",
"category": "Knowledge Management",
"author": "OpenERP SA, Odoo Community Association (OCA)",
"images": [

View File

@ -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>
@ -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" />
@ -75,7 +74,7 @@
<field
name="menu_id"
readonly="1"
attrs="{'invisible': [('menu_id','=',False)]}"
invisible="menu_id == False"
/>
</group>
<group string="Revision">

View File

@ -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",

View File

@ -5,10 +5,10 @@ import logging
_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',
@ -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'")

View File

@ -14,7 +14,7 @@
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
@ -22,7 +22,7 @@
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
@ -30,28 +30,28 @@
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" />
@ -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">
@ -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>
@ -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.
@ -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>.
@ -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.
@ -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>
@ -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" />
@ -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>

View File

@ -5,7 +5,7 @@
"name": "Document Page Group",
"summary": """
Define access groups on documents""",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",

View File

@ -5,7 +5,7 @@
"name": "Document Page Reference",
"summary": """
Include references on document pages""",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",

View File

@ -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",

View File

@ -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",