[IMP] account: add kanban view for the 'Generated Documents'

This commits adds kanban view for the 'Generated Documents' for better
readability on mobile devices. Also, for consistency, this commit
adds 'Upload' button on the invoice kanban view as well.

Task-ID: 2152183
This commit is contained in:
shreya thakrar
2020-12-29 13:39:37 +00:00
committed by Adrien Dieudonne
parent 04ed2dec6f
commit 3b63b3a4d7
6 changed files with 36 additions and 5 deletions
+1 -1
View File
@@ -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',
+2 -2
View File
@@ -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
@@ -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');
@@ -20,4 +20,12 @@
</button>
</t>
</t>
<t t-extend="KanbanView.buttons" t-name="BillsKanbanView.buttons">
<t t-jquery="button" t-operation="after">
<button type="button" class="btn btn-secondary o_button_upload_bill">
Upload
</button>
</t>
</t>
</templates>
+1 -1
View File
@@ -28,7 +28,7 @@
<script type="text/javascript" src="/account/static/src/js/bank_statement.js"></script>
<script type="text/javascript" src="/account/static/src/js/section_and_note_fields_backend.js"></script>
<script type="text/javascript" src="/account/static/src/js/tours/account.js"></script>
<script type="text/javascript" src="/account/static/src/js/bills_tree_upload.js"/>
<script type="text/javascript" src="/account/static/src/js/bills_upload.js"/>
<script type="text/javascript" src="/account/static/src/js/account_selection.js"/>
</xpath>
</template>
+1 -1
View File
@@ -467,7 +467,7 @@
<field name="name">account.move.kanban</field>
<field name="model">account.move</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<kanban class="o_kanban_mobile" sample="1" js_class="account_bills_kanban">
<field name="journal_id"/>
<field name="partner_id"/>
<field name="ref"/>