← Back to team overview

openerp-india team mailing list archive

[Bug 1094400] [NEW] Warehouse and destination location incorrect in purchase order from scheduler

 

Public bug reported:

1. warehouse selection in make_po
When creating a PO in the scheduler, the method make_po selects a warehouse which is incorrect in a multi-warehouse environment.
Indeed, the following piece of code (in purchase.py, around 1108):
            warehouse_id = warehouse_obj.search(cr, uid, [('company_id', '=', procurement.company_id.id or company.id)], context=context)

and (line 1148)
                'warehouse_id': warehouse_id and warehouse_id[0] or False,

Select the first warehouse in the list, which is incompatible with a
multiwarehouse environment.

Actually the warehouse information should be added in the procurement
and in the minimum stock rules (or alternatively add the input location
in the minimum stock rule).

2. location_id in PO
Most of the time, in the companies, PO are received in the input location defined in the warehouse
Nevertheless (l 1146):
                'location_id': procurement.location_id.id,
generates the PO to the procurement location.
We suggest to change it to the default input location of the warehouse.

3. When the PO is received, the source location of the move associated with procurement is modified with the reception location
This is done line 663
                if order_line.move_dest_id:
                    order_line.move_dest_id.write({'location_id': order.location_id.id})

We suggest that it should be kept as is (whenever needed a pull/push
flow should be created to bring the goods to outgoing location).

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1094400

Title:
  Warehouse and destination location incorrect in purchase order from
  scheduler

Status in OpenERP Addons (modules):
  New

Bug description:
  1. warehouse selection in make_po
  When creating a PO in the scheduler, the method make_po selects a warehouse which is incorrect in a multi-warehouse environment.
  Indeed, the following piece of code (in purchase.py, around 1108):
              warehouse_id = warehouse_obj.search(cr, uid, [('company_id', '=', procurement.company_id.id or company.id)], context=context)

  and (line 1148)
                  'warehouse_id': warehouse_id and warehouse_id[0] or False,

  Select the first warehouse in the list, which is incompatible with a
  multiwarehouse environment.

  Actually the warehouse information should be added in the procurement
  and in the minimum stock rules (or alternatively add the input
  location in the minimum stock rule).

  2. location_id in PO
  Most of the time, in the companies, PO are received in the input location defined in the warehouse
  Nevertheless (l 1146):
                  'location_id': procurement.location_id.id,
  generates the PO to the procurement location.
  We suggest to change it to the default input location of the warehouse.

  3. When the PO is received, the source location of the move associated with procurement is modified with the reception location
  This is done line 663
                  if order_line.move_dest_id:
                      order_line.move_dest_id.write({'location_id': order.location_id.id})

  We suggest that it should be kept as is (whenever needed a pull/push
  flow should be created to bring the goods to outgoing location).

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1094400/+subscriptions


Follow ups

References