报价和销售订单页面优化
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
import logging
|
||||
import base64
|
||||
import hashlib
|
||||
@@ -734,7 +734,7 @@ class ResProductMo(models.Model):
|
||||
def transition_glb_file(self, report_path, code):
|
||||
shapes = read_step_file(report_path)
|
||||
output_file = os.path.join('/tmp', str(code) + '.stl')
|
||||
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
# write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
# 转化为glb
|
||||
output_glb_file = os.path.join('/tmp', str(code) + '.glb')
|
||||
util_path = get_resource_path('sf_dlm', 'static/util')
|
||||
@@ -797,6 +797,7 @@ class ResMrpBomMo(models.Model):
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
# 查询材料型号默认排第一的供应商
|
||||
|
||||
def get_supplier(self, materials_type):
|
||||
|
||||
@@ -189,27 +189,27 @@ class StockRule(models.Model):
|
||||
'mail.message_origin_link',
|
||||
values={'self': production, 'origin': origin_production},
|
||||
subtype_id=self.env.ref('mail.mt_note').id)
|
||||
'''
|
||||
创建生产计划
|
||||
'''
|
||||
# 工单耗时
|
||||
workorder_duration = 0
|
||||
for workorder in production.workorder_ids:
|
||||
workorder_duration += workorder.duration_expected
|
||||
|
||||
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
||||
if sale_order:
|
||||
bb = sale_order.deadline_of_delivery
|
||||
productions = self.env['sf.production.plan'].with_user(SUPERUSER_ID).sudo().with_company(company_id). \
|
||||
create({
|
||||
'name': production.name,
|
||||
'production_id': production.id,
|
||||
'date_planned_start': production.date_planned_start,
|
||||
'origin': production.origin,
|
||||
'product_qty': production.product_qty,
|
||||
'product_id': production.product_id.id,
|
||||
'state': 'draft',
|
||||
})
|
||||
# '''
|
||||
# 创建生产计划
|
||||
# '''
|
||||
# # 工单耗时
|
||||
# workorder_duration = 0
|
||||
# for workorder in production.workorder_ids:
|
||||
# workorder_duration += workorder.duration_expected
|
||||
#
|
||||
# sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
||||
# if sale_order:
|
||||
# bb = sale_order.deadline_of_delivery
|
||||
# productions = self.env['sf.production.plan'].with_user(SUPERUSER_ID).sudo().with_company(company_id). \
|
||||
# create({
|
||||
# 'name': production.name,
|
||||
# 'production_id': production.id,
|
||||
# 'date_planned_start': production.date_planned_start,
|
||||
# 'origin': production.origin,
|
||||
# 'product_qty': production.product_qty,
|
||||
# 'product_id': production.product_id.id,
|
||||
# 'state': 'draft',
|
||||
# })
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user