Accept Merge Request #2024: (feature/tool_standard_library_process -> develop)

Merge Request: 制造订单报错问题

Created By: @廖丹龙
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @廖丹龙
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2024
This commit is contained in:
廖丹龙
2025-04-21 13:18:49 +08:00
committed by Coding
3 changed files with 11 additions and 5 deletions

View File

@@ -13,10 +13,10 @@ class SfProductionProcessParameter(models.Model):
def create(self, vals):
# if vals.get('code', '/') == '/' or vals.get('code', '/') is False:
# vals['code'] = '101'+self.routing_id.code +self.env['ir.sequence'].next_by_code('sf.production.process.parameter')
if not vals.get('process_id') and vals.get('routing_id'):
vals['gain_way'] = '外协'
if vals.get('routing_id'):
# vals['gain_way'] = '外协'
routing_id = self.env['mrp.routing.workcenter'].browse(vals.get('routing_id'))
if routing_id.surface_technics_id:
if routing_id.surface_technics_id and not vals.get('process_id'):
vals['process_id'] = routing_id.surface_technics_id.id
if vals.get('code', '/') == '/' or vals.get('code', '/') is False:
vals['code'] = '101' + routing_id.code + self.env['ir.sequence'].next_by_code(

View File

@@ -383,7 +383,7 @@
<field name="process_parameters_id"
attrs="{'readonly': [('id', '!=', False),('routing_tag', '=', 'standard')]}"
string="参数" context="{'route_id':route_id,'production_id': production_id}"
options="{'no_create': True}"/>
options="{'no_create': True}" domain="[('routing_id', '=', 'route_id')]"/>
<field name="panel" readonly="1"/>
<field name="routing_tag" readonly="1" widget="badge"
decoration-success="routing_tag == 'standard'"
@@ -459,7 +459,11 @@
<attribute name="decoration-warning">delivery_warning == 'warning'</attribute>
<attribute name="decoration-danger">delivery_warning == 'overdue'</attribute>
</xpath>
<!-- <xpath expr="//field[@name='create_date']" position="before">-->
<!-- -->
<!-- </xpath>-->
<xpath expr="//field[@name='state']" position="replace">
<field name="create_date" invisible="True"/>
<field name="delivery_warning" invisible="True"/>
<field name="state" widget="badge" decoration-warning="state == 'progress'"
decoration-success="state == 'done'" decoration-danger="state in ('cancel','rework')"

View File

@@ -1148,10 +1148,12 @@ class sfProductionProcessParameter(models.Model):
"process_id": process.id,
'materials_model_ids': self.env['sf.materials.model'].search(
[('materials_no', 'in', item['materials_model_ids_codes'])]),
'processing_mm': item['processing_mm']
'processing_mm': item['processing_mm'],
'gain_way':'外协',
})
production_process_parameter.create_service_product()
else:
production_process_parameter.gain_way = '外协'
production_process_parameter.name = item['name']
production_process_parameter.process_description = item['process_description']
production_process_parameter.processing_day = item['processing_day']