我想知道是否有解决方案只发送交付数量(交付数量 - 返回数量)在odoo 或者我必须编码吗?
答案 0 :(得分:1)
据我所知,没有任何选项可以发送交付数量。 您必须为该选项编码。
答案 1 :(得分:1)
继承模块 stock_account
中stock_move的 _get_invoice_line_valsdef _get_invoice_line_vals(
...
#search for (deliverd - returnedQty)
qty = 0
quant_obj = self.pool.get("stock.quant")
uom_obj = self.pool.get('product.uom')
quant_search = quant_obj.search(cr, uid, [('history_ids', 'in', move.id), ('qty', '>', 0.0), ('location_id', 'child_of', move.location_dest_id.id)], context=context)
for quant in quant_obj.browse(cr, uid, quant_search, context=context):
if not quant.reservation_id or quant.reservation_id.origin_returned_move_id.id != move.id:
qty += quant.qty
qty = uom_obj._compute_qty(cr, uid, move.product_id.uom_id.id, qty, move.product_uom.id)
quantity = qty
# quantity = move.product_uom_qty
# set UoS if it's a sale and the picking doesn't have one
uos_id = move.product_uom.id
# if move.product_uos:
# uos_id = move.product_uos.id
# quantity = move.product_uos_qty
#
...