mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
@@ -12,7 +12,7 @@ odoo.define("account_reconcile_partial.ReconciliationClientAction", function (re
|
||||
var handle = event.target.handle;
|
||||
var line = this.model.getLine(handle);
|
||||
var amount = this.model.getPartialReconcileAmount(handle, event.data);
|
||||
self._getWidget(handle).updatePartialAmount(event.data.data, amount);
|
||||
self._getWidget(handle).updatePartialAmount(event, amount);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,6 +36,7 @@ odoo.define("account_reconcile_partial.ReconciliationModel", function (require)
|
||||
amount >= Math.abs(prop.amount)
|
||||
|| amount <= 0 || isNaN(amount)
|
||||
) {
|
||||
prop.partial_reconcile = false;
|
||||
delete prop.partial_amount_str;
|
||||
delete prop.partial_amount;
|
||||
if (isNaN(amount) || amount < 0) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
odoo.define('account_reconcile_partial.ReconciliationRenderer', function (require) {
|
||||
"use strict";
|
||||
|
||||
var field_utils = require('web.field_utils');
|
||||
var renderer = require('account.ReconciliationRenderer')
|
||||
|
||||
renderer.LineRenderer.include({
|
||||
@@ -15,12 +16,22 @@ odoo.define('account_reconcile_partial.ReconciliationRenderer', function (requir
|
||||
{'data': $line.closest('.mv_line').data('line-id')}
|
||||
);
|
||||
},
|
||||
updatePartialAmount: function(line_id, amount) {
|
||||
updatePartialAmount: function(event, amount) {
|
||||
var line_id = event.data.data;
|
||||
var $line = this.$('.mv_line[data-line-id='+line_id+']');
|
||||
var handle = event.target.handle;
|
||||
var line = this.model.getLine(handle);
|
||||
var format_options = {
|
||||
currency_id: line.st_line.currency_id,
|
||||
noSymbol: true,
|
||||
};
|
||||
var amount = field_utils.format.monetary(
|
||||
amount, {}, format_options);
|
||||
|
||||
$line.find('.line_info_edit').addClass('o_hidden');
|
||||
$line.find('.edit_amount_input').removeClass('o_hidden');
|
||||
$line.find('.edit_amount_input').focus();
|
||||
$line.find('.edit_amount_input').val(amount.toFixed(2));
|
||||
$line.find('.edit_amount_input').val(amount);
|
||||
$line.find('.edit_amount_input').select();
|
||||
$line.find('.line_amount').addClass('o_hidden');
|
||||
},
|
||||
@@ -50,5 +61,15 @@ odoo.define('account_reconcile_partial.ReconciliationRenderer', function (requir
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
_onSelectProposition: function (event) {
|
||||
var $el = $(event.target);
|
||||
if ($el.hasClass('edit_amount_input')) {
|
||||
// When the input is clicked, it is not to select the line
|
||||
// but simply to write in the input field.
|
||||
// so there is no need to call super that usually removes the line
|
||||
return;
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user