Warehouse and destination location incorrect in purchase order from scheduler

Bug #1094400 reported by Eric Caudal - www.elico-corp.com
This bug report is a duplicate of:  Bug #812678: Compute Schedulers error. Edit Remove
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

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).

Revision history for this message
Ferdinand (office-chricar) wrote :

Hello!
May be this is helpful
http://bazaar.launchpad.net/~c2c/c2c-rd-addons/7.0/files/head:/stock_product_location/

This module defines a default stock location for products and product categories.
This will be used
* as destination location for purchases and production
* as source location for sales and internal moves

my be it needs an extension for mrp and procurement

you may also want to look into

http://bazaar.launchpad.net/~c2c/c2c-rd-addons/7.0/files/head:/stock_get_name_qty/
    usefull to select product, stock location or lot with product qty information
    if quantity available and virtual quantity are different both values are indicated

Revision history for this message
Eric Caudal - www.elico-corp.com (elicoidal) wrote : Re: [Bug 1094400] Re: Warehouse and destination location incorrect in purchase order from scheduler

Hi Ferdinand,
Thanks for the useful references.

My concern is more about having the standard behavior analyzed in OpenERP.

Eric CAUDAL

Eric Caudal
/CEO/
--
*Elico Corporation, Shanghai branch
/OpenERP Premium Certified Training Partner/ *
Cell: + 86 186 2136 1670
Office: + 86 21 6211 8017/27/37
Skype: elico.corp
<email address hidden> <mailto:<email address hidden>>
http://www.elico-corp.com

Elico Corp
On 12/29/2012 06:12 PM, Ferdinand @ Camptocamp wrote:
> Hello!
> May be this is helpful
> http://bazaar.launchpad.net/~c2c/c2c-rd-addons/7.0/files/head:/stock_product_location/
>
> This module defines a default stock location for products and product categories.
> This will be used
> * as destination location for purchases and production
> * as source location for sales and internal moves
>
> my be it needs an extension for mrp and procurement
>
> you may also want to look into
>
> http://bazaar.launchpad.net/~c2c/c2c-rd-addons/7.0/files/head:/stock_get_name_qty/
> usefull to select product, stock location or lot with product qty information
> if quantity available and virtual quantity are different both values are indicated
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.