diff --git a/mrp_attachment_mgmt/__manifest__.py b/mrp_attachment_mgmt/__manifest__.py index 501b50936..f78fcc35f 100644 --- a/mrp_attachment_mgmt/__manifest__.py +++ b/mrp_attachment_mgmt/__manifest__.py @@ -10,7 +10,6 @@ "depends": ["mrp"], "installable": True, "data": [ - "template/assets.xml", "views/mrp_bom_view.xml", "views/product_views.xml", "views/workorder_attachments_views.xml", diff --git a/mrp_attachment_mgmt/models/mrp_bom.py b/mrp_attachment_mgmt/models/mrp_bom.py index c8152352b..d4c2ccebc 100644 --- a/mrp_attachment_mgmt/models/mrp_bom.py +++ b/mrp_attachment_mgmt/models/mrp_bom.py @@ -8,16 +8,17 @@ class MrpBom(models.Model): def _action_see_bom_documents_products(self, products): domain = [ + # ("res_field", "=", False), "|", "&", - ("ir_attachment_id.res_model", "=", "product.product"), - ("ir_attachment_id.res_id", "in", products.ids), + ("res_model", "=", "product.product"), + ("res_id", "in", products.ids), "&", - ("ir_attachment_id.res_model", "=", "product.template"), - ("ir_attachment_id.res_id", "in", products.mapped("product_tmpl_id").ids), + ("res_model", "=", "product.template"), + ("res_id", "in", products.mapped("product_tmpl_id").ids), ] - res = self.env["mrp.bom.line"].action_see_attachments() - ctx = {"hide_upload": True, "edit": False, "delete": False} + res = self.env.ref("base.action_attachment").read()[0] + ctx = {"create": False, "edit": False} res.update({"domain": domain, "context": ctx}) return res diff --git a/mrp_attachment_mgmt/static/src/js/mrp_documents_controller_mixin.js b/mrp_attachment_mgmt/static/src/js/mrp_documents_controller_mixin.js deleted file mode 100644 index 22dad63c5..000000000 --- a/mrp_attachment_mgmt/static/src/js/mrp_documents_controller_mixin.js +++ /dev/null @@ -1,12 +0,0 @@ -odoo.define("mrp_attachment_mgmt.controllerMixin", function (require) { - "use strict"; - var MrpDocumentsKanbanController = require("mrp.MrpDocumentsKanbanController"); - MrpDocumentsKanbanController.include({ - renderButtons: function () { - const context = this.model.get(this.handle).getContext(); - if (!context.hide_upload) { - this._super(...arguments); - } - }, - }); -}); diff --git a/mrp_attachment_mgmt/template/assets.xml b/mrp_attachment_mgmt/template/assets.xml deleted file mode 100644 index 21d8c15ed..000000000 --- a/mrp_attachment_mgmt/template/assets.xml +++ /dev/null @@ -1,15 +0,0 @@ - - -