Browse Source

[11.0][IMP] base_tier_validation module

11.0
Adrià Gil Sorribes 6 years ago
committed by OCA-git-bot
parent
commit
f4abd9d39e
  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. 19
      base_tier_validation/static/src/js/tier_review_widget.js
  6. 40
      base_tier_validation/static/src/less/review.less
  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 #. Create as many tiers as you want for any model having tier validation
functionality. 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 Bug Tracker
=========== ===========

2
base_tier_validation/__manifest__.py

@ -3,7 +3,7 @@
{ {
"name": "Base Tier Validation", "name": "Base Tier Validation",
"summary": "Implement a validation process based on tiers.", "summary": "Implement a validation process based on tiers.",
"version": "11.0.2.1.0",
"version": "11.0.3.0.0",
"development_status": "Mature", "development_status": "Mature",
"maintainers": ['lreficent'], "maintainers": ['lreficent'],
"category": "Tools", "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"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li> <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> </ul>
</li> </li>
</ul> </ul>
@ -397,17 +396,8 @@ development.</p>
functionality.</li> functionality.</li>
</ol> </ol>
</div> </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"> <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>. <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. 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
@ -415,22 +405,22 @@ 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> <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">
<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"> <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"> <ul class="simple">
<li>Eficent</li> <li>Eficent</li>
</ul> </ul>
</div> </div>
<div class="section" id="contributors"> <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"> <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>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;eficent.com">lois.rilo&#64;eficent.com</a>&gt;</li>
<li>Adrià Gil Sorribes &lt;<a class="reference external" href="mailto:adria.gil&#64;eficent.com">adria.gil&#64;eficent.com</a>&gt;</li> <li>Adrià Gil Sorribes &lt;<a class="reference external" href="mailto:adria.gil&#64;eficent.com">adria.gil&#64;eficent.com</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <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> <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> <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 <p>OCA, or the Odoo Community Association, is a nonprofit organization whose

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

@ -11,14 +11,15 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
var QWeb = core.qweb; var QWeb = core.qweb;
var ReviewField = AbstractField.extend({ var ReviewField = AbstractField.extend({
template: 'tier.review.ReviewPopUp',
template: 'tier.review.Collapse',
events: { events: {
'click .o_info_btn': '_onButtonClicked', 'click .o_info_btn': '_onButtonClicked',
'show.bs.collapse': '_showCollapse',
'hide.bs.collapse': '_hideCollapse'
}, },
start: function () { start: function () {
var self = this; var self = this;
console.log(self)
self._renderDropdown();
}, },
/** /**
* Make RPC and get current user's activity details * Make RPC and get current user's activity details
@ -27,7 +28,7 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
_getReviewData: function(res_ids){ _getReviewData: function(res_ids){
var self = this; var self = this;
return self._rpc({
return this._rpc({
model: 'res.users', model: 'res.users',
method: 'get_reviews', method: 'get_reviews',
args: [res_ids], args: [res_ids],
@ -38,7 +39,7 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
_renderDropdown: function () { _renderDropdown: function () {
var self = this; var self = this;
return this._getReviewData(self.value).then(function (){ 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 reviews : self.reviews
})); }));
}); });
@ -49,9 +50,15 @@ odoo.define('base_tier_validation.ReviewField', function (require) {
this._renderDropdown(); 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; return ReviewField;

40
base_tier_validation/static/src/less/review.less

@ -2,3 +2,43 @@ ul.o_review {
min-width: 600px; min-width: 600px;
max-width: 800px max-width: 800px
} }
.panel-group {
min-height: auto !important;
margin-top: -12px !important;
padding: 6px !important;
}
.panel-review {
.panel-heading {
background-color: initial !important;
}
.panel {
border: 0px !important;
}
.collapse > .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"?> <?xml version="1.0" encoding="UTF-8"?>
<templates> <templates>
<t t-name="tier.review.ReviewPopUp">
<div class="dropdown btn btn-sm oe_stat_button">
<div class="dropdown-toggle 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 panel-review">
<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>
</div> </div>
<ul class="dropdown-menu o_review" role="menu" style="right:0;left: auto">
</ul>
</div> </div>
</t> </t>
<t t-name="tier.review.ReviewDropDown">
<t t-name="tier.review.ReviewsTable">
<table class="oe_mt32 table table-condensed"> <table class="oe_mt32 table table-condensed">
<thead> <thead>
<tr> <tr>

2
base_tier_validation/views/assets_backend.xml

@ -4,7 +4,7 @@
inherit_id="web.assets_backend"> inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <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/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/less/systray.less" type="text/less"/> <link rel="stylesheet" href="/base_tier_validation/static/src/less/systray.less" type="text/less"/>
<link rel="stylesheet" href="/base_tier_validation/static/src/less/review.less" type="text/less"/> <link rel="stylesheet" href="/base_tier_validation/static/src/less/review.less" type="text/less"/>

Loading…
Cancel
Save