This commit is contained in:
gqh
2023-01-23 20:21:00 +08:00
parent 270b8d3cc1
commit 9c473e6f32
200 changed files with 5957 additions and 114 deletions

View File

@@ -82,7 +82,7 @@ class ResProductTemplate(models.Model):
item['model_height'] + model_type.embryo_tolerance),
'model_type_id': model_type.id,
'model_processing_panel': 'R',
'model_machining_precision': item['model_machining_precision'],
'model_machining_precision': item['model_machining_precision'],
'model_code': item['barcode'],
'length': item['model_long'],
'width': item['model_width'],
@@ -92,7 +92,7 @@ class ResProductTemplate(models.Model):
'model_name': attachment.name,
'upload_model_file': [(6, 0, [attachment.id])],
# 'single_manufacturing': True,
# 'tracking': 'serial',
'tracking': 'serial',
'list_price': item['price'],
# 'categ_id': self.env.ref('sf_dlm.product_category_finished_sf').id,
'materials_id': self.env['sf.production.materials'].search(
@@ -158,13 +158,14 @@ class ResProductTemplate(models.Model):
'active': True
}
# 外协和采购生成的胚料需要根据材料型号绑定供应商
if route_type == 'subcontract' or route_type == 'purchase':
if route_type == 'subcontract':
no_bom_copy_product_id.purchase_ok = True
no_bom_copy_product_id.seller_ids = [
(0, 0, {'partner_id': supplier.partner_id.id, 'delay': 1.0, 'is_subcontractor': True})]
elif route_type == 'purchase':
no_bom_copy_product_id.purchase_ok = True
no_bom_copy_product_id.seller_ids = [
(0, 0, {'partner_id': supplier.partner_id.id, 'delay': 1.0})]
if route_type == 'subcontract':
partner = self.env['res.partner'].search([('id', '=', supplier.partner_id.id)])
partner.is_subcontractor = True
no_bom_copy_product_id.write(vals)
logging.info('no_bom_copy_product_id-vals:%s' % vals)
# product_id.product_tmpl_id.active = False
@@ -248,6 +249,7 @@ class ResMrpBom(models.Model):
[('materials_model_id', '=', materials_type.id)],
limit=1,
order='sequence asc')
logging.info('get_supplier-vals:%s' % seller_id)
return seller_id
# 匹配bom