Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/产品验证

# Conflicts:
#	sf_manufacturing/models/stock.py
#	sf_wxwork_approval/models/model.py
This commit is contained in:
jinling.yang
2023-11-20 15:11:43 +08:00
24 changed files with 142 additions and 287 deletions

View File

@@ -165,7 +165,7 @@ class ResMrpWorkOrder(models.Model):
y0 = ((y3 - y4) * (y2 * x1 - y1 * x2) - (y1 - y2) * (y4 * x3 - y3 * x4)) / (
(y3 - y4) * (x1 - x2) - (y1 - y2) * (x3 - x4))
x1 = ((x7 - x8) * (x6 * y5 - x5 * y6) - (x5 - x6) * (x8 * y7 - x7 * y8)) / (
(x7 - x8) * (y5 - y6) - (x5 - x6) * (y7 - y8));
(x7 - x8) * (y5 - y6) - (x5 - x6) * (y7 - y8))
y1 = ((y7 - y8) * (y6 * x5 - y5 * x6) - (y5 - y6) * (y8 * x7 - y7 * x8)) / (
(y7 - y8) * (x5 - x6) - (y5 - y6) * (x7 - x8))
x = (x0 + x1) / 2
@@ -189,19 +189,26 @@ class ResMrpWorkOrder(models.Model):
def json_workorder_str(self, k, production, route):
# 计算预计时长duration_expected
if route.routing_type == '切割':
duration_expected = self.env['mrp.routing.workcenter'].sudo().search([('name', '=', '切割')]).time_cycle
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
[('name', '=', '切割')]).time_cycle
elif route.routing_type == '获取CNC加工程序':
duration_expected = self.env['mrp.routing.workcenter'].sudo().search([('name', '=', '获取CNC加工程序')]).time_cycle
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
[('name', '=', '获取CNC加工程序')]).time_cycle
elif route.routing_type == '工件装夹':
duration_expected = self.env['mrp.routing.workcenter'].sudo().search([('name', '=', '工件装夹')]).time_cycle
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
[('name', '=', '工件装夹')]).time_cycle
elif route.routing_type == '前置三元定位检测':
duration_expected = self.env['mrp.routing.workcenter'].sudo().search([('name', '=', '前置三元定位检测')]).time_cycle
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
[('name', '=', '前置三元定位检测')]).time_cycle
elif route.routing_type == 'CNC加工':
duration_expected = self.env['mrp.routing.workcenter'].sudo().search([('name', '=', 'CNC加工')]).time_cycle
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
[('name', '=', 'CNC加工')]).time_cycle
elif route.routing_type == '后置三元质量检测':
duration_expected = self.env['mrp.routing.workcenter'].sudo().search([('name', '=', '后置三元质量检测')]).time_cycle
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
[('name', '=', '后置三元质量检测')]).time_cycle
elif route.routing_type == '解除装夹':
duration_expected = self.env['mrp.routing.workcenter'].sudo().search([('name', '=', '解除装夹')]).time_cycle
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
[('name', '=', '解除装夹')]).time_cycle
else:
duration_expected = 60
workorders_values_str = [0, '', {

View File

@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
from datetime import datetime
import requests
import logging
import base64
from collections import defaultdict, namedtuple
import logging
from re import findall as regex_findall
from datetime import datetime
from re import split as regex_split
from odoo.addons.stock.models.stock_rule import ProcurementException
from odoo.addons.sf_base.commons.common import Common
import requests
from odoo import SUPERUSER_ID, _, api, fields, models
from odoo.tools import float_compare
from collections import defaultdict, namedtuple
from odoo.addons.stock.models.stock_rule import ProcurementException
from odoo.addons.sf_base.commons.common import Common
from odoo.exceptions import UserError