stock moves order by date_expected problem

Bug #850781 reported by Paulius Sladkevičius @ hbee
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3

Bug Description

Stock moves are order by "date_expected desc, id". When I create sale order with many lines it sometimes takes more then 2 sec to confirm and together create picking order with stock moves. So in the end I get stock picking with moves where data_expected are different by 1 sec., so in the end we have different picking lines order if we compare with sale order lines.

So I think to assign now() value for date_expected is not correct, same is mentioned in the bug #371262.

Revision history for this message
Paulius Sladkevičius @ hbee (komsas) wrote :

To solve this problem I attach patch for the stock moves date creating in the sale action_ship_create() method.

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Ujjvala Collins (uco-openerp) wrote :

Hello Paulius Sladkevičius,

This problem has been solved in latest trunk addons.

You'll always get the stock moves according to the sequence of sale order lines as per the following line of code
on sale/sale.py : line #670,671
 date_planned = datetime.strptime(order.date_order, '%Y-%m-%d') + relativedelta(days=line.delay or 0.0)
 date_planned = (date_planned - timedelta(days=company.security_lead)).strftime('%Y-%m-%d %H:%M:%S')

I request you to update your code and check.

Hope this helps. And for now we're closing this issue.

Thanks,
Ujjvala

Changed in openobject-addons:
status: In Progress → Fix Released
Changed in openobject-addons:
milestone: none → 6.1
Revision history for this message
Paulius Sladkevičius @ hbee (komsas) wrote :

Thanks Mustufa,

you are right, better idea to take order date then now(). Please link to your branch, because I don't see any changes in the trunk.

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.