This question has been flagged
1 Reply
3735 Views

Is there any way to generate a stock reorder report showing those items that fallen below the min reorder rule.

I do not want odoo to generate draft purchase orders (RFQ) which is the case when I run the scheduler I just want a report.



Avatar
Discard
Best Answer

Hi,

since this question has been not answered for a long, I would offer some hints how to achieve the desired bahavior. Caution: customization is required!

The procurement based on minimum stock rules is generated in the method _procure_orderpoint_confirm (stock/procurement.py). The exact place where it is done is:

if qty_rounded > 0:

proc_id = procurement_obj.create(cr, uid, self._prepare_orderpoint_procurement(cr, uid, op, qty_rounded, context=context), context=context)
    self.check(cr, uid, [proc_id])
    self.run(cr, uid, [proc_id])

Thus, here instead of create, you should generate the report and, for example, send it for email. Logically, it would be something like:

report_line_ids = [] #before while orderpoint_ids
if qty_rounded > 0:
    report_line =  self._prepare_orderpoint_procurement(cr, uid, op, qty_rounded, context=context)
    report_line_ids.append(report_line)    
# Before return generare Report based  report_line_ids: here you would find all required data including product_id, quantity. Have a look at return of the method _prepare_orderpoint_procurement
# Send email


Regretfully, it is hardly possible to just inherit the method and use super. You would have to re-write the method totally, since otherwise it would create procurements > purchase orders.

Hope, that makes sense


Avatar
Discard