Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化模型上色路径
This commit is contained in:
@@ -37,7 +37,7 @@ class ResMrpBomMo(models.Model):
|
|||||||
'product_qty': 1,
|
'product_qty': 1,
|
||||||
'product_uom_id': 1
|
'product_uom_id': 1
|
||||||
}
|
}
|
||||||
return self.env['mrp.bom.line'].create(vals)
|
return self.env['mrp.bom.line'].sudo().create(vals)
|
||||||
|
|
||||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom
|
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom
|
||||||
def bom_create(self, product, bom_type, product_type):
|
def bom_create(self, product, bom_type, product_type):
|
||||||
@@ -64,7 +64,7 @@ class ResMrpBomMo(models.Model):
|
|||||||
qty = 1
|
qty = 1
|
||||||
if round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000) > 1:
|
if round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000) > 1:
|
||||||
qty = round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000)
|
qty = round(embryo.volume * raw_bom_line.materials_type_id.density / 1000000)
|
||||||
bom_line = self.env['mrp.bom.line'].create({
|
bom_line = self.env['mrp.bom.line'].sudo().create({
|
||||||
'bom_id': self.id,
|
'bom_id': self.id,
|
||||||
'product_id': raw_bom_line.id,
|
'product_id': raw_bom_line.id,
|
||||||
'product_tmpl_id': raw_bom_line.product_tmpl_id.id,
|
'product_tmpl_id': raw_bom_line.product_tmpl_id.id,
|
||||||
|
|||||||
@@ -536,8 +536,8 @@ class MrpProduction(models.Model):
|
|||||||
# work.button_finish()
|
# work.button_finish()
|
||||||
|
|
||||||
# 创建工单并进行排序
|
# 创建工单并进行排序
|
||||||
def _create_workorder(self, programming_no_new):
|
def _create_workorder(self):
|
||||||
self._create_workorder3(programming_no_new)
|
self._create_workorder3()
|
||||||
self._reset_work_order_sequence()
|
self._reset_work_order_sequence()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -736,14 +736,17 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
if self.routing_type == '装夹预调' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name:
|
if self.routing_type == '装夹预调' and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name:
|
||||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||||
if self.routing_type == '装夹预调':
|
if self.routing_type == '装夹预调':
|
||||||
if not self.cnc_ids:
|
cnc_workorder = self.search(
|
||||||
|
[('production_id', '=', self.production_id.id), ('routing_type', '=', 'CNC加工')],
|
||||||
|
limit=1, order='id asc')
|
||||||
|
if not cnc_workorder:
|
||||||
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
|
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
|
||||||
else:
|
else:
|
||||||
for item in self.cnc_ids:
|
for item in cnc_workorder.cnc_ids:
|
||||||
functional_cutting_tool = self.env['sf.functional.cutting.tool.entity'].search(
|
functional_cutting_tool = self.env['sf.functional.cutting.tool.entity'].search(
|
||||||
[('tool_name_id.name', '=', item.cutting_tool_name)])
|
[('tool_name_id.name', '=', item.cutting_tool_name)])
|
||||||
if not functional_cutting_tool:
|
if not functional_cutting_tool:
|
||||||
raise UserError(_('该制造订单的CNC程序为%s没有对应的功能刀具%s' % item.cutting_tool_name))
|
raise UserError(_('该制造订单的CNC程序为%s没有对应的功能刀具' % item.cutting_tool_name))
|
||||||
if self.routing_type == '解除装夹':
|
if self.routing_type == '解除装夹':
|
||||||
'''
|
'''
|
||||||
记录开始时间
|
记录开始时间
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import os
|
|||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from datetime import datetime
|
|||||||
import requests
|
import requests
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo.exceptions import ValidationError, UserError
|
from odoo.exceptions import ValidationError, UserError
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from stl import mesh
|
from stl import mesh
|
||||||
# from OCC.Core.GProp import GProp_GProps
|
# from OCC.Core.GProp import GProp_GProps
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ class ReSaleOrder(models.Model):
|
|||||||
self.check_status = 'pending'
|
self.check_status = 'pending'
|
||||||
|
|
||||||
def get_customer(self):
|
def get_customer(self):
|
||||||
partner_tag = self.env['res.partner.category'].search([('name', '=', '业务平台')], limit=1, order='id asc')
|
partner_tag = self.env['res.partner.category'].sudo().search([('name', '=', '业务平台')], limit=1, order='id asc')
|
||||||
if not partner_tag:
|
if not partner_tag:
|
||||||
partner_tag = self.env['res.partner.category'].create({'name': '平台客户'})
|
partner_tag = self.env['res.partner.category'].sudo().create({'name': '平台客户'})
|
||||||
customer = self.env['res.partner'].search([('name', '=', '业务平台')], limit=1, order='id asc')
|
customer = self.env['res.partner'].search([('name', '=', '业务平台')], limit=1, order='id asc')
|
||||||
if customer:
|
if customer:
|
||||||
if not customer.vat:
|
if not customer.vat:
|
||||||
|
|||||||
Reference in New Issue
Block a user