Browse Source

[12.0][IMP] base_tier_validation module

pull/77/head
Adrià Gil Sorribes 6 years ago
parent
commit
80177cddbf
  1. 8
      base_tier_validation/README.rst
  2. 2
      base_tier_validation/__manifest__.py
  3. 4
      base_tier_validation/readme/ROADMAP.rst
  4. 30
      base_tier_validation/static/description/index.html
  5. 16
      base_tier_validation/static/src/js/tier_review_widget.js
  6. 36
      base_tier_validation/static/src/scss/review.scss
  7. 22
      base_tier_validation/static/src/xml/tier_review_template.xml
  8. 2
      base_tier_validation/views/assets_backend.xml

8
base_tier_validation/README.rst

@ -49,14 +49,6 @@ To configure this module, you need to:
#. Create as many tiers as you want for any model having tier validation
functionality.
Known issues / Roadmap
======================
* It would be interesting to improve the current tooltip to display reviews
to make it responsible and more "Odoo-ish". For instance, to use a
widget capable to display a tree view as a drop-down without needing
to navigate to a new screen.
Bug Tracker
===========

2
base_tier_validation/__manifest__.py

@ -3,7 +3,7 @@
{
"name": "Base Tier Validation",
"summary": "Implement a validation process based on tiers.",
"version": "12.0.2.1.0",
"version": "12.0.3.0.0",
"development_status": "Mature",
"maintainers": ['lreficent'],
"category": "Tools",

4
base_tier_validation/readme/ROADMAP.rst

@ -1,4 +0,0 @@
* It would be interesting to improve the current tooltip to display reviews
to make it responsible and more "Odoo-ish". For instance, to use a
widget capable to display a tree view as a drop-down without needing
to navigate to a new screen.

30
base_tier_validation/static/description/index.html

@ -378,12 +378,11 @@ development.</p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
</ul>
</li>
</ul>
@ -397,17 +396,8 @@ development.</p>
functionality.</li>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>It would be interesting to improve the current tooltip to display reviews
to make it responsible and more “Odoo-ish”. For instance, to use a
widget capable to display a tree view as a drop-down without needing
to navigate to a new screen.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
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
@ -415,15 +405,15 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
<ul class="simple">
<li>Eficent</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;eficent.com">lois.rilo&#64;eficent.com</a>&gt;</li>
<li>Naglis Jonaitis &lt;<a class="reference external" href="mailto:naglis&#64;versada.eu">naglis&#64;versada.eu</a>&gt;</li>
@ -431,7 +421,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose

16
base_tier_validation/static/src/js/review_widget.js → base_tier_validation/static/src/js/tier_review_widget.js

@ -11,9 +11,11 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
var QWeb = core.qweb;
var ReviewField = AbstractField.extend({
template: 'tier.review.ReviewPopUp',
template: 'tier.review.Collapse',
events: {
'click .o_info_btn': '_onButtonClicked',
'show.bs.collapse': '_showCollapse',
'hide.bs.collapse': '_hideCollapse'
},
start: function () {
var self = this;
@ -26,7 +28,7 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
_getReviewData: function(res_ids){
var self = this;
return self._rpc({
return this._rpc({
model: 'res.users',
method: 'get_reviews',
args: [res_ids],
@ -37,7 +39,7 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
_renderDropdown: function () {
var self = this;
return this._getReviewData(self.value).then(function (){
self.$('.o_review').html(QWeb.render("tier.review.ReviewDropDown", {
self.$('.o_review').html(QWeb.render("tier.review.ReviewsTable", {
reviews : self.reviews
}));
});
@ -48,9 +50,15 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
this._renderDropdown();
}
},
_showCollapse: function () {
this.$el.find('.panel-heading').addClass('active');
},
_hideCollapse: function () {
this.$el.find('.panel-heading').removeClass('active');
}
});
field_registry.add('review_popup', ReviewField);
field_registry.add('tier_validation', ReviewField);
return ReviewField;

36
base_tier_validation/static/src/scss/review.scss

@ -2,3 +2,39 @@ ul.o_review {
min-width: 600px;
max-width: 800px
}
.panel-group {
min-height: auto !important;
margin-top: -6px !important;
padding: 16px 16px 8px 16px !important;
}
.panel-heading {
background-color: initial !important;
}
.panel {
border: 0px !important;
}
.panel-body {
overflow-y: hidden;
overflow-x: auto;
}
.panel-title>a, .panel-title>a:active{
display:block;
}
.panel-heading a:before {
font-family: FontAwesome;
content: "\f0d7";
float: right;
transition: all 0.5s;
}
.panel-heading.active a:before {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
transform: rotate(180deg);
}

22
base_tier_validation/static/src/xml/tier_review_template.xml

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="tier.review.ReviewPopUp">
<div class="dropdown btn btn-sm oe_stat_button">
<div class="o_info_btn" data-toggle="dropdown" style="height:100%;width:100%;display:table">
<div style="display:table-cell;vertical-align:middle">
<div class="fa fa-fw o_button_icon fa-pencil-square-o"/>
<div class="o_field_widget o_stat_info o_readonly_modifier">
<span class="o_stat_text">Reviews</span>
</div>
<t t-name="tier.review.Collapse">
<div class="o_form_sheet panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="o_info_btn" data-toggle="collapse" href="#" data-target="#collapse1">Reviews</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body o_review"></div>
</div>
</div>
<ul class="dropdown-menu dropdown-menu-right o_review" role="menu" style="right:0;left: auto;width:min-content;">
</ul>
</div>
</t>
<t t-name="tier.review.ReviewDropDown">
<t t-name="tier.review.ReviewsTable">
<table class="oe_mt32 table table-condensed">
<thead>
<tr>

2
base_tier_validation/views/assets_backend.xml

@ -4,7 +4,7 @@
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/base_tier_validation/static/src/js/systray.js"/>
<script type="text/javascript" src="/base_tier_validation/static/src/js/review_widget.js"/>
<script type="text/javascript" src="/base_tier_validation/static/src/js/tier_review_widget.js"/>
<link rel="stylesheet" href="/base_tier_validation/static/src/scss/systray.scss" type="text/scss"/>
<link rel="stylesheet" href="/base_tier_validation/static/src/scss/review.scss" type="text/scss"/>

Loading…
Cancel
Save