From dbe8c95558ba306e0782b9034a3e3a0eaf8cbe26 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Mon, 16 Jun 2025 15:43:02 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=89=93=E5=8D=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/sf_production_demand_plan.py | 1 + .../wizard/sf_demand_plan_print_wizard_view.xml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index ef11adcc..de2c1203 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -323,6 +323,7 @@ class SfProductionDemandPlan(models.Model): 'name': _("打印"), 'domain': [('demand_plan_id', 'in', self.ids)], 'views': [[self.env.ref('sf_demand_plan.action_plan_print_tree').id, 'list']], + 'search_view_id': self.env.ref('sf_demand_plan.action_plan_print_search').id, 'target': 'new', } diff --git a/sf_demand_plan/wizard/sf_demand_plan_print_wizard_view.xml b/sf_demand_plan/wizard/sf_demand_plan_print_wizard_view.xml index 311e3ae8..56b3c4fd 100644 --- a/sf_demand_plan/wizard/sf_demand_plan_print_wizard_view.xml +++ b/sf_demand_plan/wizard/sf_demand_plan_print_wizard_view.xml @@ -14,4 +14,21 @@ + + + sf.demand.plan.print.wizard.search + sf.demand.plan.print.wizard + + + + + + + + + + + + + \ No newline at end of file From e29456bbf7a42553d3689e5e0ae2761c30649a41 Mon Sep 17 00:00:00 2001 From: hyyy <123@qq.com> Date: Mon, 16 Jun 2025 17:25:52 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_demand_plan/__manifest__.py | 1 + sf_demand_plan/static/src/js/print_demand.js | 205 ++++++++++++++++++ sf_demand_plan/static/src/scss/style.css | 55 +++++ .../sf_demand_plan_print_wizard_view.xml | 6 +- 4 files changed, 264 insertions(+), 3 deletions(-) create mode 100644 sf_demand_plan/static/src/js/print_demand.js diff --git a/sf_demand_plan/__manifest__.py b/sf_demand_plan/__manifest__.py index 932685e0..2a543f1a 100644 --- a/sf_demand_plan/__manifest__.py +++ b/sf_demand_plan/__manifest__.py @@ -23,6 +23,7 @@ ], 'web.assets_backend': [ 'sf_demand_plan/static/src/scss/style.css', + 'sf_demand_plan/static/src/js/print_demand.js', ] }, 'license': 'LGPL-3', diff --git a/sf_demand_plan/static/src/js/print_demand.js b/sf_demand_plan/static/src/js/print_demand.js new file mode 100644 index 00000000..b1ecd7e7 --- /dev/null +++ b/sf_demand_plan/static/src/js/print_demand.js @@ -0,0 +1,205 @@ +odoo.define('sf_demand.print_demand', function (require) { + "use strict"; + + var ListController = require('web.ListController'); + var ListRenderer = require('web.ListRenderer'); + var ListView = require('web.ListView'); + var viewRegistry = require('web.view_registry'); + var { url } = require("@web/core/utils/urls") + + var CustomListRenderer = ListRenderer.extend({ + _render: function () { + var self = this; + this.getParent()?.$buttons.hide() + return this._super.apply(this, arguments).then(function () { + // 添加图片预览容器到页面左侧 + if (!$('.table-image-preview-container').length) { + self.$el.parent().addClass('custom-table-image-container') + self.$el.before( + `
+ +