diff options
| author | Hetashree Chauhan <hch@odoo.com> | 2019-08-19 09:44:21 +0000 |
|---|---|---|
| committer | Ravi Gohil <rgo@odoo.com> | 2019-09-06 07:12:06 +0000 |
| commit | 4a1bbbff75dde3ef0f69e30efeed23cd5be268d0 (patch) | |
| tree | 48ee2565dc47837f3825e92f094b8e2cf3d38918 /addons/account/static/src | |
| parent | 36757cde6d00a9e9059ce0bfb73d768c26743ab8 (diff) | |
[IMP] account: various improvements
- show period along with 'Tax Report' activity of journals on accounting dashboard.
- added 'Upload Invoices' button on sales journals in Accounting Dashboard.
- added 'New Bill' button on purchase journals in Accounting Dashboard.
Task: 34740
Closes: #34740
Co-authored-by: Hardik Prajapati <hpr@odoo.com>
Diffstat (limited to 'addons/account/static/src')
| -rw-r--r-- | addons/account/static/src/js/bills_tree_upload.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/account/static/src/js/bills_tree_upload.js b/addons/account/static/src/js/bills_tree_upload.js index 2287ca09d7c..3e36b495e1a 100644 --- a/addons/account/static/src/js/bills_tree_upload.js +++ b/addons/account/static/src/js/bills_tree_upload.js @@ -99,6 +99,22 @@ odoo.define('account.dashboard.kanban', function (require) { 'click .o_button_upload_bill': '_onUpload', 'change .o_vendor_bill_upload .o_form_binary_form': '_onAddAttachment', }), + /** + * We override _onUpload (from the upload bill mixin) to pass default_journal_id + * and default_type in context. + * + * @override + */ + _onUpload: function (event) { + var kanbanRecord = $(event.currentTarget).closest('.o_kanban_record').data('record'); + this.initialState.context['default_journal_id'] = kanbanRecord.id; + if ($(event.currentTarget).attr('journal_type') == 'sale') { + this.initialState.context['default_type'] = 'out_invoice' + } else if ($(event.currentTarget).attr('journal_type') == 'purchase') { + this.initialState.context['default_type'] = 'in_invoice' + } + UploadBillMixin._onUpload.apply(this, arguments); + } }); var DashboardKanbanView = KanbanView.extend({ |
