Skip to content
Open
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
73 changes: 73 additions & 0 deletions web_widget_domain_v11/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3

===============================
Odoo 11.0 Domain Widget Preview
===============================

This module replaces the functionality of the domain widget to use a preview of
the brand new interface that will be found in Odoo 11.0.

Usage
=====

To use this module, you need to:

#. Enable the developer mode.
#· Go to *Settings > Technical > User interface > User-defined Filters* and
choose or create one.
#. Choose a model if there is none.
#. You will be able to choose the domain using the updated domain widget.

Install any addon that makes use of the domain widget (i.e. ``mass_mailing``)
and you will be also able to use the new widget there.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/10.0

Known issues / Roadmap
======================

* This addon replaces the built-in ``char_domain`` widget, so it can break
compatibility with other addons that use or extend it.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/web/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Most code copied from https://github.com/odoo/odoo/tree/68176d80ad6053f52ed1c7bcf294ab3664986c46/addons/web/static/src

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Odoo SA <https://www.odoo.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
2 changes: 2 additions & 0 deletions web_widget_domain_v11/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
24 changes: 24 additions & 0 deletions web_widget_domain_v11/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Jairo Llopis <jairo.llopis@tecnativa.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Odoo 11.0 Domain Widget",
"summary": "Updated domain widget",
"version": "10.0.1.0.0",
"category": "Extra Tools",
"website": "https://www.tecnativa.com/",
"author": "Tecnativa, Odoo S.A., Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": [
"web",
],
"data": [
"templates/assets.xml",
"views/ir_filters.xml",
],
"qweb": [
"static/src/copied-xml/templates.xml",
],
}
Binary file added web_widget_domain_v11/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions web_widget_domain_v11/static/src/copied-css/domain_selector.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

.o_domain_node {
@o-domain-selector-vspace: 8px;
@o-domain-selector-indent: 32px;
@o-domain-selector-panel-space: 128px;

.o_domain_node_control_panel {
.o-position-absolute(@right: 0);
}

&.o_domain_tree {
.o_domain_tree_operator_caret::after {
.o-caret-down();
}

> .o_domain_node_children_container {
padding-left: @o-domain-selector-indent;

> div {
margin-top: @o-domain-selector-vspace;
}
}

&.o_domain_selector {
&.o_edit_mode {
position: relative;

> .o_domain_node_children_container {
padding-right: @o-domain-selector-panel-space;
}
}

> .o_domain_node_children_container {
padding-left: 0;
}
}
}

&.o_domain_leaf {
&.o_read_mode {
display: inline-block;
margin-right: 4px;
}

> .o_domain_leaf_info {
background: @odoo-brand-lightsecondary;
border: 1px solid darken(@odoo-brand-lightsecondary, 10%);
padding: 2px 4px;

.o_domain_leaf_chain, .o_domain_leaf_value {
font-weight: 700;
}
.o_domain_leaf_operator {
font-style: italic;
}
}

> .o_domain_leaf_edition {
.o-flex-display();
.o-align-items(flex-end);

> * {
width: percentage(1/3);

+ * {
margin-left: 4px;
}
}

.o_domain_leaf_value_tags {
.o-flex-display();

> * {
.o-flex(0, 0, auto);
}
> input {
.o-flex(1, 1, auto);
width: 0;
min-width: 50px;
}
.o_domain_leaf_value_remove_tag_button {
cursor: pointer;
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

.o_field_selector {
position: relative;

.o_field_selector_controls {
.o-position-absolute(0, 0, 1px);
.o-flex-display();
.o-align-items(center);
cursor: pointer;

&::after {
.o-caret-down();
}
}
.o_field_selector_popover {
@o-field-selector-arrow-height: 7px;
.o-position-absolute(@top: 100%, @left: 0);
z-index: 1051;
width: 265px;
margin-top: @o-field-selector-arrow-height;
background: white;
box-shadow: 0 3px 10px rgba(0,0,0,.4);

&:focus {
outline: none;
}

.o_field_selector_popover_header {
color: white;
background: @brand-primary;
font-weight: bold;
padding: 5px 0 5px 0.4em;

.o_field_selector_title {
width: 100%;
.o-text-overflow();
padding: 0px 35px;
text-align: center;
}
.o_field_selector_popover_option {
.o-position-absolute(@top: 0);
padding: 7px 8px 8px 6px;

&.o_prev_page {
left: 0;
border-right: 1px solid darken(@brand-primary, 10%);
}
&.o_field_selector_close {
right: 0;
border-left: 1px solid darken(@brand-primary, 10%);
}
&:hover {
background: darken(@brand-primary, 10%);
}
}
&:before {
.o-position-absolute(@top: -@o-field-selector-arrow-height, @left: @o-field-selector-arrow-height);
content: "";
border-left: @o-field-selector-arrow-height solid rgba(0, 0, 0, 0);
border-right: @o-field-selector-arrow-height solid rgba(0, 0, 0, 0);
border-bottom: @o-field-selector-arrow-height solid @brand-primary;
}
}
.o_field_selector_popover_body {
.o_field_selector_page {
position: relative;
max-height: 320px;
overflow: auto;
margin: 0;
padding: 0;

> .o_field_selector_item {
list-style: none;
position: relative;
padding: 5px 0 5px 0.4em;
cursor: pointer;
font-family: Arial;
font-size: 13px;
color: #444;
border-bottom: 1px solid #eee;
&.active {
background: #f5f5f5;
}
.o_field_selector_item_title {
font-size: 12px;
}
.o_field_selector_relation_icon {
.o-position-absolute(@top: 0, @right: 0, @bottom: 0);
.o-flex-display();
.o-align-items(center);
padding: 10px;
}
}
}
}
}
}
Loading