forked from Techsystech/web
[IMP] web_widget_open_tab
parent
d48de150b2
commit
2bd23ec0b8
|
@ -7,7 +7,7 @@ Widget Open on new Tab
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:253cc0a593e877d97926c666e3e8a96f13bebefc8a4c8347856585cd928551aa
|
||||
!! source digest: sha256:a14f7a08311efe9efc5c2e59a089a3adfe9f4a41cafd1c7c4c8bf9aac5db6706
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
|
@ -48,6 +48,10 @@ Edit the tree view and add the widget as the first field, usually, we should use
|
|||
You can open the record in a new tab when clicking with the mouse wheel on the external link icon.
|
||||
On a usual click the record will be opened without changes (keeping the breadcrumbs).
|
||||
|
||||
You can also add open-tab field in tree views by selecting "Add Open Tab Field" field in
|
||||
the ir.model record. When you do this, the open-tab field is added right after the name
|
||||
field in the tree if the field exists, otherwise at the beginning of the tree.
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
|
||||
|
@ -77,6 +81,9 @@ Contributors
|
|||
* Enric Tobella <etobella@creublanca.es>
|
||||
* Raf Ven <raf.ven@dynapps.be>
|
||||
* Dhara Solanki <dhara.solanki@initos.com>
|
||||
* `Quartile <https://www.quartile.co>`__:
|
||||
|
||||
* Aung Ko Ko Lin
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
from . import models
|
|
@ -5,12 +5,15 @@
|
|||
"name": "Widget Open on new Tab",
|
||||
"summary": """
|
||||
Allow to open record from trees on new tab from tree views""",
|
||||
"version": "16.0.1.0.0",
|
||||
"version": "16.0.2.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Creu Blanca,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/web",
|
||||
"depends": ["web"],
|
||||
"demo": ["demo/res_users_view.xml"],
|
||||
"data": [
|
||||
"views/ir_model_views.xml",
|
||||
],
|
||||
"assets": {
|
||||
"web.assets_backend": [
|
||||
"web_widget_open_tab/static/src/xml/open_tab_widget.xml",
|
||||
|
|
|
@ -16,6 +16,21 @@ msgstr ""
|
|||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 4.3.2\n"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model.fields,field_description:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Add Open Tab Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model.fields,help:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Adds open-tab field in list views."
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
|
@ -23,6 +38,11 @@ msgstr ""
|
|||
msgid "Click to open on new tab"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
|
|
|
@ -17,15 +17,43 @@ msgstr ""
|
|||
"X-Generator: Weblate 4.3.2\n"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_open_tab/static/src/js/widget.js:0
|
||||
#, python-format
|
||||
msgid "Click in order to open on new tab"
|
||||
msgstr "Anklicken, um in einem neuen Tab zu öffnen"
|
||||
#: model:ir.model.fields,field_description:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Add Open Tab Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_open_tab/static/src/js/widget.js:0
|
||||
#: model:ir.model.fields,help:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Adds open-tab field in list views."
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Widget"
|
||||
msgstr "Widget"
|
||||
msgid "Click to open on new tab"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Open Tab"
|
||||
msgstr ""
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Click in order to open on new tab"
|
||||
#~ msgstr "Anklicken, um in einem neuen Tab zu öffnen"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Widget"
|
||||
#~ msgstr "Widget"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_widget_open_tab
|
||||
# * web_widget_open_tab
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
@ -17,15 +17,43 @@ msgstr ""
|
|||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_open_tab/static/src/js/widget.js:47
|
||||
#, python-format
|
||||
msgid "Click in order to open on new tab"
|
||||
msgstr "Clica para poder abrir una nueva pestaña"
|
||||
#: model:ir.model.fields,field_description:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Add Open Tab Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_open_tab/static/src/js/widget.js:48
|
||||
#: model:ir.model.fields,help:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Adds open-tab field in list views."
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Widget"
|
||||
msgstr "Widget"
|
||||
msgid "Click to open on new tab"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Open Tab"
|
||||
msgstr ""
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Click in order to open on new tab"
|
||||
#~ msgstr "Clica para poder abrir una nueva pestaña"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "Widget"
|
||||
#~ msgstr "Widget"
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_widget_open_tab
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-05-27 08:24+0000\n"
|
||||
"PO-Revision-Date: 2023-05-27 08:24+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model.fields,field_description:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Add Open Tab Field"
|
||||
msgstr "別タブ表示ボタン追加"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model.fields,help:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Adds open-tab field in list views."
|
||||
msgstr "リストビューに別タブ表示ボタンを追加。"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_base
|
||||
msgid "Base"
|
||||
msgstr "ベース"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Click to open on new tab"
|
||||
msgstr "クリックして別タブを開く"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr "モデル"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Open Tab"
|
||||
msgstr "別タブを開く"
|
|
@ -1,6 +1,6 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_widget_open_tab
|
||||
# * web_widget_open_tab
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
|
@ -15,15 +15,35 @@ msgstr ""
|
|||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_open_tab/static/src/js/widget.js:47
|
||||
#, python-format
|
||||
msgid "Click in order to open on new tab"
|
||||
#: model:ir.model.fields,field_description:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Add Open Tab Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_open_tab/static/src/js/widget.js:48
|
||||
#, python-format
|
||||
msgid "Widget"
|
||||
#: model:ir.model.fields,help:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Adds open-tab field in list views."
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Click to open on new tab"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
#, python-format
|
||||
msgid "Open Tab"
|
||||
msgstr ""
|
||||
|
|
|
@ -13,6 +13,21 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model.fields,field_description:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Add Open Tab Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model.fields,help:web_widget_open_tab.field_ir_model__add_open_tab_field
|
||||
msgid "Adds open-tab field in list views."
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_base
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
|
@ -20,6 +35,11 @@ msgstr ""
|
|||
msgid "Click to open on new tab"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#: model:ir.model,name:web_widget_open_tab.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr ""
|
||||
|
||||
#. module: web_widget_open_tab
|
||||
#. odoo-javascript
|
||||
#: code:addons/web_widget_open_tab/static/src/js/open_tab_widget.esm.js:0
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
from . import ir_model
|
||||
from . import ir_ui_view
|
|
@ -0,0 +1,10 @@
|
|||
# Copyright 2023 Quartile Limited
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class IrModel(models.Model):
|
||||
_inherit = "ir.model"
|
||||
|
||||
add_open_tab_field = fields.Boolean(help="Adds open-tab field in list views.")
|
|
@ -0,0 +1,25 @@
|
|||
# Copyright 2023 Quartile Limited
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class Base(models.AbstractModel):
|
||||
_inherit = "base"
|
||||
|
||||
@api.model
|
||||
def _get_view(self, view_id=None, view_type="form", **options):
|
||||
arch, view = super()._get_view(view_id, view_type, **options)
|
||||
model = self.env["ir.model"]._get(self._name)
|
||||
if view_type == "tree" and model.add_open_tab_field:
|
||||
id_elem = """<field name="id" widget="open_tab" nolabel="1"/>"""
|
||||
id_elem = etree.fromstring(id_elem)
|
||||
tree = arch.xpath("//tree")[0]
|
||||
name_field = tree.xpath('./field[@name="name"]')
|
||||
if name_field:
|
||||
tree.insert(name_field[0].getparent().index(name_field[0]) + 1, id_elem)
|
||||
else:
|
||||
tree.insert(0, id_elem)
|
||||
return arch, view
|
|
@ -1,3 +1,6 @@
|
|||
* Enric Tobella <etobella@creublanca.es>
|
||||
* Raf Ven <raf.ven@dynapps.be>
|
||||
* Dhara Solanki <dhara.solanki@initos.com>
|
||||
* `Quartile <https://www.quartile.co>`__:
|
||||
|
||||
* Aung Ko Ko Lin
|
||||
|
|
|
@ -5,3 +5,7 @@ Edit the tree view and add the widget as the first field, usually, we should use
|
|||
|
||||
You can open the record in a new tab when clicking with the mouse wheel on the external link icon.
|
||||
On a usual click the record will be opened without changes (keeping the breadcrumbs).
|
||||
|
||||
You can also add open-tab field in tree views by selecting "Add Open Tab Field" field in
|
||||
the ir.model record. When you do this, the open-tab field is added right after the name
|
||||
field in the tree if the field exists, otherwise at the beginning of the tree.
|
||||
|
|
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
|||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:253cc0a593e877d97926c666e3e8a96f13bebefc8a4c8347856585cd928551aa
|
||||
!! source digest: sha256:a14f7a08311efe9efc5c2e59a089a3adfe9f4a41cafd1c7c4c8bf9aac5db6706
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/16.0/web_widget_open_tab"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_open_tab"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This addon introduces a new widget.
|
||||
|
@ -395,6 +395,9 @@ When clicking on the line (but not on the button), the record is opened in the s
|
|||
<field name=”id” widget=”open_tab”/></blockquote>
|
||||
<p>You can open the record in a new tab when clicking with the mouse wheel on the external link icon.
|
||||
On a usual click the record will be opened without changes (keeping the breadcrumbs).</p>
|
||||
<p>You can also add open-tab field in tree views by selecting “Add Open Tab Field” field in
|
||||
the ir.model record. When you do this, the open-tab field is added right after the name
|
||||
field in the tree if the field exists, otherwise at the beginning of the tree.</p>
|
||||
</div>
|
||||
<div class="section" id="known-issues-roadmap">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
|
||||
|
@ -424,6 +427,10 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||
<li>Enric Tobella <<a class="reference external" href="mailto:etobella@creublanca.es">etobella@creublanca.es</a>></li>
|
||||
<li>Raf Ven <<a class="reference external" href="mailto:raf.ven@dynapps.be">raf.ven@dynapps.be</a>></li>
|
||||
<li>Dhara Solanki <<a class="reference external" href="mailto:dhara.solanki@initos.com">dhara.solanki@initos.com</a>></li>
|
||||
<li><a class="reference external" href="https://www.quartile.co">Quartile</a>:<ul>
|
||||
<li>Aung Ko Ko Lin</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="ir_model_view" model="ir.ui.view">
|
||||
<field name="name">ir.model.view.form</field>
|
||||
<field name="model">ir.model</field>
|
||||
<field name="inherit_id" ref="base.view_model_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='transient']" position="after">
|
||||
<field name="add_open_tab_field" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
Loading…
Reference in New Issue