注释OCC代码

This commit is contained in:
jinling.yang
2024-09-18 10:23:42 +08:00
parent 5a7ba7f87e
commit 92037f3f04
17 changed files with 116 additions and 123 deletions

View File

@@ -89,8 +89,8 @@ class AgvScheduling(models.Model):
workorders: 工单
"""
_logger.info('创建AGV调度任务\r\n起点为【%s】,任务类型为【%s】,工单为【%s' % (agv_start_site_name, agv_route_type, workorders))
if not workorders:
raise UserError(_('工单不能为空'))
# if not workorders:
# raise UserError(_('工单不能为空'))
agv_start_site = self.env['sf.agv.site'].sudo().search([('name', '=', agv_start_site_name)], limit=1)
if not agv_start_site:
raise UserError(_('不存在名称为【%s】的接驳站,请先创建!' % agv_start_site_name))

View File

@@ -804,6 +804,10 @@ class MrpProduction(models.Model):
backorders = backorders - productions_to_backorder
productions_not_to_backorder._post_inventory(cancel_backorder=True)
if self.workorder_ids.filtered(lambda w: w.routing_type in ['表面工艺']):
move_finish = self.env['stock.move'].search([('created_production_id', '=', self.id)])
if move_finish:
move_finish._action_assign()
productions_to_backorder._post_inventory(cancel_backorder=True)
# if completed products make other confirmed/partially_available moves available, assign them

View File

@@ -18,7 +18,7 @@ from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
class ResMrpWorkOrder(models.Model):
_inherit = 'mrp.workorder'
_inherit = ['mrp.workorder', 'sf.message.template']
_order = 'sequence asc'
product_tmpl_name = fields.Char('坯料产品名称', related='production_bom_id.bom_line_ids.product_id.name')

View File

@@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError
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
class ResProductMo(models.Model):

View File

@@ -539,7 +539,7 @@ class ProductionLot(models.Model):
class StockPicking(models.Model):
_inherit = 'stock.picking'
_inherit = ['stock.picking', 'sf.message.template']
surface_technics_parameters_id = fields.Many2one('sf.production.process.parameter', string="表面工艺可选参数")