odoo-addon-stock-barcodes 15.0.3.1.5.2__py3-none-any.whl → 16.0.1.0.0.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. odoo/addons/stock_barcodes/README.rst +6 -6
  2. odoo/addons/stock_barcodes/__manifest__.py +8 -7
  3. odoo/addons/stock_barcodes/data/stock_barcodes_option.xml +1 -2
  4. odoo/addons/stock_barcodes/hooks.py +15 -13
  5. odoo/addons/stock_barcodes/i18n/es.po +2 -2
  6. odoo/addons/stock_barcodes/i18n/it.po +5 -5
  7. odoo/addons/stock_barcodes/i18n/stock_barcodes.pot +190 -160
  8. odoo/addons/stock_barcodes/models/__init__.py +1 -1
  9. odoo/addons/stock_barcodes/models/stock_barcodes_action.py +2 -1
  10. odoo/addons/stock_barcodes/models/stock_barcodes_option.py +2 -4
  11. odoo/addons/stock_barcodes/models/stock_move.py +37 -0
  12. odoo/addons/stock_barcodes/models/stock_move_line.py +8 -14
  13. odoo/addons/stock_barcodes/models/stock_picking.py +9 -36
  14. odoo/addons/stock_barcodes/models/stock_picking_type.py +5 -6
  15. odoo/addons/stock_barcodes/models/stock_quant.py +3 -4
  16. odoo/addons/stock_barcodes/security/ir.model.access.csv +0 -2
  17. odoo/addons/stock_barcodes/static/description/index.html +5 -4
  18. odoo/addons/stock_barcodes/static/src/css/stock.scss +41 -5
  19. odoo/addons/stock_barcodes/static/src/utils/barcode_handler_field.esm.js +36 -0
  20. odoo/addons/stock_barcodes/static/src/utils/barcodes_models_utils.esm.js +25 -0
  21. odoo/addons/stock_barcodes/static/src/views/form_view.esm.js +17 -0
  22. odoo/addons/stock_barcodes/static/src/views/kanban_renderer.esm.js +149 -0
  23. odoo/addons/stock_barcodes/static/src/views/view_compiler.esm.js +16 -0
  24. odoo/addons/stock_barcodes/static/src/views/views.esm.js +193 -0
  25. odoo/addons/stock_barcodes/static/src/widgets/boolean_toggle.esm.js +26 -0
  26. odoo/addons/stock_barcodes/static/src/widgets/numeric_step.esm.js +40 -0
  27. odoo/addons/stock_barcodes/static/src/widgets/numeric_step.xml +17 -0
  28. odoo/addons/stock_barcodes/static/src/widgets/view_button.esm.js +8 -0
  29. odoo/addons/stock_barcodes/static/src/widgets/view_button.xml +14 -0
  30. odoo/addons/stock_barcodes/tests/common.py +167 -0
  31. odoo/addons/stock_barcodes/tests/test_stock_barcodes.py +4 -172
  32. odoo/addons/stock_barcodes/tests/test_stock_barcodes_new_lot.py +2 -2
  33. odoo/addons/stock_barcodes/tests/test_stock_barcodes_picking.py +8 -8
  34. odoo/addons/stock_barcodes/views/stock_barcodes_option_view.xml +1 -1
  35. odoo/addons/stock_barcodes/views/stock_picking_views.xml +4 -3
  36. odoo/addons/stock_barcodes/wizard/stock_barcodes_read.py +56 -94
  37. odoo/addons/stock_barcodes/wizard/stock_barcodes_read_inventory.py +1 -4
  38. odoo/addons/stock_barcodes/wizard/stock_barcodes_read_inventory_views.xml +14 -15
  39. odoo/addons/stock_barcodes/wizard/stock_barcodes_read_picking.py +256 -92
  40. odoo/addons/stock_barcodes/wizard/stock_barcodes_read_picking_views.xml +59 -37
  41. odoo/addons/stock_barcodes/wizard/stock_barcodes_read_todo.py +33 -107
  42. odoo/addons/stock_barcodes/wizard/stock_barcodes_read_todo_view.xml +70 -28
  43. odoo/addons/stock_barcodes/wizard/stock_barcodes_read_views.xml +172 -189
  44. odoo/addons/stock_barcodes/wizard/stock_production_lot.py +2 -2
  45. odoo/addons/stock_barcodes/wizard/stock_production_lot_views.xml +6 -8
  46. {odoo_addon_stock_barcodes-15.0.3.1.5.2.dist-info → odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info}/METADATA +11 -11
  47. odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info/RECORD +66 -0
  48. {odoo_addon_stock_barcodes-15.0.3.1.5.2.dist-info → odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info}/WHEEL +1 -1
  49. odoo/addons/stock_barcodes/migrations/15.0.1.0.0/pre-migration.py +0 -14
  50. odoo/addons/stock_barcodes/models/stock_barcodes_read_log.py +0 -51
  51. odoo/addons/stock_barcodes/static/src/css/stock.css +0 -5
  52. odoo/addons/stock_barcodes/static/src/js/barcodes_models_mixin.js +0 -34
  53. odoo/addons/stock_barcodes/static/src/js/basic_controller.js +0 -412
  54. odoo/addons/stock_barcodes/static/src/js/basic_fields.js +0 -59
  55. odoo/addons/stock_barcodes/static/src/js/form_view.js +0 -24
  56. odoo/addons/stock_barcodes/static/src/js/kanban_renderer.js +0 -47
  57. odoo/addons/stock_barcodes/static/src/js/numeric_step.js +0 -43
  58. odoo_addon_stock_barcodes-15.0.3.1.5.2.dist-info/RECORD +0 -62
  59. {odoo_addon_stock_barcodes-15.0.3.1.5.2.dist-info → odoo_addon_stock_barcodes-16.0.1.0.0.18.dist-info}/top_level.txt +0 -0
@@ -2,11 +2,11 @@
2
2
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
3
  from odoo.tests.common import tagged
4
4
 
5
- from .test_stock_barcodes import TestStockBarcodes
5
+ from .common import TestCommonStockBarcodes
6
6
 
7
7
 
8
8
  @tagged("post_install", "-at_install")
9
- class TestStockBarcodesPicking(TestStockBarcodes):
9
+ class TestStockBarcodesPicking(TestCommonStockBarcodes):
10
10
  @classmethod
11
11
  def setUpClass(cls):
12
12
  super().setUpClass()
@@ -17,8 +17,6 @@ class TestStockBarcodesPicking(TestStockBarcodes):
17
17
  cls.barcode_option_group_out = cls._create_barcode_option_group_outgoing()
18
18
  cls.barcode_option_group_in = cls._create_barcode_option_group_incoming()
19
19
 
20
- cls.barcode_option_group_out.show_scan_log = True
21
- cls.barcode_option_group_in.show_scan_log = True
22
20
  cls.barcode_option_group_out.barcode_guided_mode = False
23
21
  cls.barcode_option_group_in.barcode_guided_mode = False
24
22
  cls.partner_agrolite = cls.env.ref("base.res_partner_2")
@@ -41,7 +39,7 @@ class TestStockBarcodesPicking(TestStockBarcodes):
41
39
  "location_dest_id": cls.customer_location.id,
42
40
  "partner_id": cls.partner_agrolite.id,
43
41
  "picking_type_id": cls.picking_type_out.id,
44
- "move_lines": [
42
+ "move_ids": [
45
43
  (
46
44
  0,
47
45
  0,
@@ -68,7 +66,7 @@ class TestStockBarcodesPicking(TestStockBarcodes):
68
66
  "location_dest_id": cls.stock_location.id,
69
67
  "partner_id": cls.partner_agrolite.id,
70
68
  "picking_type_id": cls.picking_type_in.id,
71
- "move_lines": [
69
+ "move_ids": [
72
70
  (
73
71
  0,
74
72
  0,
@@ -215,10 +213,10 @@ class TestStockBarcodesPicking(TestStockBarcodes):
215
213
  wiz_barcode_id=self.wiz_scan_picking.id, picking_id=self.picking_out_01.id
216
214
  )
217
215
  candidate_wiz.with_context(force_create_move=True).action_lock_picking()
218
- self.assertEqual(self.picking_out_01.move_lines.quantity_done, 2)
216
+ self.assertEqual(self.picking_out_01.move_ids.quantity_done, 2)
219
217
  self.wiz_scan_picking.product_qty = 2
220
218
  self.wiz_scan_picking.with_context(force_create_move=True).action_confirm()
221
- self.assertEqual(self.picking_out_01.move_lines.quantity_done, 4)
219
+ self.assertEqual(self.picking_out_01.move_ids.quantity_done, 4)
222
220
 
223
221
  # Picking out 3 is in confirmed state, so until confirmed moves has
224
222
  # not been activated candidate pickings is 2
@@ -286,6 +284,7 @@ class TestStockBarcodesPicking(TestStockBarcodes):
286
284
 
287
285
  # Continue test with a outgoing wizard
288
286
  self.wiz_scan_picking_out.option_group_id.auto_lot = True
287
+ self.wiz_scan_picking_out.auto_lot = True
289
288
  self.action_barcode_scanned(self.wiz_scan_picking_out, "8433281006850")
290
289
  self.assertEqual(self.wiz_scan_picking_out.lot_id, self.lot_1)
291
290
 
@@ -294,6 +293,7 @@ class TestStockBarcodesPicking(TestStockBarcodes):
294
293
  self.product_tracking.categ_id.removal_strategy_id = self.env.ref(
295
294
  "stock.removal_lifo"
296
295
  )
296
+ self.wiz_scan_picking_out.action_clean_values()
297
297
  self.action_barcode_scanned(self.wiz_scan_picking_out, "8433281006850")
298
298
  self.assertEqual(self.wiz_scan_picking_out.lot_id, lot_3)
299
299
 
@@ -31,9 +31,9 @@
31
31
  />
32
32
  <field name="group_key_for_todo_records" />
33
33
  <field name="location_field_to_sort" />
34
- <field name="show_scan_log" />
35
34
  <field name="show_detailed_operations" />
36
35
  <field name="auto_put_in_pack" />
36
+ <field name="display_read_quant" />
37
37
  </group>
38
38
  <group>
39
39
  <field name="ignore_filled_fields" />
@@ -28,7 +28,6 @@
28
28
  <button
29
29
  name="action_barcode_scan"
30
30
  class="btn btn-secondary"
31
- icon="fa-barcode"
32
31
  type="object"
33
32
  help="Start barcode interface"
34
33
  states="assigned"
@@ -47,9 +46,11 @@
47
46
  <field name="default_location_dest_id" invisible="1" />
48
47
  </field>
49
48
  <xpath expr="//div[hasclass('o_kanban_primary_left')]" position="inside">
49
+ <field name="barcode_option_group_id" invisible="1" />
50
50
  <div
51
51
  class="mt8"
52
- t-if="['incoming', 'outgoing', 'internal'].indexOf(record.code.raw_value) > -1"
52
+ t-if="['incoming', 'outgoing', 'internal'].indexOf(record.code.raw_value) &gt; -1"
53
+ attrs="{'invisible': [('barcode_option_group_id', '=', False)]}"
53
54
  >
54
55
  <button
55
56
  name="action_barcode_scan"
@@ -65,7 +66,7 @@
65
66
  </xpath>
66
67
  <xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside">
67
68
  <div
68
- class="mt8 pull-right"
69
+ class="float-end mt8"
69
70
  t-if="record.default_location_src_id.raw_value and record.default_location_dest_id.raw_value"
70
71
  >
71
72
  <button
@@ -23,7 +23,7 @@ class WizStockBarcodesRead(models.AbstractModel):
23
23
  )
24
24
  product_uom_id = fields.Many2one(comodel_name="uom.uom")
25
25
  product_tracking = fields.Selection(related="product_id.tracking", readonly=True)
26
- lot_id = fields.Many2one(comodel_name="stock.production.lot")
26
+ lot_id = fields.Many2one(comodel_name="stock.lot")
27
27
  lot_name = fields.Char(
28
28
  "Lot/Serial Number Name",
29
29
  compute="_compute_lot_name",
@@ -45,11 +45,6 @@ class WizStockBarcodesRead(models.AbstractModel):
45
45
  confirmed_moves = fields.Boolean(
46
46
  string="Confirmed moves", related="option_group_id.confirmed_moves"
47
47
  )
48
- # Computed field for display all scanning logs from res_model and res_id
49
- # when change product_id
50
- scan_log_ids = fields.Many2many(
51
- comodel_name="stock.barcodes.read.log", compute="_compute_scan_log_ids"
52
- )
53
48
  message_type = fields.Selection(
54
49
  [
55
50
  ("info", "Barcode read with additional info"),
@@ -64,7 +59,7 @@ class WizStockBarcodesRead(models.AbstractModel):
64
59
  guided_product_id = fields.Many2one(comodel_name="product.product")
65
60
  guided_location_id = fields.Many2one(comodel_name="stock.location")
66
61
  guided_location_dest_id = fields.Many2one(comodel_name="stock.location")
67
- guided_lot_id = fields.Many2one(comodel_name="stock.production.lot")
62
+ guided_lot_id = fields.Many2one(comodel_name="stock.lot")
68
63
  action_ids = fields.Many2many(
69
64
  comodel_name="stock.barcodes.action", compute="_compute_action_ids"
70
65
  )
@@ -73,10 +68,8 @@ class WizStockBarcodesRead(models.AbstractModel):
73
68
  step = fields.Integer()
74
69
  is_manual_qty = fields.Boolean(compute="_compute_is_manual_qty")
75
70
  is_manual_confirm = fields.Boolean(compute="_compute_is_manual_qty")
76
- show_scan_log = fields.Boolean(compute="_compute_is_manual_qty")
77
71
  # Technical field to allow use in attrs
78
72
  display_menu = fields.Boolean()
79
- qty_available = fields.Float(compute="_compute_qty_available")
80
73
  auto_lot = fields.Boolean(
81
74
  string="Get lots automatically",
82
75
  help="If checked the lot will be set automatically with the same "
@@ -110,7 +103,6 @@ class WizStockBarcodesRead(models.AbstractModel):
110
103
  rec.is_manual_qty = rec.option_group_id.is_manual_qty
111
104
  rec.is_manual_confirm = rec.option_group_id.is_manual_confirm
112
105
  rec.auto_lot = rec.option_group_id.auto_lot
113
- rec.show_scan_log = rec.option_group_id.show_scan_log
114
106
 
115
107
  @api.depends("option_group_id")
116
108
  def _compute_auto_lot(self):
@@ -122,24 +114,6 @@ class WizStockBarcodesRead(models.AbstractModel):
122
114
  for rec in self:
123
115
  rec.create_lot = rec.option_group_id.create_lot
124
116
 
125
- @api.depends("location_id", "product_id", "lot_id")
126
- def _compute_qty_available(self):
127
- if not self.product_id or self.location_id.usage != "internal":
128
- self.qty_available = 0.0
129
- return
130
- domain_quant = [
131
- ("product_id", "=", self.product_id.id),
132
- ("location_id", "=", self.location_id.id),
133
- ]
134
- if self.lot_id:
135
- domain_quant.append(("lot_id", "=", self.lot_id.id))
136
- # if self.package_id:
137
- # domain_quant.append(('package_id', '=', self.package_id.id))
138
- groups = self.env["stock.quant"].read_group(
139
- domain_quant, ["quantity"], [], orderby="id"
140
- )
141
- self.qty_available = groups[0]["quantity"]
142
-
143
117
  @api.depends("product_id")
144
118
  def _compute_display_assign_serial(self):
145
119
  for rec in self:
@@ -234,7 +208,7 @@ class WizStockBarcodesRead(models.AbstractModel):
234
208
  lot_domain = [("name", "=", self.barcode)]
235
209
  if self.product_id:
236
210
  lot_domain.append(("product_id", "=", self.product_id.id))
237
- lot = self.env["stock.production.lot"].search(lot_domain)
211
+ lot = self.env["stock.lot"].search(lot_domain)
238
212
  if len(lot) == 1:
239
213
  if self.option_group_id.fill_fields_from_lot:
240
214
  quant_domain = [
@@ -258,6 +232,8 @@ class WizStockBarcodesRead(models.AbstractModel):
258
232
  "more_match",
259
233
  _("No stock available for this lot with screen values"),
260
234
  )
235
+ self.lot_id = False
236
+ self.lot_name = False
261
237
  return False
262
238
  if quants:
263
239
  self.set_info_from_quants(quants)
@@ -371,12 +347,14 @@ class WizStockBarcodesRead(models.AbstractModel):
371
347
  def process_barcode_packaging_id(self):
372
348
  domain = self._barcode_domain(self.barcode)
373
349
  if self.env.user.has_group("product.group_stock_packaging"):
350
+ domain.append(("product_id", "!=", False))
374
351
  packaging = self.env["product.packaging"].search(domain)
375
352
  if packaging:
376
353
  if len(packaging) > 1:
377
354
  self._set_messagge_info(
378
355
  "more_match", _("More than one package found")
379
356
  )
357
+ self.packaging_id = False
380
358
  return False
381
359
  self.action_packaging_scaned_post(packaging)
382
360
  return True
@@ -399,14 +377,15 @@ class WizStockBarcodesRead(models.AbstractModel):
399
377
  option_func = getattr(self, "process_barcode_%s" % option.field_name, False)
400
378
  if option_func:
401
379
  res = option_func()
402
- if option.required:
403
- self.play_sounds(res)
404
380
  if res:
405
381
  barcode_found = True
382
+ self.play_sounds(barcode_found)
406
383
  break
407
384
  elif self.message_type != "success":
385
+ self.play_sounds(False)
408
386
  return False
409
387
  if not barcode_found:
388
+ self.play_sounds(barcode_found)
410
389
  if self.option_group_id.ignore_filled_fields:
411
390
  self._set_messagge_info(
412
391
  "info", _("Barcode not found or field already filled")
@@ -415,6 +394,12 @@ class WizStockBarcodesRead(models.AbstractModel):
415
394
  self._set_messagge_info(
416
395
  "not_found", _("Barcode not found with this screen values")
417
396
  )
397
+ self.display_notification(
398
+ self.barcode,
399
+ message_type="danger",
400
+ title=_("Barcode not found"),
401
+ sticky=False,
402
+ )
418
403
  return False
419
404
  if not self.check_option_required():
420
405
  return False
@@ -473,7 +458,10 @@ class WizStockBarcodesRead(models.AbstractModel):
473
458
 
474
459
  def on_barcode_scanned(self, barcode):
475
460
  self.barcode = self._clean_barcode_scanned(barcode)
476
- self.process_barcode(barcode)
461
+
462
+ def dummy_on_barcode_scanned(self):
463
+ """To avoid execute operations in onchange environment"""
464
+ self.process_barcode(self.barcode)
477
465
 
478
466
  def check_location_contidion(self):
479
467
  if not self.location_id:
@@ -558,9 +546,6 @@ class WizStockBarcodesRead(models.AbstractModel):
558
546
  return False
559
547
  if not self.check_done_conditions():
560
548
  return False
561
- if not self.env.context.get("_stock_barcodes_skip_read_log"):
562
- _logger.info("Add scanned log barcode:{}".format(self.barcode))
563
- self._add_read_log()
564
549
  self.process_lot_before_done()
565
550
  return True
566
551
 
@@ -625,7 +610,9 @@ class WizStockBarcodesRead(models.AbstractModel):
625
610
 
626
611
  def action_clean_values(self):
627
612
  options = self.option_group_id.option_ids
628
- options_to_clean = options.filtered("clean_after_done")
613
+ options_to_clean = options.filtered(
614
+ lambda op: op.clean_after_done and op.field_name in self
615
+ )
629
616
  for option in options_to_clean:
630
617
  if option.field_name == "result_package_id" and self.keep_result_package:
631
618
  continue
@@ -639,49 +626,11 @@ class WizStockBarcodesRead(models.AbstractModel):
639
626
  def action_manual_entry(self):
640
627
  return True
641
628
 
642
- def _prepare_scan_log_values(self, log_detail=False):
643
- return {
644
- "name": self.barcode,
645
- "location_id": self.location_id.id,
646
- "product_id": self.product_id.id,
647
- "packaging_id": self.packaging_id.id,
648
- "lot_id": self.lot_id.id,
649
- "packaging_qty": self.packaging_qty,
650
- "product_qty": self.product_qty,
651
- "manual_entry": self.manual_entry,
652
- "res_model_id": self.res_model_id.id,
653
- "res_id": self.res_id,
654
- }
655
-
656
- def _add_read_log(self, log_detail=False):
657
- if self.product_qty and not self.env.context.get("force_create_move", False):
658
- vals = self._prepare_scan_log_values(log_detail)
659
- self.env["stock.barcodes.read.log"].create(vals)
660
-
661
- @api.depends("product_id", "lot_id")
662
- def _compute_scan_log_ids(self):
663
- if self.option_group_id.show_scan_log:
664
- logs = self.env["stock.barcodes.read.log"].search(
665
- [
666
- ("res_model_id", "=", self.res_model_id.id),
667
- ("res_id", "=", self.res_id),
668
- # ("location_id", "=", self.location_id.id),
669
- # ("product_id", "=", self.product_id.id),
670
- ],
671
- limit=10,
672
- )
673
- self.scan_log_ids = logs
674
- else:
675
- self.scan_log_ids = False
676
-
677
629
  # TODO: To remove when stock_move_location uses action_clean_values
678
630
  def reset_qty(self):
679
631
  self.product_qty = 0
680
632
  self.packaging_qty = 0
681
633
 
682
- def action_undo_last_scan(self):
683
- return True
684
-
685
634
  def open_actions(self):
686
635
  self.display_menu = True
687
636
 
@@ -703,11 +652,12 @@ class WizStockBarcodesRead(models.AbstractModel):
703
652
  self.visible_force_done = False
704
653
  return res
705
654
 
706
- @api.model
707
- def create(self, vals):
708
- wiz = super().create(vals)
709
- wiz.action_show_step()
710
- return wiz
655
+ @api.model_create_multi
656
+ def create(self, vals_list):
657
+ wizards = super().create(vals_list)
658
+ for wiz in wizards:
659
+ wiz.action_show_step()
660
+ return wizards
711
661
 
712
662
  def action_manual_quantity(self):
713
663
  action = self.get_formview_action()
@@ -749,12 +699,13 @@ class WizStockBarcodesRead(models.AbstractModel):
749
699
 
750
700
  def action_confirm(self):
751
701
  if not self.check_option_required():
702
+ self.play_sounds(False)
752
703
  return False
753
704
  record = self.browse(self.ids)
754
705
  record.write(self._convert_to_write(self._cache))
755
706
  self = record
756
707
  res = self.action_done()
757
- self.refresh()
708
+ self.invalidate_recordset()
758
709
  self.play_sounds(res)
759
710
  self._set_focus_on_qty_input()
760
711
  return res
@@ -773,15 +724,15 @@ class WizStockBarcodesRead(models.AbstractModel):
773
724
  def play_sounds(self, res):
774
725
  if res:
775
726
  self.env["bus.bus"]._sendone(
776
- "stock_barcodes-{}".format(self.ids[0]),
777
- "stock_barcodes_sound-{}".format(self.ids[0]),
778
- {"sound": "ok"},
727
+ "stock_barcodes_scan",
728
+ "stock_barcodes_sound",
729
+ {"sound": "ok", "res_model": self._name, "res_id": self.ids[0]},
779
730
  )
780
731
  else:
781
732
  self.env["bus.bus"]._sendone(
782
- "stock_barcodes-{}".format(self.ids[0]),
783
- "stock_barcodes_sound-{}".format(self.ids[0]),
784
- {"sound": "ko"},
733
+ "stock_barcodes_scan",
734
+ "stock_barcodes_sound",
735
+ {"sound": "ko", "res_model": self._name, "res_id": self.ids[0]},
785
736
  )
786
737
 
787
738
  def _set_focus_on_qty_input(self, field_name=None):
@@ -790,9 +741,14 @@ class WizStockBarcodesRead(models.AbstractModel):
790
741
  if field_name == "product_qty" and self.packaging_id:
791
742
  field_name = "packaging_qty"
792
743
  self.env["bus.bus"]._sendone(
793
- "stock_barcodes-{}".format(self.ids[0]),
794
- "stock_barcodes_read-{}".format(self.ids[0]),
795
- {"action": "focus", "field_name": field_name},
744
+ "stock_barcodes_scan",
745
+ "stock_barcodes_focus",
746
+ {
747
+ "action": "focus",
748
+ "field_name": field_name,
749
+ "res_model": self._name,
750
+ "res_id": self.ids[0],
751
+ },
796
752
  )
797
753
 
798
754
  @api.onchange("product_id")
@@ -812,7 +768,7 @@ class WizStockBarcodesRead(models.AbstractModel):
812
768
  }
813
769
 
814
770
  def _create_new_lot(self):
815
- StockProductionLot = self.env["stock.production.lot"]
771
+ StockProductionLot = self.env["stock.lot"]
816
772
  lot_domain = [
817
773
  ("name", "=", self.lot_name),
818
774
  ("product_id", "=", self.product_id.id),
@@ -835,12 +791,18 @@ class WizStockBarcodesRead(models.AbstractModel):
835
791
  """Send notifications to web client
836
792
  message_type:
837
793
  [options.type='warning'] 'info', 'success', 'warning', 'danger' or ''
838
- See web/static/src/legacy/js/core/service_mixins.js#L241 to implement more
839
- options.
840
794
  sticky: Permanent notification until user removes it
841
795
  """
842
- if self.option_group_id.display_notification:
843
- message = {"message": message, "type": message_type, "sticky": sticky}
796
+ if self.option_group_id.display_notification and not self.env.context.get(
797
+ "skip_display_notification", False
798
+ ):
799
+ message = {
800
+ "message": message,
801
+ "type": message_type,
802
+ "sticky": sticky,
803
+ "res_model": self._name,
804
+ "res_id": self.ids[0],
805
+ }
844
806
  if title:
845
807
  message["title"] = title
846
808
  self.env["bus.bus"]._sendone(
@@ -98,10 +98,7 @@ class WizStockBarcodesReadInventory(models.TransientModel):
98
98
  )
99
99
 
100
100
  def action_done(self):
101
- result = super(
102
- WizStockBarcodesReadInventory,
103
- self.with_context(_stock_barcodes_skip_read_log=True),
104
- ).action_done()
101
+ result = super().action_done()
105
102
  if result:
106
103
  result = self._add_inventory_quant()
107
104
  if result:
@@ -14,7 +14,10 @@
14
14
  <group name="quant_package" position="replace">
15
15
  <div class="mt4">
16
16
  <strong class="d-none d-sm-block">Package</strong>
17
- <span class="fa fa-inbox d-sm-none oe_span_small_icon" />
17
+ <span
18
+ class="fa fa-inbox d-sm-none oe_span_small_icon"
19
+ title="package"
20
+ />
18
21
  <field
19
22
  name="package_id"
20
23
  options="{'no_create': True}"
@@ -34,11 +37,13 @@
34
37
  <group
35
38
  string="Inventory quants"
36
39
  attrs="{'invisible': [('inventory_quant_ids', '=', [])]}"
40
+ col="2"
37
41
  >
38
42
  <field
39
43
  name="inventory_quant_ids"
40
44
  options="{'no_open': True}"
41
45
  nolabel="1"
46
+ colspan="2"
42
47
  mode="tree,kanban"
43
48
  >
44
49
  <tree>
@@ -80,6 +85,7 @@
80
85
  type="object"
81
86
  class="btn"
82
87
  icon="fa-recycle"
88
+ title="Remove quant"
83
89
  context="{'wiz_barcode_id': parent.id}"
84
90
  />
85
91
  </tree>
@@ -100,12 +106,12 @@
100
106
  </div>
101
107
  <div class="col-2">
102
108
  <span
103
- class="pull-right text-right font-weight-bold"
109
+ class="float-end text-end fw-bold"
104
110
  >
105
111
  <field name="inventory_quantity" />
106
112
  </span>
107
113
  </div>
108
- <div class="col-3 text-right">
114
+ <div class="col-3 text-end">
109
115
  <button
110
116
  name="action_barcode_inventory_quant_edit"
111
117
  type="object"
@@ -121,15 +127,11 @@
121
127
  <button
122
128
  name="action_barcode_inventory_quant_unlink"
123
129
  type="object"
130
+ icon="fa-recycle"
131
+ title="Reset inventory quantity"
124
132
  class="btn mt0"
125
133
  context="{'wiz_barcode_id': parent.id}"
126
- >
127
- <i
128
- class="fa fa-recycle"
129
- title="Reset inventory quantity"
130
- style="font-size:1.5em"
131
- />
132
- </button>
134
+ />
133
135
  </div>
134
136
  </div>
135
137
  <div class="row">
@@ -156,10 +158,7 @@
156
158
  </group>
157
159
  <div name="manual_entry" position="after">
158
160
  <div class="d-flex" name="display_read_quant">
159
- <field
160
- name="display_read_quant"
161
- widget="FieldBarcodeBooleanToggle"
162
- />
161
+ <field name="display_read_quant" widget="barcode_boolean_toggle" />
163
162
  <label for="display_read_quant" />
164
163
  </div>
165
164
  </div>
@@ -167,7 +166,7 @@
167
166
  <button
168
167
  name="apply_inventory"
169
168
  type="object"
170
- class="btn-primary ml-auto oe_kanban_action_button btn-sm"
169
+ class="btn-primary ms-auto oe_kanban_action_button btn-sm"
171
170
  attrs="{'invisible': ['|', ('display_menu', '=', True), ('inventory_quant_ids', '=', [])]}"
172
171
  data-hotkey="7"
173
172
  groups="stock.group_stock_manager"