Skip to content

Commit

Permalink
Do not validate pickings already done. (#1110)
Browse files Browse the repository at this point in the history
Otherwise
odoo.exceptions.UserError: ('You cannot validate a transfer if no quantites are reserved nor done. To force the transfer, switch in edit more and encode the done quantities.', '')
  • Loading branch information
eLBati authored and tafaRU committed Mar 10, 2019
1 parent a2a814c commit c98c7a4
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions l10n_it_ddt/tests/test_ddt.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,10 @@ def test_action_put_in_pack_done_pickings_error(self):
self.picking.action_confirm()
self.picking.action_assign()
wiz_vals = self.picking.button_validate()
if wiz_vals:
# The picking might require further approval
wiz = self.env[wiz_vals['res_model']] \
.browse(wiz_vals['res_id'])
wiz.process()
# The picking requires further approval
wiz = self.env[wiz_vals['res_model']] \
.browse(wiz_vals['res_id'])
wiz.process()
self.ddt.picking_ids = [(6, 0, [self.picking.id, ])]
self.picking.action_done()
self.assertTrue(self.ddt.check_if_picking_done)
Expand Down Expand Up @@ -311,12 +310,10 @@ def test_sale_order(self):
order3.picking_ids.action_assign()
for picking in order3.picking_ids:
wiz_vals = picking.button_validate()
if wiz_vals:
# The picking might require further approval
wiz = self.env[wiz_vals['res_model']] \
.browse(wiz_vals['res_id'])
wiz.process()
picking.button_validate()
# The picking might require further approval
wiz = self.env[wiz_vals['res_model']] \
.browse(wiz_vals['res_id'])
wiz.process()

# test invoice
wizard = self.env['sale.advance.payment.inv'].with_context({
Expand Down Expand Up @@ -400,12 +397,10 @@ def test_set_done(self):
picking1.action_assign()
ddt = self._create_ddt(picking1)
wiz_vals = picking1.button_validate()
if wiz_vals:
# The picking might require further approval
wiz = self.env[wiz_vals['res_model']] \
.browse(wiz_vals['res_id'])
wiz.process()
picking1.button_validate()
# The picking might require further approval
wiz = self.env[wiz_vals['res_model']] \
.browse(wiz_vals['res_id'])
wiz.process()
ddt.set_done()
self.assertTrue('DDT' in ddt.display_name)
self.assertEqual(ddt.weight, 0)
Expand Down

0 comments on commit c98c7a4

Please sign in to comment.