From 181f490d4709b46e9d660897218e352c6374d727 Mon Sep 17 00:00:00 2001 From: hujiaying Date: Wed, 11 Sep 2024 11:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A1=E5=88=92=E6=8E=92?= =?UTF-8?q?=E7=A8=8B=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4=E5=86=85=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=8F=96=E5=80=BC=E5=90=91=E4=B8=8A=E5=8F=96=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workcenter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workcenter.py b/sf_manufacturing/models/mrp_workcenter.py index b5ec7580..4a9af4c7 100644 --- a/sf_manufacturing/models/mrp_workcenter.py +++ b/sf_manufacturing/models/mrp_workcenter.py @@ -4,6 +4,7 @@ from collections import defaultdict from odoo import fields, models, api from odoo.addons.resource.models.resource import Intervals from odoo.exceptions import UserError, ValidationError +import math class ResWorkcenter(models.Model): @@ -195,7 +196,9 @@ class ResWorkcenter(models.Model): def get_integer_and_decimal_parts(self, value): integer_part = int(value) decimal_part = value - integer_part - return int(integer_part), int(decimal_part) + if decimal_part > 0: + decimal_part = round(decimal_part, 2) * 60 + return int(integer_part), math.ceil(decimal_part) # 处理排程是否超过日产能 def deal_available_default_capacity(self, date_planned):