1、组装单添加按是否组装排序;2、修改功能刀具组装流程中搜索功能刀具产品的条件

This commit is contained in:
yuxianghui
2024-05-18 17:05:39 +08:00
parent d1c08023b9
commit f05301320c
3 changed files with 6 additions and 5 deletions

View File

@@ -351,7 +351,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
class FunctionalToolAssembly(models.Model): class FunctionalToolAssembly(models.Model):
_name = 'sf.functional.tool.assembly' _name = 'sf.functional.tool.assembly'
_description = '功能刀具组装' _description = '功能刀具组装'
_order = 'use_tool_time asc' _order = 'assemble_status, use_tool_time asc'
@api.depends('functional_tool_name') @api.depends('functional_tool_name')
def _compute_name(self): def _compute_name(self):

View File

@@ -47,7 +47,7 @@
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">
<button name="button_safe_inventory_id" string="更新功能刀具关联的安全库存记录" <button name="button_safe_inventory_id" string="更新功能刀具关联的安全库存记录"
type="object" class="btn-primary"/> type="object" class="btn-primary"/>
<button class="oe_stat_button" groups="sf_base.group_sf_mrp_user" <button class="oe_stat_button" groups="sf_base.group_sf_mrp_user"
name="open_functional_tool_warning" name="open_functional_tool_warning"
icon="fa-list-ul" icon="fa-list-ul"
@@ -406,7 +406,7 @@
</field> </field>
</page> </page>
<page string="组装单"> <page string="组装单">
<field name="sf_functional_tool_assembly_ids" domain="[('assemble_status', '=', 0)]"/> <field name="sf_functional_tool_assembly_ids"/>
</page> </page>
</notebook> </notebook>
</sheet> </sheet>

View File

@@ -802,12 +802,13 @@ class ProductProduct(models.Model):
""" """
创建功能刀具批次/序列号记录 创建功能刀具批次/序列号记录
""" """
product_id = self.env['product.product'].search([('name', '=', '功能刀具')]) product_id = self.env['product.product'].search([('categ_type', '=', '功能刀具'), ('tracking', '=', 'serial')])
if not product_id: if not product_id:
logging.info('没有搜索到功能刀具产品:%s' % product_id) logging.info('没有搜索到功能刀具产品:%s' % product_id)
raise ValidationError('没有找到按唯一序列号追溯的功能刀具产品信息!')
stock_lot = self.env['stock.lot'].create({ stock_lot = self.env['stock.lot'].create({
'name': self.get_stock_lot_name(tool_assembly_order_id), 'name': self.get_stock_lot_name(tool_assembly_order_id),
'product_id': product_id.id, 'product_id': product_id[0].id,
'company_id': self.env.company.id 'company_id': self.env.company.id
}) })
# 获取位置对象 # 获取位置对象