Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AdriaGForgeFlow committed Oct 21, 2019
1 parent 1a28667 commit 3e88b1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
14 changes: 0 additions & 14 deletions stock_barcodes/tests/test_stock_barcodes_picking.py
Expand Up @@ -158,7 +158,6 @@ def test_picking_wizard_remove_last_scan(self):
self.assertEqual(self.wiz_scan_picking.picking_product_qty, 0.0)

def test_barcode_from_operation(self):
picking_out_3 = self.picking_out_01.copy()
self.picking_out_01.action_assign()
self.picking_out_02.action_assign()

Expand All @@ -174,16 +173,3 @@ def test_barcode_from_operation(self):

self.wiz_scan_picking.action_manual_entry()
self.assertEqual(self.picking_out_01.pack_operation_ids.qty_done, 2)
# self.wiz_scan_picking.action_manual_entry()
# self.assertEqual(self.picking_out_01.pack_operation_ids.qty_done, 4)

# Picking out 3 is in confirmed state, so until confirmed moves has
# not been activated candidate pickings is 2
# picking_out_3.action_confirm()
# candidate_wiz.action_unlock_picking()
# self.wiz_scan_picking.action_manual_entry()
# self.assertEqual(len(self.wiz_scan_picking.candidate_picking_ids), 2)
# self.wiz_scan_picking.confirmed_moves = True
# candidate_wiz.action_unlock_picking()
# self.wiz_scan_picking.action_manual_entry()
# self.assertEqual(len(self.wiz_scan_picking.candidate_picking_ids), 3)
6 changes: 4 additions & 2 deletions stock_barcodes/wizard/stock_barcodes_read_picking.py
Expand Up @@ -103,8 +103,10 @@ def name_get(self):
@api.onchange('product_id')
def onchange_product_id(self):
if self.product_id:
candidate_picking_ids = self.env['stock.pack.operation'].search(
[('product_id', '=', self.product_id.id)]).mapped('picking_id')
candidate_picking_ids = self.env['stock.pack.operation'].search([
('product_id', '=', self.product_id.id),
('state', 'in', ['assigned']),
]).mapped('picking_id')
if self.picking_id not in candidate_picking_ids:
self.picking_id = False
return {'domain': {'picking_id': [
Expand Down
3 changes: 1 addition & 2 deletions stock_barcodes/wizard/stock_barcodes_read_views.xml
Expand Up @@ -52,8 +52,7 @@
</group>
<group name="product_group">
<field name="product_id" options="{'no_create': True}"
attrs="{'required': [('manual_entry', '=', True)]}"
force_save="1" widget="selection"/>
attrs="{'required': [('manual_entry', '=', True)]}"/>
<field name="packaging_id" options="{'no_create': True}" domain="[('product_id', '=', product_id)]" attrs="{'readonly': [('manual_entry', '=', False)]}" force_save="1" groups="product.group_stock_packaging"/>
<field name="packaging_qty" attrs="{'invisible': ['|', ('packaging_id', '=', False), ('manual_entry', '=', False)], 'readonly': [('manual_entry', '=', False)]}" force_save="1" widget="FieldFloatNumericMode"/>
<field name="product_qty" attrs="{'invisible': [('manual_entry', '=', False)], 'readonly': [('manual_entry', '=', False)]}" force_save="1" widget="FieldFloatNumericMode"/>
Expand Down

0 comments on commit 3e88b1c

Please sign in to comment.