[MIG] server_environment: Migration to 14.0

This commit is contained in:
Mourad 2020-10-12 12:38:47 +02:00 committed by Marcos Oitaben
parent 70ac80ea94
commit 20cc6000eb
8 changed files with 47 additions and 50 deletions

View File

@ -11,13 +11,13 @@ server configuration environment files
:target: https://odoo-community.org/page/development-status :target: https://odoo-community.org/page/development-status
:alt: Beta :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github .. |badge2| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github
:target: https://github.com/OCA/server-env/tree/13.0/server_environment :target: https://github.com/OCA/server-env/tree/14.0/server_environment
:alt: OCA/server-env :alt: OCA/server-env
.. |badge3| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge3| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-env-13-0/server-env-13-0-server_environment :target: https://translation.odoo-community.org/projects/server-env-14-0/server-env-14-0-server_environment
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/254/13.0 :target: https://runbot.odoo-community.org/runbot/254/14.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge1| |badge2| |badge3| |badge4|
@ -152,8 +152,8 @@ When the default field is used, the field is made editable on Odoo.
Note: empty environment keys always take precedence over default fields Note: empty environment keys always take precedence over default fields
Keychain integration Server environment integration
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Read the documentation of the class `models/server_env_mixin.py Read the documentation of the class `models/server_env_mixin.py
<models/server_env_mixin.py>`_. <models/server_env_mixin.py>`_.
@ -201,7 +201,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-env/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-env/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -242,6 +242,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/13.0/server_environment>`_ project on GitHub. This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/14.0/server_environment>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -4,13 +4,17 @@
{ {
"name": "server configuration environment files", "name": "server configuration environment files",
"version": "13.0.2.3.1", "version": "14.0.1.0.0",
"depends": ["base", "base_sparse_field"], "depends": ["base", "base_sparse_field"],
"author": "Camptocamp,Odoo Community Association (OCA)", "author": "Camptocamp,Odoo Community Association (OCA)",
"summary": "move some configurations out of the database", "summary": "move some configurations out of the database",
"website": "http://github.com/OCA/server-env", "website": "https://github.com/OCA/server-env",
"license": "GPL-3 or any later version", "license": "GPL-3 or any later version",
"category": "Tools", "category": "Tools",
"data": ["security/res_groups.xml", "serv_config.xml"], "data": [
"security/ir.model.access.csv",
"security/res_groups.xml",
"serv_config.xml",
],
"installable": True, "installable": True,
} }

View File

@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 13.0\n" "Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -75,7 +75,7 @@ msgid "Server Env Defaults"
msgstr "" msgstr ""
#. module: server_environment #. module: server_environment
#: model:ir.actions.act_window,name:server_environment.act_show_config_window #: model:ir.actions.act_window,name:server_environment.server_env_act_show_config
#: model:ir.ui.menu,name:server_environment.menu_server_show_config #: model:ir.ui.menu,name:server_environment.menu_server_show_config
msgid "Server Environment" msgid "Server Environment"
msgstr "" msgstr ""
@ -420,6 +420,11 @@ msgstr ""
msgid "odoo | test_tags" msgid "odoo | test_tags"
msgstr "" msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_transient_age_limit
msgid "odoo | transient_age_limit"
msgstr ""
#. module: server_environment #. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_translate_in #: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_translate_in
msgid "odoo | translate_in" msgid "odoo | translate_in"

View File

@ -92,8 +92,8 @@ When the default field is used, the field is made editable on Odoo.
Note: empty environment keys always take precedence over default fields Note: empty environment keys always take precedence over default fields
Keychain integration Server environment integration
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Read the documentation of the class `models/server_env_mixin.py Read the documentation of the class `models/server_env_mixin.py
<models/server_env_mixin.py>`_. <models/server_env_mixin.py>`_.

View File

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_server_config,access_server_config,model_server_config,base.group_user,1,0,0,0
access_server_config_manager,access_server_config_manger,model_server_config,base.group_system,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_server_config access_server_config model_server_config base.group_user 1 0 0 0
3 access_server_config_manager access_server_config_manger model_server_config base.group_system 1 1 1 1

View File

@ -1,15 +1,14 @@
<?xml version="1.0" ?> <?xml version="1.0" ?>
<odoo> <odoo>
<act_window <record id="server_env_act_show_config" model="ir.actions.act_window">
id="act_show_config_window" <field name="name">Server Environment</field>
name="Server Environment" <field name="res_model">server.config</field>
res_model="server.config" <field name="view_mode">form</field>
view_mode="form" </record>
/>
<menuitem <menuitem
parent="base.menu_ir_property" parent="base.menu_ir_property"
sequence="90" sequence="90"
action="act_show_config_window" action="server_env_act_show_config"
id="menu_server_show_config" id="menu_server_show_config"
/> />
</odoo> </odoo>

View File

@ -1,22 +1,8 @@
############################################################################## # Copyright 2020 Camptocamp (http://www.camptocamp.com)
# # @author Nicolas Bessi
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
# Based on Florent Xicluna original code. Copyright Wingo SA # Based on Florent Xicluna original code. Copyright Wingo SA
# # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import configparser import configparser
import logging import logging
@ -149,7 +135,7 @@ def _load_config_from_env(config_p):
def _load_config(): def _load_config():
"""Load the configuration and return a ConfigParser instance.""" """Load the configuration and return a ConfigParser instance."""
config_p = configparser.SafeConfigParser() config_p = configparser.ConfigParser()
# options are case-sensitive # options are case-sensitive
config_p.optionxform = str config_p.optionxform = str
@ -188,7 +174,7 @@ class ServerConfiguration(models.TransientModel):
and init some properties and init some properties
""" """
ModelClass = super(ServerConfiguration, cls)._build_model(pool, cr) ModelClass = super()._build_model(pool, cr)
ModelClass._add_columns() ModelClass._add_columns()
ModelClass._arch = None ModelClass._arch = None
ModelClass._build_osv() ModelClass._build_osv()
@ -306,10 +292,10 @@ class ServerConfiguration(models.TransientModel):
): ):
"""Overwrite the default method to render the custom view.""" """Overwrite the default method to render the custom view."""
res = super().fields_view_get(view_id, view_type, toolbar) res = super().fields_view_get(view_id, view_type, toolbar)
View = self.env["ir.ui.view"] View = self.env["ir.ui.view"].browse(view_id)
if view_type == "form": if view_type == "form":
arch_node = self._arch arch_node = self._arch
xarch, xfields = View.postprocess_and_fields(self._name, arch_node, view_id) xarch, xfields = View.postprocess_and_fields(arch_node, model=self._name)
res["arch"] = xarch res["arch"] = xarch
res["fields"] = xfields res["fields"] = xfields
return res return res

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="https://github.com/OCA/server-env/tree/13.0/server_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-env-13-0/server-env-13-0-server_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/254/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="https://github.com/OCA/server-env/tree/14.0/server_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-env-14-0/server-env-14-0-server_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/254/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module provides a way to define an environment in the main Odoo <p>This module provides a way to define an environment in the main Odoo
configuration file and to read some configurations from files configuration file and to read some configurations from files
depending on the configured environment: you define the environment in depending on the configured environment: you define the environment in
@ -388,7 +388,7 @@ see the values contained in the defined secret keys
<li><a class="reference internal" href="#server-environment-files" id="id3">server_environment_files</a></li> <li><a class="reference internal" href="#server-environment-files" id="id3">server_environment_files</a></li>
<li><a class="reference internal" href="#environment-variable" id="id4">Environment variable</a></li> <li><a class="reference internal" href="#environment-variable" id="id4">Environment variable</a></li>
<li><a class="reference internal" href="#default-values" id="id5">Default values</a></li> <li><a class="reference internal" href="#default-values" id="id5">Default values</a></li>
<li><a class="reference internal" href="#keychain-integration" id="id6">Keychain integration</a></li> <li><a class="reference internal" href="#server-environment-integration" id="id6">Server environment integration</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#usage" id="id7">Usage</a></li> <li><a class="reference internal" href="#usage" id="id7">Usage</a></li>
@ -497,8 +497,8 @@ configuration files / environment variable.</p>
<p>When the default field is used, the field is made editable on Odoo.</p> <p>When the default field is used, the field is made editable on Odoo.</p>
<p>Note: empty environment keys always take precedence over default fields</p> <p>Note: empty environment keys always take precedence over default fields</p>
</div> </div>
<div class="section" id="keychain-integration"> <div class="section" id="server-environment-integration">
<h2><a class="toc-backref" href="#id6">Keychain integration</a></h2> <h2><a class="toc-backref" href="#id6">Server environment integration</a></h2>
<p>Read the documentation of the class <a class="reference external" href="models/server_env_mixin.py">models/server_env_mixin.py</a>.</p> <p>Read the documentation of the class <a class="reference external" href="models/server_env_mixin.py">models/server_env_mixin.py</a>.</p>
</div> </div>
</div> </div>
@ -540,7 +540,7 @@ for computable / writable fields and get rid of some onchange / read / write cod
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -575,7 +575,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/13.0/server_environment">OCA/server-env</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/14.0/server_environment">OCA/server-env</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>