[6.1][7.0][trunk] Delivery order should take the confirmation date of the sale order

Bug #1260778 reported by Yann Papouin
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned
OpenERP Community Backports (Addons)
Status tracked in 7.0
6.1
Fix Released
Low
Yann Papouin
7.0
Fix Released
Low
Yann Papouin

Bug Description

Actually it's using the date_order from the order.
If you create your quotation one week ago and then valid your order, all dates (stock moves and picking) will be planned from the date_order that is not updated on confirmation.
It should take the confirmation date of the sale order.

Related branches

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Yann, this would be very interesting to be also in OCB branch until it arrives on official branch. Could you please make an MP with the patch and link to this bug?

Regards.

Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

I already fixed this for one of our customers.

I really think the present computation is a bug, so a bugfixing branch might be appropiate.

But then some people might rely on the present logic or illogic, so I could post a module to modify the default behaviour.

What do people think?

And what would be the best project to post a new module?

Anyway, below my code, stripped from things not needed to fix this bug:

# -*- coding: utf-8 -*-
'''Modify 'sale.order' model'''
from openerp.osv import orm

class SaleOrder(orm.Model):
    '''\
Change computation of delivery and planned date to start from order
  confirmation, not from creation of quote.
'''
    _inherit = 'sale.order'

    def _get_date_planned(
            self, cr, uid, order, line, start_date, context=None):
        '''\
Intercept standard function call _get_date_planned, that receives date_order,
to replace it by date_confirm.
It would be more correct to change the function call itself, but that is
embedded in a huge method, that I do not want to override.
Should only be called when order has been confirmed!
'''
        return super(SaleOrder, self)._get_date_planned(
                cr, uid, order, line, order.date_confirm, context=context)

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Would you please be kind enough to check whether this proposal also fixes the issue?
It's an improvement of sale_order_dates.
https://code.launchpad.net/~numerigraphe/openobject-addons/trunk-sale-order-dates/+merge/175249

Revision history for this message
Yann Papouin (yann-papouin) wrote :

@Lionel: Comment added to your proposal

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :
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.