[6.0][sale] picking creation from order takes company from logged user instead of order

Bug #626861 reported by Raphaël Valyi - http://www.akretion.com
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Medium
Unassigned

Bug Description

Hello,

on trunk addons,
in sale/sale.py
in the action_ship_create method around line 623,
the company associated to the future picking is taken from the currently logged user through:
company = self.pool.get('res.users').browse(cr, uid, uid).company_id

In general I think this is wrong, ex: you can create the picking using web services remotely using the admin user for instance.

You should rather take the company from the order in the " for order in self.browse(cr, uid, ids, context={}):" loop instead, using
company_id = order.company_id
Indeed, company_id is now mandatory on orders and that one will always be correct no matter who validate the order at the end.

Hope this helps

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Raphael, are you looking at a recent revision?

As far as I can see [revno 4958] the line you refer to is only used to determine the security lead time to consider when scheduling the new picking. Using the sale.order's company would make sense too, I guess.
The picking's company is correctly taken from the order. We could even argue that it should be taken from the source stock location instead (since this is a outgoing shipment), but this will be the same as the order's company due to the way the source location is determined.

Don't hesitate to re-open and/or change the description of this bug if I did not properly understand your bug report.

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

You are right, looks it has been fixed, sorry to miss that.

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.