From ec2ef752b32ed67f927723a224b492da4d314602 Mon Sep 17 00:00:00 2001 From: hujiaying Date: Mon, 9 Sep 2024 18:04:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_stock/__manifest__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sf_stock/__manifest__.py b/sf_stock/__manifest__.py index f22004e5..40f9113b 100644 --- a/sf_stock/__manifest__.py +++ b/sf_stock/__manifest__.py @@ -3,8 +3,7 @@ 'name': "sf_stock", 'summary': """ - Short (1 phrase/line) summary of the module's purpose, used as - subtitle on modules listing or apps.openerp.com""", + 处理代发货业务""", 'description': """ Long description of module's purpose From 1ddb446bc673bffc27684f4da2335cc44ea5b54c Mon Sep 17 00:00:00 2001 From: hujiaying Date: Tue, 10 Sep 2024 11:15:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=8E=92=E7=A8=8B=E5=8D=95=E5=B0=8F=E6=97=B6=E4=BA=A7=E8=83=BD?= =?UTF-8?q?=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workcenter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workcenter.py b/sf_manufacturing/models/mrp_workcenter.py index 0a7e1d0e..b5ec7580 100644 --- a/sf_manufacturing/models/mrp_workcenter.py +++ b/sf_manufacturing/models/mrp_workcenter.py @@ -223,7 +223,7 @@ class ResWorkcenter(models.Model): if plan_ids: sum_qty = sum([p.product_qty for p in plan_ids]) - if sum_qty >= self.single_machine_capacity: + if sum_qty >= self.production_line_hour_capacity: return False return True From 65781570e7db131b0047b3722f9d8826d96d5fc9 Mon Sep 17 00:00:00 2001 From: hujiaying Date: Tue, 10 Sep 2024 14:38:25 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92-?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E5=8F=AA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mrp_workorder/models/mrp_production.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mrp_workorder/models/mrp_production.py b/mrp_workorder/models/mrp_production.py index d40718ed..b59bc990 100644 --- a/mrp_workorder/models/mrp_production.py +++ b/mrp_workorder/models/mrp_production.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import fields, models +from odoo import fields, models, api class MrpProduction(models.Model): @@ -12,7 +12,8 @@ class MrpProduction(models.Model): check_ids = fields.One2many('quality.check', 'production_id', string="Checks") def _split_productions(self, amounts=False, cancel_remaining_qty=False, set_consumed_qty=False): - productions = super()._split_productions(amounts=amounts, cancel_remaining_qty=cancel_remaining_qty, set_consumed_qty=set_consumed_qty) + productions = super()._split_productions(amounts=amounts, cancel_remaining_qty=cancel_remaining_qty, + set_consumed_qty=set_consumed_qty) backorders = productions[1:] if not backorders: return productions @@ -20,3 +21,11 @@ class MrpProduction(models.Model): if wo.current_quality_check_id.component_id: wo.current_quality_check_id._update_component_quantity() return productions + + @api.model + def web_search_read(self, domain=None, fields=None, offset=0, limit=None, order=None, count_limit=None): + picking_type = self.env['stock.picking.type'].search([('name', 'ilike', '制造')]) + if picking_type: + domain.append(('picking_type_id', 'in', picking_type.ids)) + records = super(MrpProduction, self).web_search_read(domain, fields, offset, limit, order, count_limit) + return records From 3ed338ed64485dfacea8fc7493cf6d1f62255204 Mon Sep 17 00:00:00 2001 From: hujiaying Date: Tue, 10 Sep 2024 14:50:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92-?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E5=8F=AA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mrp_workorder/models/mrp_production.py | 7 -- mrp_workorder/views/mrp_production_views.xml | 108 ++++++++++--------- sf_plan/views/view.xml | 1 + 3 files changed, 59 insertions(+), 57 deletions(-) diff --git a/mrp_workorder/models/mrp_production.py b/mrp_workorder/models/mrp_production.py index b59bc990..91510baf 100644 --- a/mrp_workorder/models/mrp_production.py +++ b/mrp_workorder/models/mrp_production.py @@ -22,10 +22,3 @@ class MrpProduction(models.Model): wo.current_quality_check_id._update_component_quantity() return productions - @api.model - def web_search_read(self, domain=None, fields=None, offset=0, limit=None, order=None, count_limit=None): - picking_type = self.env['stock.picking.type'].search([('name', 'ilike', '制造')]) - if picking_type: - domain.append(('picking_type_id', 'in', picking_type.ids)) - records = super(MrpProduction, self).web_search_read(domain, fields, offset, limit, order, count_limit) - return records diff --git a/mrp_workorder/views/mrp_production_views.xml b/mrp_workorder/views/mrp_production_views.xml index a033d501..66f92243 100644 --- a/mrp_workorder/views/mrp_production_views.xml +++ b/mrp_workorder/views/mrp_production_views.xml @@ -1,41 +1,44 @@ - - - mrp.production.tree.inherit.planning - mrp.production - - - - - - - - - - - - - - + + + mrp.production.tree.inherit.planning + mrp.production + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + mrp.production.search.view.inherit.planning @@ -43,7 +46,9 @@ - [('is_planned', '=', True), ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)] + [('is_planned', '=', True), ('date_planned_start', '!=', False), + ('date_planned_finished', '!=', False)] + @@ -51,30 +56,33 @@ Unplan orders - + list code records.button_unplan() - [('bom_id', '!=', False), ('bom_id.operation_ids.workcenter_id', '=', active_id), ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)] + [('bom_id', '!=', False), ('bom_id.operation_ids.workcenter_id', '=', active_id), + ('date_planned_start', '!=', False), ('date_planned_finished', '!=', False)] + + + name="Work Orders" + sequence="2" + parent="mrp.mrp_planning_menu_root" + groups="mrp.group_mrp_routings"/> + name="Planning by Production" + sequence="1" + action="mrp.action_mrp_workorder_production" + parent="mrp_workorder_menu_planning"/> + name="Planning by Workcenter" + sequence="2" + action="mrp_workorder.action_mrp_workorder_dependencies_workcenter" + parent="mrp_workorder_menu_planning"/> diff --git a/sf_plan/views/view.xml b/sf_plan/views/view.xml index d0d3c84e..10992f4a 100644 --- a/sf_plan/views/view.xml +++ b/sf_plan/views/view.xml @@ -291,6 +291,7 @@ ir.actions.act_window mrp.production tree,form + [('picking_type_id.active', '=', True)]