Accept Merge Request #1884: (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/1884
This commit is contained in:
廖丹龙
2025-02-27 15:11:21 +08:00
committed by Coding
2 changed files with 16 additions and 2 deletions

View File

@@ -1224,7 +1224,7 @@ class ResMrpWorkOrder(models.Model):
if (workorder.production_id.production_type == '人工线下加工' if (workorder.production_id.production_type == '人工线下加工'
and workorder.production_id.schedule_state == '已排' and workorder.production_id.schedule_state == '已排'
and len(workorder.production_id.picking_ids.filtered( and len(workorder.production_id.picking_ids.filtered(
lambda w: w.state in ['done', 'cancel'])) >= 2): lambda w: w.state not in ['done', 'cancel'])) == 0):
# and workorder.production_id.programming_state == '已编程' # and workorder.production_id.programming_state == '已编程'
if workorder.is_subcontract is True: if workorder.is_subcontract is True:
purchase_orders_id = self._get_surface_technics_purchase_ids() purchase_orders_id = self._get_surface_technics_purchase_ids()

View File

@@ -157,7 +157,9 @@
groups="sf_base.group_sf_stock_user"/> groups="sf_base.group_sf_stock_user"/>
</xpath> </xpath>
<xpath expr="//header" position="inside"> <xpath expr="//header" position="inside">
<button name="batch_stock_move" type='object' string="批量调拨" invisible="1"/> <button name="batch_stock_move" type='object' string="批量调拨"
invisible="context.get('stock_type') in ('收料入库')"
/>
</xpath> </xpath>
<xpath expr="//field[@name='location_dest_id']" position="after"> <xpath expr="//field[@name='location_dest_id']" position="after">
<field name="product_uom_qty_sp"/> <field name="product_uom_qty_sp"/>
@@ -165,6 +167,18 @@
</field> </field>
</record> </record>
<record id="view_stock_picking_type_kanban_inherit" model="ir.ui.view">
<field name="name">stock.picking.type.kanban.view.inherit</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.stock_picking_type_kanban"/>
<field name="arch" type="xml">
<!-- 找到按钮所在位置并添加 context -->
<xpath expr="//button[@name='get_action_picking_tree_ready']" position="attributes">
<attribute name="context">{'stock_type': name}</attribute>
</xpath>
</field>
</record>
<record id="sf_view_stock_move_operations" model="ir.ui.view"> <record id="sf_view_stock_move_operations" model="ir.ui.view">
<field name="name">sf.stock.move.operations.form</field> <field name="name">sf.stock.move.operations.form</field>
<field name="model">stock.move</field> <field name="model">stock.move</field>