坯料新增路线
This commit is contained in:
@@ -9,8 +9,8 @@ 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
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
@@ -660,8 +660,12 @@ class ResProductMo(models.Model):
|
||||
return attachment
|
||||
|
||||
# 创建坯料
|
||||
def no_bom_product_create(self, product_id, item, order_id, route_type, i):
|
||||
def no_bom_product_create(self, product_id, item, order_id, route_type, i, finish_product):
|
||||
no_bom_copy_product_id = product_id.with_user(self.env.ref("base.user_admin")).copy()
|
||||
if finish_product.model_process_parameters_ids:
|
||||
surface_technology = self.env['stock.rule'].sudo().search([('name', '=', '表面工艺外协')])
|
||||
if surface_technology:
|
||||
no_bom_copy_product_id.route_ids |= surface_technology
|
||||
no_bom_copy_product_id.product_tmpl_id.active = True
|
||||
materials_id = self.env['sf.production.materials'].search(
|
||||
[('materials_no', '=', item['texture_code'])])
|
||||
|
||||
Reference in New Issue
Block a user