~manu-tiedra/openobject-addons/trunk

Viewing all changes in revision 5290.

  • Committer: Manu
  • Date: 2011-10-03 14:20:47 UTC
  • Revision ID: manu@tiedra.net-20111003142047-u4p60m8dkdn4ogtl
We can not work with the current delivery module as is because we need to track the delivery.carrier assigned to each picking in order to create a text file that integrates with the logistic platform of the carrier.
The standard delivery module has a field called carrier_id, displayed as Delivery Method that is used to track the carrier used but also has a second meaning: when the field is set, it means that the system should compute the shipping costs of the picking when creating the invoice for the picking.

Unfortunately there are companies that use the "Delivery Costs" button in the sales order to add the delivery costs to the sale order. When this is done, filling the Delivery Method field of the sale.order would cause the invoice to have another line added because that field is used to indicate the delivery.carrier and that the system should compute the shipping costs of the picking when creating the invoice for the picking. This led these kind of companies with the problem that they can not track the carrier used in the shipments. However, this can easily be fixed as I have done:

* I have added another field to the sale.order and to the stock.picking called invoice_shipping_after_picking (displayed as Auto-Invoice Delivery) that controls if the system needs to add the delivery line to the invoice.
* the  carrier_id field (displayed as Delivery Method) will be used to indicate the carrier used to ship the order, and in the picking the carrier used to ship the picking. This way I have splitted the previous functionality of the carrier_id field in two fields as it was really doing two things (specifying the carrier and telling the system to invoice the delivery after picking).
* I have changed the wizard that adds the delivery costs to a sale.order. Now when the delivery costs are added to the sale order, the carrier_id is set to the carrier selected in the wizard and the invoice_shipping_after_picking field is set to false as the delivery line has been added. If the user never clicks on the Delivery Cost button, the system will behave as expected as the default value for invoice_shipping_after_picking is true.
* when creating the invoice from the picking, I check the invoice_shipping_after_picking field and if it is not set, it won't try to add the delivery line to the invoices.
* this branch also fixes bug 625235

With this solution you can know the carrier used if you add the delivery costs manually or if they get added later, so it seems more natural.

As I said before, this changes are critical for us now so please tell me if I need to change anything to get this merged ASAP.

Thank you very much.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: