diff --git a/document_page/models/document_page.py b/document_page/models/document_page.py index e71e062d..a007ea21 100644 --- a/document_page/models/document_page.py +++ b/document_page/models/document_page.py @@ -96,6 +96,9 @@ class DocumentPage(models.Model): compute="_compute_backend_url", ) + image = fields.Binary("Image", attachment=True) + color = fields.Integer(string="Color Index") + @api.depends("menu_id", "parent_id.menu_id") def _compute_backend_url(self): tmpl = "/web#id={}&model=document.page&view_type=form" diff --git a/document_page/static/src/js/document_page_kanban.js b/document_page/static/src/js/document_page_kanban.js new file mode 100644 index 00000000..7c95985c --- /dev/null +++ b/document_page/static/src/js/document_page_kanban.js @@ -0,0 +1,26 @@ +odoo.define("document_page.update_kanban", function (require) { + "use strict"; + + var KanbanRecord = require("web.KanbanRecord"); + + KanbanRecord.include({ + // -------------------------------------------------------------------------- + // Private + // -------------------------------------------------------------------------- + + /** + * @override + * @private + */ + _openRecord: function () { + if ( + this.modelName === "document.page" && + this.$(".o_document_page_kanban_boxes a").length + ) { + this.$(".o_document_page_kanban_boxes a").first().click(); + } else { + this._super.apply(this, arguments); + } + }, + }); +}); diff --git a/document_page/views/document_page.xml b/document_page/views/document_page.xml index ef7271bc..44c24c05 100644 --- a/document_page/views/document_page.xml +++ b/document_page/views/document_page.xml @@ -46,9 +46,12 @@ /> -

- -

+ +
+

+ +

+
+