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 31db697
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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 31db697

Please sign in to comment.