1、新增库存位置:功能刀具组装位置,2、完善根据功能刀具安全库存自动生成组装单功能。3、功能刀具组装tree视图新增默认筛选未组装状态记录
This commit is contained in:
@@ -14,6 +14,14 @@
|
|||||||
<field name="company_id" ref="base.main_company"/>
|
<field name="company_id" ref="base.main_company"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="stock_location_tool_assembly" model="stock.location">
|
||||||
|
<field name="name">刀具组装位置</field>
|
||||||
|
<field name="usage">internal</field>
|
||||||
|
<field name="barcode">DJZZ</field>
|
||||||
|
<field name="active">true</field>
|
||||||
|
<field name="company_id" ref="base.main_company"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record id="after_assembly_picking_in" model="stock.picking.type">
|
<record id="after_assembly_picking_in" model="stock.picking.type">
|
||||||
<field name="name">刀具组装入库</field>
|
<field name="name">刀具组装入库</field>
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
|||||||
mrs_cutting_tool_type_ids = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
mrs_cutting_tool_type_ids = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
||||||
return categories.browse(mrs_cutting_tool_type_ids)
|
return categories.browse(mrs_cutting_tool_type_ids)
|
||||||
|
|
||||||
@api.depends('sf_functional_cutting_tool_entity_ids')
|
@api.depends('sf_functional_cutting_tool_entity_ids', 'min_stock_num', 'max_stock_num')
|
||||||
def _compute_batch_replenishment_num(self):
|
def _compute_batch_replenishment_num(self):
|
||||||
for tool in self:
|
for tool in self:
|
||||||
if tool:
|
if tool:
|
||||||
@@ -311,15 +311,22 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
|||||||
# 计算当前库存量
|
# 计算当前库存量
|
||||||
tool.tool_stock_total = tool.tool_stock_num + tool.side_shelf_num + tool.on_tool_stock_num
|
tool.tool_stock_total = tool.tool_stock_num + tool.side_shelf_num + tool.on_tool_stock_num
|
||||||
# 如果当前库存量小于最低库存量,计算批次补货量
|
# 如果当前库存量小于最低库存量,计算批次补货量
|
||||||
if tool.tool_stock_total < tool.min_stock_num:
|
tool.open_batch_replenishment_num(tool)
|
||||||
tool.batch_replenishment_num = tool.max_stock_num - tool.tool_stock_total
|
|
||||||
# 根据判断创建功能刀具组装单
|
def open_batch_replenishment_num(self, tool):
|
||||||
if not tool.sf_functional_tool_assembly_ids:
|
"""
|
||||||
for i in range(tool.batch_replenishment_num):
|
计算批次补货量
|
||||||
tool.create_functional_tool_assembly()
|
"""
|
||||||
print(i, ": ", tool.sf_functional_tool_assembly_ids)
|
if tool.tool_stock_total < tool.min_stock_num:
|
||||||
else:
|
tool.batch_replenishment_num = tool.max_stock_num - tool.tool_stock_total
|
||||||
tool.batch_replenishment_num = 0
|
# 根据判断创建功能刀具组装单
|
||||||
|
if not tool.sf_functional_tool_assembly_ids:
|
||||||
|
for i in range(tool.batch_replenishment_num):
|
||||||
|
tool.create_functional_tool_assembly()
|
||||||
|
print(i, ": ", tool.sf_functional_tool_assembly_ids)
|
||||||
|
else:
|
||||||
|
tool.batch_replenishment_num = 0
|
||||||
|
|
||||||
|
|
||||||
def create_functional_tool_assembly(self):
|
def create_functional_tool_assembly(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1158,11 +1158,11 @@
|
|||||||
<field name="applicant"/>
|
<field name="applicant"/>
|
||||||
<field name="apply_time"/>
|
<field name="apply_time"/>
|
||||||
<field name="functional_tool_type_id"/>
|
<field name="functional_tool_type_id"/>
|
||||||
<filter name="assemble_status" string="未组装" domain="[('assemble_status', '=', '0')]"/>
|
<filter name="no_assemble_status" string="未组装" domain="[('assemble_status', '=', '0')]"/>
|
||||||
<filter name="assemble_status" string="已组装" domain="[('assemble_status', '=', '1')]"/>
|
<filter name="yes_assemble_status" string="已组装" domain="[('assemble_status', '=', '1')]"/>
|
||||||
<searchpanel>
|
<searchpanel>
|
||||||
<field name="functional_tool_type_id" enable_counters="1" icon="fa-filter"/>
|
<field name="functional_tool_type_id" enable_counters="1" icon="fa-filter"/>
|
||||||
<field name="assemble_status" enable_counters="1" icon="fa-filter"/>
|
<!-- <field name="assemble_status" enable_counters="1" icon="fa-filter"/>-->
|
||||||
</searchpanel>
|
</searchpanel>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
@@ -1173,6 +1173,9 @@
|
|||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">sf.functional.tool.assembly</field>
|
<field name="res_model">sf.functional.tool.assembly</field>
|
||||||
<field name="view_mode">tree,form,search</field>
|
<field name="view_mode">tree,form,search</field>
|
||||||
|
<!-- <field name="view_id" ref="sf_functional_tool_assembly_tree"/>-->
|
||||||
|
<field name="search_view_id" ref="sf_functional_tool_assembly_search"/>
|
||||||
|
<field name="context">{'search_default_no_assemble_status':1}</field>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user