diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index 1617407b2af..7ed8cc554d6 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -84,7 +84,7 @@ You could use this simplified accounting in case you work with an (external) acc "static/src/xml/account_payment.xml", 'static/src/xml/account_resequence.xml', "static/src/xml/account_report_backend.xml", - "static/src/xml/bills_tree_upload_views.xml", + "static/src/xml/bills_upload_views.xml", 'static/src/xml/account_journal_activity.xml', 'static/src/xml/grouped_view_widget.xml', 'static/src/xml/tax_group.xml', diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 295c63d2b5f..c38d4ab3967 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -670,8 +670,8 @@ class AccountJournal(models.Model): }) else: action_vals.update({ - 'views': [[False, "tree"], [False, "form"]], - 'view_mode': 'tree,form', + 'views': [[False, "tree"], [False, "kanban"], [False, "form"]], + 'view_mode': 'tree, kanban, form', }) return action_vals diff --git a/addons/account/static/src/js/bills_tree_upload.js b/addons/account/static/src/js/bills_upload.js similarity index 84% rename from addons/account/static/src/js/bills_tree_upload.js rename to addons/account/static/src/js/bills_upload.js index 2894b86844a..7b0a3fa3f9f 100644 --- a/addons/account/static/src/js/bills_tree_upload.js +++ b/addons/account/static/src/js/bills_upload.js @@ -86,6 +86,29 @@ odoo.define('account.bills.tree', function (require) { viewRegistry.add('account_tree', BillsListView); }); +odoo.define('account.bills.kanban', function (require) { + var KanbanController = require('web.KanbanController'); + var KanbanView = require('web.KanbanView'); + var UploadBillMixin = require('account.upload.bill.mixin'); + var viewRegistry = require('web.view_registry'); + + var BillsKanbanController = KanbanController.extend(UploadBillMixin, { + buttons_template: 'BillsKanbanView.buttons', + events: _.extend({}, KanbanController.prototype.events, { + 'click .o_button_upload_bill': '_onUpload', + 'change .o_vendor_bill_upload .o_form_binary_form': '_onAddAttachment', + }), + }); + + var BillsKanbanView = KanbanView.extend({ + config: _.extend({}, KanbanView.prototype.config, { + Controller: BillsKanbanController, + }), + }); + + viewRegistry.add('account_bills_kanban', BillsKanbanView); +}); + odoo.define('account.dashboard.kanban', function (require) { "use strict"; var core = require('web.core'); diff --git a/addons/account/static/src/xml/bills_tree_upload_views.xml b/addons/account/static/src/xml/bills_upload_views.xml similarity index 76% rename from addons/account/static/src/xml/bills_tree_upload_views.xml rename to addons/account/static/src/xml/bills_upload_views.xml index 32505e1206c..9decd5ad7fd 100644 --- a/addons/account/static/src/xml/bills_tree_upload_views.xml +++ b/addons/account/static/src/xml/bills_upload_views.xml @@ -20,4 +20,12 @@ + + + + + + diff --git a/addons/account/views/account.xml b/addons/account/views/account.xml index c0aa006db4c..9d6dab2778e 100644 --- a/addons/account/views/account.xml +++ b/addons/account/views/account.xml @@ -28,7 +28,7 @@ -