From 47e2521d94f090e4dc2035be2ce36c43842609ed Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 27 Dec 2017 13:57:28 +0100 Subject: [PATCH] [FIX] delivery: reactivate update soline on shipper install delivery Create a SO with a shipper Validate it validate the delivery Before this commit it was: - impossible to do the setup for the delivery cost on the SO to get updated with the delivery validation - the delivery cost on the SO did not update This was because the stock API changed a bit a some functions were not here anymore OPW 786500 --- addons/delivery/models/stock_picking.py | 4 ++-- addons/stock/models/stock_picking.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py index 7ef3df53719..d10411c99ad 100644 --- a/addons/delivery/models/stock_picking.py +++ b/addons/delivery/models/stock_picking.py @@ -106,10 +106,10 @@ class StockPicking(models.Model): picking.weight = sum(move.weight for move in picking.move_lines if move.state != 'cancel') @api.multi - def do_transfer(self): + def action_done(self): # TDE FIXME: should work in batch self.ensure_one() - res = super(StockPicking, self).do_transfer() + res = super(StockPicking, self).action_done() if self.carrier_id and self.carrier_id.integration_level == 'rate_and_ship': self.send_to_shipper() diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 9c24a04c0f4..213c54a4c7a 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -635,7 +635,12 @@ class Picking(models.Model): self.write({'date_done': fields.Datetime.now()}) return True - do_transfer = action_done #TODO:replace later + # Backward compatibility + # Problem with fixed reference to a function: + # it doesn't allow for overriding action_done() through do_transfer + # get rid of me in master (and make me private ?) + def do_transfer(self): + return self.action_done() def _check_move_lines_map_quant_package(self, package): """ This method checks that all product of the package (quant) are well present in the move_line_ids of the picking. """