summaryrefslogtreecommitdiff
path: root/addons/account/static
diff options
context:
space:
mode:
authoroco-odoo <oco@odoo.com>2020-01-09 11:08:49 +0000
committeroco-odoo <oco@odoo.com>2020-01-17 13:34:15 +0000
commit170eaa4743562bdb54a569b492aea632472bd525 (patch)
treefe207da675c83ea6f4f8866a6087e344f1d1bfaf /addons/account/static
parenta62abf22d0434968a77fdadc6a858a70c5e0f08a (diff)
[IMP] account: add wizard to perform transfers between accounts
This wizard also reconciles automatically entries done on reconcilable accounts. It can hence for example be used to "move" the balance of a receivable account into a payable account (or the opposite), using the generated transfer entry to do as if the receivable and payable accounts were directly reconciled together. [IMP] account: display 'P' as matching number when account.move.line objects are partially reconciled For this, we introduce a new matching_number field, used in account.move.line's tree views instead of full_reconcile_id, which used to be shown directly. Was task: 2037318 closes odoo/odoo#39415 Related: odoo/enterprise#6544 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Diffstat (limited to 'addons/account/static')
-rw-r--r--addons/account/static/src/js/account_payment_field.js2
-rw-r--r--addons/account/static/src/js/aml_preview.js42
-rw-r--r--addons/account/static/src/xml/aml_preview_templates.xml33
3 files changed, 76 insertions, 1 deletions
diff --git a/addons/account/static/src/js/account_payment_field.js b/addons/account/static/src/js/account_payment_field.js
index 952d6424184..7899920a1b8 100644
--- a/addons/account/static/src/js/account_payment_field.js
+++ b/addons/account/static/src/js/account_payment_field.js
@@ -163,5 +163,5 @@ field_registry.add('payment', ShowPaymentLineWidget);
return {
ShowPaymentLineWidget: ShowPaymentLineWidget
};
-
+
});
diff --git a/addons/account/static/src/js/aml_preview.js b/addons/account/static/src/js/aml_preview.js
new file mode 100644
index 00000000000..a8f5c668504
--- /dev/null
+++ b/addons/account/static/src/js/aml_preview.js
@@ -0,0 +1,42 @@
+odoo.define('account.move.line.preview', function (require) {
+"use strict";
+
+var AbstractField = require('web.AbstractField');
+var core = require('web.core');
+var field_registry = require('web.field_registry');
+var field_utils = require('web.field_utils');
+
+var QWeb = core.qweb;
+
+
+var AccountMoveLinePreviewWidget = AbstractField.extend({
+
+ supportedFieldTypes: ['char'],
+
+ /**
+ * @private
+ * @override
+ */
+ _render: function() {
+ var self = this;
+ var all_aml_data = JSON.parse(this.value);
+
+ if (!all_aml_data) {
+ this.$el.html('');
+ return;
+ }
+
+ this.$el.html(QWeb.render('AccountMoveLinePreview', {
+ lines_to_preview: all_aml_data,
+ }));
+
+ },
+});
+
+field_registry.add('aml_preview', AccountMoveLinePreviewWidget);
+
+return {
+ AccountMoveLinePreviewWidget: AccountMoveLinePreviewWidget
+};
+
+}); \ No newline at end of file
diff --git a/addons/account/static/src/xml/aml_preview_templates.xml b/addons/account/static/src/xml/aml_preview_templates.xml
new file mode 100644
index 00000000000..919526b9526
--- /dev/null
+++ b/addons/account/static/src/xml/aml_preview_templates.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<templates xml:space="preserve">
+
+ <t t-name="AccountMoveLinePreview">
+ <div class="table-responsive">
+ <table class="o_list_table table table-sm table-hover table-striped o_list_table_ungrouped"
+ style="table-layout: fixed">
+ <thead>
+ <tr>
+ <th>Account</th>
+ <th>Label</th>
+ <th>Partner</th>
+ <th>Debit</th>
+ <th>Credit</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <t t-foreach="lines_to_preview" t-as="line">
+ <tr class="o_data_row">
+ <td><t t-esc="line['preview-account']"/></td>
+ <td><t t-esc="line['name']"/></td>
+ <td><t t-esc="line['preview-partner']"/></td>
+ <td align="center"><t t-esc="line['debit']"/></td>
+ <td align="center"><t t-esc="line['credit']"/></td>
+ </tr>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </t>
+</templates> \ No newline at end of file