diff options
| author | William Henrotin <whe@odoo.com> | 2018-09-18 09:32:37 +0200 |
|---|---|---|
| committer | William Henrotin <whe@odoo.com> | 2018-09-20 14:47:06 +0200 |
| commit | ff7df19bd3bb80470a8a3b58b061b89405ffc2c2 (patch) | |
| tree | 56da6d12e26503c985916b206c2961c338554c49 /addons/delivery/models/stock_picking.py | |
| parent | 7dee76b962795844ec87f248994e65fddf4a388a (diff) | |
[IMP] stock: choose destination wizard
Purpose : during a transfer, if some move lines have different
destination locations and the user click on 'put in pack' button, an
warning is triggered. This message, saying : 'You cannot put in the same
pack move lines having different destination location', is replaced by a
wizard allowing the user to choose a unique destination location. This
location will be set as location_dest_id on all transfer's stock move
lines. After that, the wizard calls again the _put_in_pack() method
where all the logic remains the same.
Task : 1872345
Diffstat (limited to 'addons/delivery/models/stock_picking.py')
| -rw-r--r-- | addons/delivery/models/stock_picking.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/delivery/models/stock_picking.py b/addons/delivery/models/stock_picking.py index e3cc5f55ed9..a9afc258004 100644 --- a/addons/delivery/models/stock_picking.py +++ b/addons/delivery/models/stock_picking.py @@ -113,6 +113,9 @@ class StockPicking(models.Model): @api.multi def put_in_pack(self): + res = super(StockPicking, self).put_in_pack() + if isinstance(res, dict) and res.get('type'): + return res if self.carrier_id and self.carrier_id.delivery_type not in ['base_on_rule', 'fixed']: view_id = self.env.ref('delivery.choose_delivery_package_view_form').id return { @@ -123,10 +126,14 @@ class StockPicking(models.Model): 'view_id': view_id, 'views': [(view_id, 'form')], 'target': 'new', - 'context': dict(self.env.context, current_package_carrier_type=self.carrier_id.delivery_type), + 'context': dict( + self.env.context, + current_package_carrier_type=self.carrier_id.delivery_type, + default_stock_quant_package_id=res.id + ), } else: - return self._put_in_pack() + return res @api.multi def action_send_confirmation_email(self): |
