[FIX]account: reconciliation widget, some usability features

This commit is contained in:
Cedric Snauwaert 2014-06-17 11:29:27 +02:00 committed by qdp-odoo
parent 1546d022ab
commit cae213974b
4 changed files with 12 additions and 29 deletions

View File

@ -120,8 +120,6 @@
cursor: pointer; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line.no_match:not(.no_partner) .toggle_match {
visibility: hidden !important; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line.no_partner .partner_name, .openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line.no_partner .line_open_balance {
display: none !important; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line > table > tbody > tr:nth-child(1) > td table {
margin-bottom: 10px; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line table.details td:first-child {
@ -202,10 +200,6 @@
cursor: pointer; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view td:nth-child(6) {
border-left: 1px solid black; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view tr.initial_line > td:nth-child(5) {
border-top: 1px solid black; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .accounting_view tr.initial_line > td:nth-child(6) {
border-top: 1px solid black; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match .match_controls {
padding: 0 0 5px 18px; }
.openerp .oe_bank_statement_reconciliation .oe_bank_statement_reconciliation_line .match .match_controls .filter {

View File

@ -194,12 +194,6 @@ $initialLineBackground: #f0f0f0;
}
}
&.no_partner {
.partner_name, .line_open_balance {
display: none !important;
}
}
/* gap between accounting_view and action view */
> table > tbody > tr:nth-child(1) > td table {
margin-bottom: 10px;
@ -341,10 +335,6 @@ $initialLineBackground: #f0f0f0;
// accounting "T"
td:nth-child(6) { border-left: $accountingBorder; }
tr.initial_line > td {
&:nth-child(5) { border-top: $accountingBorder; }
&:nth-child(6) { border-top: $accountingBorder; }
}
}

View File

@ -245,7 +245,7 @@ openerp.account = function (instance) {
keyboardShortcutsHandler: function(e) {
var self = this;
if (e.which === 13 && (e.ctrlKey || e.metaKey)) {
if ((e.which === 13 || e.which === 10) && (e.ctrlKey || e.metaKey)) {
$.each(self.getChildren(), function(i, o){
if (o.is_valid && o.persistAndDestroy()) {
self.lines_reconciled_with_ctrl_enter++;
@ -981,6 +981,7 @@ openerp.account = function (instance) {
lineOpenBalanceClickHandler: function() {
var self = this;
if (self.get("mode") === "create") {
self.addLineBeingEdited();
self.set("mode", "match");
} else {
self.set("mode", "create");
@ -1075,7 +1076,7 @@ openerp.account = function (instance) {
balanceChanged: function() {
var self = this;
var balance = self.get("balance");
self.$(".tbody_open_balance").empty();
// Special case hack : no identified partner
if (self.st_line.has_no_partner) {
if (Math.abs(balance).toFixed(3) === "0.000") {
@ -1088,11 +1089,15 @@ openerp.account = function (instance) {
self.$(".button_ok").attr("disabled", "disabled");
self.$(".button_ok").text("OK");
self.is_valid = false;
var debit = (balance > 0 ? self.formatCurrency(balance, self.st_line.currency_id) : "");
var credit = (balance < 0 ? self.formatCurrency(-1*balance, self.st_line.currency_id) : "");
var $line = $(QWeb.render("bank_statement_reconciliation_line_open_balance", {debit: debit, credit: credit, account_code: self.map_account_id_code[self.st_line.open_balance_account_id]}));
$line.find('.js_open_balance')[0].innerHTML = "Choose counterpart";
self.$(".tbody_open_balance").append($line);
}
return;
}
self.$(".tbody_open_balance").empty();
if (Math.abs(balance).toFixed(3) === "0.000") {
self.$(".button_ok").addClass("oe_highlight");
self.$(".button_ok").text("OK");
@ -1111,21 +1116,15 @@ openerp.account = function (instance) {
self.$(".action_pane.active").removeClass("active");
// Special case hack : if no_partner, either inactive or create
// Special case hack : if no_partner and mode == inactive
if (self.st_line.has_no_partner) {
if (self.get("mode") === "inactive") {
self.$(".match").slideUp(self.animation_speed);
self.$(".create").slideUp(self.animation_speed);
self.$(".toggle_match").removeClass("visible_toggle");
self.el.dataset.mode = "inactive";
} else {
self.initializeCreateForm();
self.$(".match").slideUp(self.animation_speed);
self.$(".create").slideDown(self.animation_speed);
self.$(".toggle_match").addClass("visible_toggle");
self.el.dataset.mode = "create";
}
return;
return;
}
}
if (self.get("mode") === "inactive") {

View File

@ -185,7 +185,7 @@
<td><span class="toggle_create glyphicon glyphicon-play"></span></td>
<td><t t-esc="account_code"/></td>
<td></td>
<td>Open balance</td>
<td class="js_open_balance">Open balance</td>
<td><t t-esc="debit"/></td>
<td><t t-esc="credit"/></td>
<td></td>