完成 库存单据列表增加字段【需求数量】 需求

This commit is contained in:
yuxianghui
2025-02-12 11:29:46 +08:00
parent bc4806b303
commit 7a6538bcc1
2 changed files with 14 additions and 0 deletions

View File

@@ -935,6 +935,17 @@ class SfStockPicking(models.Model):
_inherit = 'stock.picking'
check_in = fields.Char(string='查询是否为入库单', compute='_check_is_in')
product_uom_qty_sp = fields.Float('需求数量', compute='_compute_product_uom_qty_sp', store=True)
@api.depends('move_ids_without_package', 'move_ids_without_package.product_uom_qty')
def _compute_product_uom_qty_sp(self):
for sp in self:
if sp.move_ids_without_package:
sp.product_uom_qty_sp = 0
for move_id in sp.move_ids_without_package:
sp.product_uom_qty_sp += move_id.product_uom_qty
else:
sp.product_uom_qty_sp = 0
def batch_stock_move(self):
"""

View File

@@ -156,6 +156,9 @@
<xpath expr="//header" position="inside">
<button name="batch_stock_move" type='object' string="批量调拨"/>
</xpath>
<xpath expr="//field[@name='location_dest_id']" position="after">
<field name="product_uom_qty_sp"/>
</xpath>
</field>
</record>