【问题标题】:Is there a solution to invoice delivered qty ?发票交付数量是否有解决方案?
【发布时间】:2015-06-26 11:08:34
【问题描述】:

我想知道是否有解决方案可以在 odoo 中仅对已交付数量(已交付数量 - 退回数量)开具发票 还是我必须编码?

【问题讨论】:

    标签: openerp odoo invoice stock


    【解决方案1】:

    据我所知,没有任何选项可以为交付数量开具发票。 您必须为该选项编码。

    【讨论】:

      【解决方案2】:

      继承 stock_account 模块中 stock_move 的 _get_invoice_line_vals

      def _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
      #             
          ...
      

      【讨论】:

        猜你喜欢
        • 2010-09-21
        • 2010-10-06
        • 1970-01-01
        • 2011-12-24
        • 2012-03-07
        • 2011-09-11
        • 2011-10-13
        • 1970-01-01
        • 2017-07-16
        相关资源
        最近更新 更多