MuK IT GmbH
6 years ago
16 changed files with 460 additions and 410 deletions
-
240muk_web_client_refresh/README.rst
-
7muk_web_client_refresh/__init__.py
-
11muk_web_client_refresh/__manifest__.py
-
7muk_web_client_refresh/controllers/__init__.py
-
7muk_web_client_refresh/controllers/main.py
-
89muk_web_client_refresh/data/refresh_actions.xml
-
240muk_web_client_refresh/doc/index.rst
-
7muk_web_client_refresh/models/__init__.py
-
115muk_web_client_refresh/models/base.py
-
7muk_web_client_refresh/models/base_automation.py
-
7muk_web_client_refresh/models/ir_actions.py
-
7muk_web_client_refresh/models/res_config_settings.py
-
9muk_web_client_refresh/static/src/js/client_refresh.js
-
15muk_web_client_refresh/template/assets.xml
-
15muk_web_client_refresh/views/refresh_action_view.xml
-
87muk_web_client_refresh/views/res_config_settings_view.xml
@ -1,120 +1,120 @@ |
|||||
====================== |
====================== |
||||
MuK Web Client Refresh |
MuK Web Client Refresh |
||||
====================== |
====================== |
||||
|
Adds a channel called "refresh" to the web client, which can be used to trigger |
||||
Adds a channel called "refresh" to the web client, which can be used to trigger |
a view reload without refreshing the browser itself. Furthermore, it allows the |
||||
a view reload without refreshing the browser itself. Furthermore, it allows the |
user the creation of action rules. These rules can be applied to any model and |
||||
user the creation of action rules. These rules can be applied to any model and |
trigger a refresh either on create, update or unlink. |
||||
trigger a refresh either on create, update or unlink. |
Installation |
||||
|
============ |
||||
Installation |
To install this module, you need to: |
||||
============ |
Download the module and add it to your Odoo addons folder. Afterward, log on to |
||||
|
your Odoo server and go to the Apps menu. Trigger the debug mode and update the |
||||
To install this module, you need to: |
list by clicking on the "Update Apps List" link. Now install the module by |
||||
|
clicking on the install button. |
||||
Download the module and add it to your Odoo addons folder. Afterward, log on to |
Another way to install this module is via the package management for Python |
||||
your Odoo server and go to the Apps menu. Trigger the debug mode and update the |
(`PyPI <https://pypi.org/project/pip/>`_). |
||||
list by clicking on the "Update Apps List" link. Now install the module by |
To install our modules using the package manager make sure |
||||
clicking on the install button. |
`odoo-autodiscover <https://pypi.org/project/odoo-autodiscover/>`_ is installed |
||||
|
correctly. Then open a console and install the module by entering the following |
||||
Another way to install this module is via the package management for Python |
command: |
||||
(`PyPI <https://pypi.org/project/pip/>`_). |
``pip install --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
||||
|
The module name consists of the Odoo version and the module name, where |
||||
To install our modules using the package manager make sure |
underscores are replaced by a dash. |
||||
`odoo-autodiscover <https://pypi.org/project/odoo-autodiscover/>`_ is installed |
**Module:** |
||||
correctly. Then open a console and install the module by entering the following |
``odoo<version>-addon-<module_name>`` |
||||
command: |
**Example:** |
||||
|
``sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo11-addon-muk-utils`` |
||||
``pip install --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
Once the installation has been successfully completed, the app is already in the |
||||
|
correct folder. Log on to your Odoo server and go to the Apps menu. Trigger the |
||||
The module name consists of the Odoo version and the module name, where |
debug mode and update the list by clicking on the "Update Apps List" link. Now |
||||
underscores are replaced by a dash. |
install the module by clicking on the install button. |
||||
|
The biggest advantage of this variant is that you can now also update the app |
||||
**Module:** |
using the "pip" command. To do this, enter the following command in your console: |
||||
|
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
||||
``odoo<version>-addon-<module_name>`` |
When the process is finished, restart your server and update the application in |
||||
|
Odoo. The steps are the same as for the installation only the button has changed |
||||
**Example:** |
from "Install" to "Upgrade". |
||||
|
You can also view available Apps directly in our `repository <https://nexus.mukit.at/#browse/browse:odoo>`_ |
||||
``sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo11-addon-muk-utils`` |
and find a more detailed installation guide on our `website <https://mukit.at/page/open-source>`_. |
||||
|
For modules licensed under OPL-1, you will receive access data when you purchase |
||||
Once the installation has been successfully completed, the app is already in the |
the module. If the modules were not purchased directly from |
||||
correct folder. Log on to your Odoo server and go to the Apps menu. Trigger the |
`MuK IT <https://www.mukit.at/>`_ please contact our support (support@mukit.at) |
||||
debug mode and update the list by clicking on the "Update Apps List" link. Now |
with a confirmation of purchase to receive the corresponding access data. |
||||
install the module by clicking on the install button. |
Upgrade |
||||
|
============ |
||||
The biggest advantage of this variant is that you can now also update the app |
To upgrade this module, you need to: |
||||
using the "pip" command. To do this, enter the following command in your console: |
Download the module and add it to your Odoo addons folder. Restart the server |
||||
|
and log on to your Odoo server. Select the Apps menu and upgrade the module by |
||||
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
clicking on the upgrade button. |
||||
|
If you installed the module using the "pip" command, you can also update the |
||||
When the process is finished, restart your server and update the application in |
module in the same way. Just type the following command into the console: |
||||
Odoo. The steps are the same as for the installation only the button has changed |
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
||||
from "Install" to "Upgrade". |
When the process is finished, restart your server and update the application in |
||||
|
Odoo, just like you would normally. |
||||
You can also view available Apps directly in our `repository <https://nexus.mukit.at/#browse/browse:odoo>`_ |
Configuration |
||||
and find a more detailed installation guide on our `website <https://mukit.at/page/open-source>`_. |
============= |
||||
|
To configure this module, you need to: |
||||
For modules licensed under OPL-1, you will receive access data when you purchase |
#. Go to *Settings* while being in debug mode. |
||||
the module. If the modules were not purchased directly from |
#. Afterwards go to *Technical -> Automation -> Automated Refresh*. |
||||
`MuK IT <https://www.mukit.at/>`_ please contact our support (support@mukit.at) |
#. And create a new refresh action. |
||||
with a confirmation of purchase to receive the corresponding access data. |
Usage |
||||
|
============= |
||||
Upgrade |
Besides creating a action rule, a view refresh can be triggered manually via python. |
||||
============ |
This can be useful if there is a need for a view reload on other operations. |
||||
|
Credits |
||||
To upgrade this module, you need to: |
======= |
||||
|
Contributors |
||||
Download the module and add it to your Odoo addons folder. Restart the server |
------------ |
||||
and log on to your Odoo server. Select the Apps menu and upgrade the module by |
* Mathias Markl <mathias.markl@mukit.at> |
||||
clicking on the upgrade button. |
Images |
||||
|
------------ |
||||
If you installed the module using the "pip" command, you can also update the |
Some pictures are based on or inspired by the icon set of Font Awesome: |
||||
module in the same way. Just type the following command into the console: |
* `Font Awesome <https://fontawesome.com>`_ |
||||
|
Author & Maintainer |
||||
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
------------------- |
||||
|
This module is maintained by the `MuK IT GmbH <https://www.mukit.at/>`_. |
||||
When the process is finished, restart your server and update the application in |
MuK IT is an Austrian company specialized in customizing and extending Odoo. |
||||
Odoo, just like you would normally. |
We develop custom solutions for your individual needs to help you focus on |
||||
|
your strength and expertise to grow your business. |
||||
Configuration |
If you want to get in touch please contact us via mail |
||||
============= |
(sale@mukit.at) or visit our website (https://mukit.at). |
||||
|
|
||||
To configure this module, you need to: |
|
||||
|
|
||||
#. Go to *Settings* while being in debug mode. |
|
||||
#. Afterwards go to *Technical -> Automation -> Automated Refresh*. |
|
||||
#. And create a new refresh action. |
|
||||
|
|
||||
Usage |
|
||||
============= |
|
||||
|
|
||||
Besides creating a action rule, a view refresh can be triggered manually via python. |
|
||||
This can be useful if there is a need for a view reload on other operations. |
|
||||
|
|
||||
Credits |
|
||||
======= |
|
||||
|
|
||||
Contributors |
|
||||
------------ |
|
||||
|
|
||||
* Mathias Markl <mathias.markl@mukit.at> |
|
||||
|
|
||||
Images |
|
||||
------------ |
|
||||
|
|
||||
Some pictures are based on or inspired by the icon set of Font Awesome: |
|
||||
|
|
||||
* `Font Awesome <https://fontawesome.com>`_ |
|
||||
|
|
||||
Author & Maintainer |
|
||||
------------------- |
|
||||
|
|
||||
This module is maintained by the `MuK IT GmbH <https://www.mukit.at/>`_. |
|
||||
|
|
||||
MuK IT is an Austrian company specialized in customizing and extending Odoo. |
|
||||
We develop custom solutions for your individual needs to help you focus on |
|
||||
your strength and expertise to grow your business. |
|
||||
|
|
||||
If you want to get in touch please contact us via mail |
|
||||
(sale@mukit.at) or visit our website (https://mukit.at). |
|
@ -1,43 +1,48 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
<!-- |
Copyright (c) 2017-2019 MuK IT GmbH. |
||||
Copyright (C) 2018 MuK IT GmbH |
This file is part of MuK Web Refresh |
||||
|
(see https://mukit.at). |
||||
This program is free software: you can redistribute it and/or modify |
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU Affero General Public License as |
it under the terms of the GNU Affero General Public License as |
||||
published by the Free Software Foundation, either version 3 of the |
published by the Free Software Foundation, either version 3 of the |
||||
License, or (at your option) any later version. |
License, or (at your option) any later version. |
||||
|
This program is distributed in the hope that it will be useful, |
||||
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Affero General Public License for more details. |
||||
GNU Affero General Public License for more details. |
You should have received a copy of the GNU Affero General Public License |
||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
You should have received a copy of the GNU Affero General Public License |
--> |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
<odoo noupdate="1"> |
||||
--> |
<record id="base_automation_refresh_partner_on_create" model="base.automation"> |
||||
|
<field name="name">Refresh Partner on Creation</field> |
||||
<odoo noupdate="1"> |
<field name="model_id" ref="base.model_res_partner" /> |
||||
|
<field name="state">refresh</field> |
||||
<record id="base_automation_refresh_partner_on_create" model="base.automation"> |
<field name="trigger">on_create</field> |
||||
<field name="name">Refresh Partner on Creation</field> |
</record> |
||||
<field name="model_id" ref="base.model_res_partner" /> |
<record id="base_automation_refresh_partner_on_write" model="base.automation"> |
||||
<field name="state">refresh</field> |
<field name="name">Refresh Partner on Update</field> |
||||
<field name="trigger">on_create</field> |
<field name="model_id" ref="base.model_res_partner" /> |
||||
</record> |
<field name="state">refresh</field> |
||||
|
<field name="trigger">on_write</field> |
||||
<record id="base_automation_refresh_partner_on_write" model="base.automation"> |
</record> |
||||
<field name="name">Refresh Partner on Update</field> |
<record id="base_automation_refresh_partner_on_unlink" model="base.automation"> |
||||
<field name="model_id" ref="base.model_res_partner" /> |
<field name="name">Refresh Partner on Deletion</field> |
||||
<field name="state">refresh</field> |
<field name="model_id" ref="base.model_res_partner" /> |
||||
<field name="trigger">on_write</field> |
<field name="state">refresh</field> |
||||
</record> |
<field name="trigger">on_unlink</field> |
||||
|
</record> |
||||
<record id="base_automation_refresh_partner_on_unlink" model="base.automation"> |
|
||||
<field name="name">Refresh Partner on Deletion</field> |
|
||||
<field name="model_id" ref="base.model_res_partner" /> |
|
||||
<field name="state">refresh</field> |
|
||||
<field name="trigger">on_unlink</field> |
|
||||
</record> |
|
||||
|
|
||||
</odoo> |
</odoo> |
@ -1,120 +1,120 @@ |
|||||
====================== |
====================== |
||||
MuK Web Client Refresh |
MuK Web Client Refresh |
||||
====================== |
====================== |
||||
|
Adds a channel called "refresh" to the web client, which can be used to trigger |
||||
Adds a channel called "refresh" to the web client, which can be used to trigger |
a view reload without refreshing the browser itself. Furthermore, it allows the |
||||
a view reload without refreshing the browser itself. Furthermore, it allows the |
user the creation of action rules. These rules can be applied to any model and |
||||
user the creation of action rules. These rules can be applied to any model and |
trigger a refresh either on create, update or unlink. |
||||
trigger a refresh either on create, update or unlink. |
Installation |
||||
|
============ |
||||
Installation |
To install this module, you need to: |
||||
============ |
Download the module and add it to your Odoo addons folder. Afterward, log on to |
||||
|
your Odoo server and go to the Apps menu. Trigger the debug mode and update the |
||||
To install this module, you need to: |
list by clicking on the "Update Apps List" link. Now install the module by |
||||
|
clicking on the install button. |
||||
Download the module and add it to your Odoo addons folder. Afterward, log on to |
Another way to install this module is via the package management for Python |
||||
your Odoo server and go to the Apps menu. Trigger the debug mode and update the |
(`PyPI <https://pypi.org/project/pip/>`_). |
||||
list by clicking on the "Update Apps List" link. Now install the module by |
To install our modules using the package manager make sure |
||||
clicking on the install button. |
`odoo-autodiscover <https://pypi.org/project/odoo-autodiscover/>`_ is installed |
||||
|
correctly. Then open a console and install the module by entering the following |
||||
Another way to install this module is via the package management for Python |
command: |
||||
(`PyPI <https://pypi.org/project/pip/>`_). |
``pip install --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
||||
|
The module name consists of the Odoo version and the module name, where |
||||
To install our modules using the package manager make sure |
underscores are replaced by a dash. |
||||
`odoo-autodiscover <https://pypi.org/project/odoo-autodiscover/>`_ is installed |
**Module:** |
||||
correctly. Then open a console and install the module by entering the following |
``odoo<version>-addon-<module_name>`` |
||||
command: |
**Example:** |
||||
|
``sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo11-addon-muk-utils`` |
||||
``pip install --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
Once the installation has been successfully completed, the app is already in the |
||||
|
correct folder. Log on to your Odoo server and go to the Apps menu. Trigger the |
||||
The module name consists of the Odoo version and the module name, where |
debug mode and update the list by clicking on the "Update Apps List" link. Now |
||||
underscores are replaced by a dash. |
install the module by clicking on the install button. |
||||
|
The biggest advantage of this variant is that you can now also update the app |
||||
**Module:** |
using the "pip" command. To do this, enter the following command in your console: |
||||
|
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
||||
``odoo<version>-addon-<module_name>`` |
When the process is finished, restart your server and update the application in |
||||
|
Odoo. The steps are the same as for the installation only the button has changed |
||||
**Example:** |
from "Install" to "Upgrade". |
||||
|
You can also view available Apps directly in our `repository <https://nexus.mukit.at/#browse/browse:odoo>`_ |
||||
``sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo11-addon-muk-utils`` |
and find a more detailed installation guide on our `website <https://mukit.at/page/open-source>`_. |
||||
|
For modules licensed under OPL-1, you will receive access data when you purchase |
||||
Once the installation has been successfully completed, the app is already in the |
the module. If the modules were not purchased directly from |
||||
correct folder. Log on to your Odoo server and go to the Apps menu. Trigger the |
`MuK IT <https://www.mukit.at/>`_ please contact our support (support@mukit.at) |
||||
debug mode and update the list by clicking on the "Update Apps List" link. Now |
with a confirmation of purchase to receive the corresponding access data. |
||||
install the module by clicking on the install button. |
Upgrade |
||||
|
============ |
||||
The biggest advantage of this variant is that you can now also update the app |
To upgrade this module, you need to: |
||||
using the "pip" command. To do this, enter the following command in your console: |
Download the module and add it to your Odoo addons folder. Restart the server |
||||
|
and log on to your Odoo server. Select the Apps menu and upgrade the module by |
||||
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
clicking on the upgrade button. |
||||
|
If you installed the module using the "pip" command, you can also update the |
||||
When the process is finished, restart your server and update the application in |
module in the same way. Just type the following command into the console: |
||||
Odoo. The steps are the same as for the installation only the button has changed |
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
||||
from "Install" to "Upgrade". |
When the process is finished, restart your server and update the application in |
||||
|
Odoo, just like you would normally. |
||||
You can also view available Apps directly in our `repository <https://nexus.mukit.at/#browse/browse:odoo>`_ |
Configuration |
||||
and find a more detailed installation guide on our `website <https://mukit.at/page/open-source>`_. |
============= |
||||
|
To configure this module, you need to: |
||||
For modules licensed under OPL-1, you will receive access data when you purchase |
#. Go to *Settings* while being in debug mode. |
||||
the module. If the modules were not purchased directly from |
#. Afterwards go to *Technical -> Automation -> Automated Refresh*. |
||||
`MuK IT <https://www.mukit.at/>`_ please contact our support (support@mukit.at) |
#. And create a new refresh action. |
||||
with a confirmation of purchase to receive the corresponding access data. |
Usage |
||||
|
============= |
||||
Upgrade |
Besides creating a action rule, a view refresh can be triggered manually via python. |
||||
============ |
This can be useful if there is a need for a view reload on other operations. |
||||
|
Credits |
||||
To upgrade this module, you need to: |
======= |
||||
|
Contributors |
||||
Download the module and add it to your Odoo addons folder. Restart the server |
------------ |
||||
and log on to your Odoo server. Select the Apps menu and upgrade the module by |
* Mathias Markl <mathias.markl@mukit.at> |
||||
clicking on the upgrade button. |
Images |
||||
|
------------ |
||||
If you installed the module using the "pip" command, you can also update the |
Some pictures are based on or inspired by the icon set of Font Awesome: |
||||
module in the same way. Just type the following command into the console: |
* `Font Awesome <https://fontawesome.com>`_ |
||||
|
Author & Maintainer |
||||
``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple <module>`` |
------------------- |
||||
|
This module is maintained by the `MuK IT GmbH <https://www.mukit.at/>`_. |
||||
When the process is finished, restart your server and update the application in |
MuK IT is an Austrian company specialized in customizing and extending Odoo. |
||||
Odoo, just like you would normally. |
We develop custom solutions for your individual needs to help you focus on |
||||
|
your strength and expertise to grow your business. |
||||
Configuration |
If you want to get in touch please contact us via mail |
||||
============= |
(sale@mukit.at) or visit our website (https://mukit.at). |
||||
|
|
||||
To configure this module, you need to: |
|
||||
|
|
||||
#. Go to *Settings* while being in debug mode. |
|
||||
#. Afterwards go to *Technical -> Automation -> Automated Refresh*. |
|
||||
#. And create a new refresh action. |
|
||||
|
|
||||
Usage |
|
||||
============= |
|
||||
|
|
||||
Besides creating a action rule, a view refresh can be triggered manually via python. |
|
||||
This can be useful if there is a need for a view reload on other operations. |
|
||||
|
|
||||
Credits |
|
||||
======= |
|
||||
|
|
||||
Contributors |
|
||||
------------ |
|
||||
|
|
||||
* Mathias Markl <mathias.markl@mukit.at> |
|
||||
|
|
||||
Images |
|
||||
------------ |
|
||||
|
|
||||
Some pictures are based on or inspired by the icon set of Font Awesome: |
|
||||
|
|
||||
* `Font Awesome <https://fontawesome.com>`_ |
|
||||
|
|
||||
Author & Maintainer |
|
||||
------------------- |
|
||||
|
|
||||
This module is maintained by the `MuK IT GmbH <https://www.mukit.at/>`_. |
|
||||
|
|
||||
MuK IT is an Austrian company specialized in customizing and extending Odoo. |
|
||||
We develop custom solutions for your individual needs to help you focus on |
|
||||
your strength and expertise to grow your business. |
|
||||
|
|
||||
If you want to get in touch please contact us via mail |
|
||||
(sale@mukit.at) or visit our website (https://mukit.at). |
|
@ -1,56 +1,59 @@ |
|||||
################################################################################### |
################################################################################### |
||||
# |
# |
||||
# Copyright (C) 2018 MuK IT GmbH |
# Copyright (c) 2017-2019 MuK IT GmbH. |
||||
# |
# |
||||
# This program is free software: you can redistribute it and/or modify |
# This file is part of MuK Web Refresh |
||||
# it under the terms of the GNU Affero General Public License as |
# (see https://mukit.at). |
||||
# published by the Free Software Foundation, either version 3 of the |
# |
||||
# License, or (at your option) any later version. |
# This program is free software: you can redistribute it and/or modify |
||||
# |
# it under the terms of the GNU Affero General Public License as |
||||
# This program is distributed in the hope that it will be useful, |
# published by the Free Software Foundation, either version 3 of the |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# License, or (at your option) any later version. |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# |
||||
# GNU Affero General Public License for more details. |
# This program is distributed in the hope that it will be useful, |
||||
# |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# You should have received a copy of the GNU Affero General Public License |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
# GNU Affero General Public License for more details. |
||||
# |
# |
||||
################################################################################### |
# You should have received a copy of the GNU Affero General Public License |
||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
import logging |
# |
||||
|
################################################################################### |
||||
from odoo import api, models, fields |
import logging |
||||
|
from odoo import api, models, fields |
||||
_logger = logging.getLogger(__name__) |
_logger = logging.getLogger(__name__) |
||||
|
class Base(models.AbstractModel): |
||||
class Base(models.AbstractModel): |
_inherit = 'base' |
||||
|
@api.multi |
||||
_inherit = 'base' |
def refresh_views(self, model=None, ids=None, user=None, create=False): |
||||
|
""" Informs the web client to refresh the views that belong to the |
||||
@api.multi |
corresponding model by sending a message to the bus. |
||||
def refresh_views(self, model=None, ids=None, user=None, create=False): |
There are two ways to use this method. First by calling it |
||||
""" Informs the web client to refresh the views that belong to the |
without any parameters. In this case, the views are determined |
||||
corresponding model by sending a message to the bus. |
and updated using the current records in self. Alternatively, |
||||
|
the method can also be called with corresponding parameters |
||||
There are two ways to use this method. First by calling it |
to explicitly update a view from another model. |
||||
without any parameters. In this case, the views are determined |
:param model: The model of the records is used to find the |
||||
and updated using the current records in self. Alternatively, |
corresponding views |
||||
the method can also be called with corresponding parameters |
:param ids: IDs of the records are used to determine which |
||||
to explicitly update a view from another model. |
records have been updated |
||||
|
:param user: The user (res.users) is used to determine whether |
||||
:param model: The model of the records is used to find the |
the current one has caused the refresh |
||||
corresponding views |
:param create: Indicates whether the record has been newly |
||||
:param ids: IDs of the records are used to determine which |
created or updated |
||||
records have been updated |
""" |
||||
:param user: The user (res.users) is used to determine whether |
if self.exists() or ids: |
||||
the current one has caused the refresh |
record = next(iter(self)) if len(self) > 1 else self |
||||
:param create: Indicates whether the record has been newly |
self.env['bus.bus'].sendone('refresh', { |
||||
created or updated |
'create': create if ids else record.exists() and record.create_date == record.write_date or False, |
||||
""" |
'model': model or self._name, |
||||
if self.exists() or ids: |
'uid': user and user.id or False if ids else self.env.user.id, |
||||
record = next(iter(self)) if len(self) > 1 else self |
'ids': ids or self.mapped('id')}) |
||||
self.env['bus.bus'].sendone('refresh', { |
|
||||
'create': create if ids else record.exists() and record.create_date == record.write_date or False, |
|
||||
'model': model or self._name, |
|
||||
'uid': user and user.id or False if ids else self.env.user.id, |
|
||||
'ids': ids or self.mapped('id')}) |
|
@ -1,41 +1,46 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- |
||||
<!-- |
Copyright (c) 2017-2019 MuK IT GmbH. |
||||
Copyright (C) 2017 MuK IT GmbH |
This file is part of MuK Web Refresh |
||||
|
(see https://mukit.at). |
||||
This program is free software: you can redistribute it and/or modify |
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU Affero General Public License as |
it under the terms of the GNU Affero General Public License as |
||||
published by the Free Software Foundation, either version 3 of the |
published by the Free Software Foundation, either version 3 of the |
||||
License, or (at your option) any later version. |
License, or (at your option) any later version. |
||||
|
This program is distributed in the hope that it will be useful, |
||||
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU Affero General Public License for more details. |
||||
GNU Affero General Public License for more details. |
You should have received a copy of the GNU Affero General Public License |
||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
You should have received a copy of the GNU Affero General Public License |
--> |
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
<odoo> |
||||
--> |
<record id="res_config_settings_view_form" model="ir.ui.view"> |
||||
|
<field name="name">res.config.settings.view.form</field> |
||||
<odoo> |
<field name="model">res.config.settings</field> |
||||
|
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/> |
||||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
<field name="arch" type="xml"> |
||||
<field name="name">res.config.settings.view.form</field> |
<div id="msg_module_muk_web_client_refresh" position="replace"> |
||||
<field name="model">res.config.settings</field> |
<div class="content-group" attrs="{'invisible': [('module_muk_web_client_refresh','=',False)]}"> |
||||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/> |
<button name="%(muk_web_client_refresh.action_client_refresh_automation)d" |
||||
<field name="arch" type="xml"> |
string="Configure Actions" type="action" class="oe_link" icon="fa-arrow-right"/> |
||||
<div id="msg_module_muk_web_client_refresh" position="replace"> |
<div class="mt16 row"> |
||||
<div class="content-group" attrs="{'invisible': [('module_muk_web_client_refresh','=',False)]}"> |
<label for="refresh_delay" string="Delay" class="col-xs-3 col-md-3 o_light_label"/> |
||||
<button name="%(muk_web_client_refresh.action_client_refresh_automation)d" |
<field name="refresh_delay" nolabel="1"/> |
||||
string="Configure Actions" type="action" class="oe_link" icon="fa-arrow-right"/> |
</div> |
||||
<div class="mt16 row"> |
</div> |
||||
<label for="refresh_delay" string="Delay" class="col-xs-3 col-md-3 o_light_label"/> |
</div> |
||||
<field name="refresh_delay" nolabel="1"/> |
</field> |
||||
</div> |
</record> |
||||
</div> |
</odoo> |
||||
</div> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
</odoo> |
|
||||
|
|
Reference in new issue
xxxxxxxxxx