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):