完成 库存单据列表增加字段【需求数量】 需求
This commit is contained in:
@@ -935,6 +935,17 @@ class SfStockPicking(models.Model):
|
|||||||
_inherit = 'stock.picking'
|
_inherit = 'stock.picking'
|
||||||
|
|
||||||
check_in = fields.Char(string='查询是否为入库单', compute='_check_is_in')
|
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):
|
def batch_stock_move(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -156,6 +156,9 @@
|
|||||||
<xpath expr="//header" position="inside">
|
<xpath expr="//header" position="inside">
|
||||||
<button name="batch_stock_move" type='object' string="批量调拨"/>
|
<button name="batch_stock_move" type='object' string="批量调拨"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='location_dest_id']" position="after">
|
||||||
|
<field name="product_uom_qty_sp"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user