Repository navigation
[19.0][MIG] stock_barcodes: Migration to 19.0 - #742
hoattk-komit wants to merge 332 commits into
Conversation
767e75a to
541138f
Compare
|
Hi @hoattk-komit We are working in improvements in v18... Please follow it to add changes into your migration... Thanks |
Thanks for your comment, I'll do it |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
541138f to
81843ac
Compare
| # Remove all existing move lines and create a new one with 0 quantity | ||
| # to avoid issues with reservation | ||
| stock_move.move_line_ids.unlink() | ||
| self.env["stock.move.line"].create( |
There was a problem hiding this comment.
Should we set variable for self.env["stock.move.line"] into outside of the loop ?
example:
sml_env = self.env["stock.move.line"]
for sml in self:
.....
There was a problem hiding this comment.
This code no longer exists after rebasing on the latest 18.0
| { | ||
| "name": "Product test wo lot tracking", | ||
| "type": "product", | ||
| "type": "consu", |
There was a problem hiding this comment.
Should we also include is_storable? In version 16.0, the product type represents a storable product.
|
|
||
| # Overwrite is needed to take into account new domain values | ||
| product_id = fields.Many2one(domain=[("type", "in", _allowed_product_types)]) | ||
| product_id = fields.Many2one(domain=Domain("type", "in", _allowed_product_types)) |
There was a problem hiding this comment.
Should we also include is_storable in the domain? In version 16.0, the product type represents a storable product.
| domain.append(Domain("inventory_quantity_set", "=", False)) | ||
| order = None | ||
| quants = self.env["stock.quant"].search(domain, order=order) | ||
| quants = self.env["stock.quant"].search(Domain.AND(domain), order=order) |
There was a problem hiding this comment.
Kept search() as in 18.0: the quants are used as full records right after (kanban and writes), so search_fetch brings no real gain here
|
Please, @hoattk-komit , Can you review the PR in v18?? Is ready to merge, after that you can base you migration from 18.0 Thanks. |
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-barcode-15.0/stock-logistics-barcode-15.0-stock_barcodes Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-barcode-15-0/stock-logistics-barcode-15-0-stock_barcodes/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-barcode-15.0/stock-logistics-barcode-15.0-stock_barcodes Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-barcode-15-0/stock-logistics-barcode-15-0-stock_barcodes/
Currently translated at 98.0% (248 of 253 strings) Translation: stock-logistics-barcode-15.0/stock-logistics-barcode-15.0-stock_barcodes Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-barcode-15-0/stock-logistics-barcode-15-0-stock_barcodes/it/
Currently translated at 98.0% (248 of 253 strings) Translation: stock-logistics-barcode-15.0/stock-logistics-barcode-15.0-stock_barcodes Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-barcode-15-0/stock-logistics-barcode-15-0-stock_barcodes/it/
…led for products without tracking
…in is stock_moves without reservations
…stock move lines TT41789
Depend on stock_move_line_qty_picked and remove the duplicate field definitions, computes and SQL initialization. Reuse its view fields without displaying duplicate columns. Show picked quantities by default and explain how normal validation and partial picking behave, including Spanish translations. Cover normal validation without entering picked quantities, manual partial quantities, scanner-to-manual and manual-to-scanner preparation, partial validation from the standard picking form and clearing scans by unpicking. The suite passes all 176 tests with the shared dependency installed. Deploy with the stock_move_line_qty_picked installation and upgrade fix so existing prepared quantities and partial scans are preserved when the shared field is adopted.
…cords The grouping key of the todo records is evaluated both on the moves or move lines being grouped and on the todo records themselves, to find the current todo line again after a scan. Todo records only copy some fields of their source records, so a key like object.picking_id,object.product_id raised an AttributeError when opening the reader. Evaluate the key on the first source record of the todo line, which by definition gives the key of its group.
Port the multi-move scenarios of 18.0-FIX-stock_barcodes-sibling_moves_repartition (fffef9e). Its production changes are already part of this branch: 76dc071 excludes cancelled and done moves from the moves to do, caps a read on a line while sibling moves still have pending demand, and allocates reservations first and then the remaining unreserved demand, all in the scanned unit of measure. Only the tests were missing: serial reads going to an unreserved or reserved sibling, a real excess that still warns and can be forced, a cancelled sibling that neither absorbs reads nor counts as demand, and repeated or manual untracked reads split by demand. The tests live in their own class based on the common fixtures instead of inheriting TestStockBarcodesPicking, which would run that whole suite a second time. The comment on the remaining quantity now states that it is a real excess over the total demand.
Quantities read are now handled by two independent options: - Replace quantity on each reading (no_increase_qty_done) chooses whether a confirmed reading is added to the quantity already recorded or replaces it, for both the done quantity of picking move lines and the counted quantity of inventory quants. It previously only applied to pickings, while inventories used accumulate_read_quantity with the opposite meaning. - Accumulate repeated readings (accumulate_read_quantity): with manual confirmation, reading the same product, lot or packaging again before confirming adds one unit (or packaging) to the quantity to confirm. It is applied once per scan in process_barcode, only when the barcode was matched by the product, packaging or lot option, so location scans, the lot read that completes a product reading and quantities filled from stock do not add units. Combined, units can be counted one by one on the screen and the result replaces the counted quantity. Confirming a counted inventory line edited from the list added its whole quantity again when readings were added; the edited quant is now always replaced. The 18.0.1.5.0 migration keeps the inventory behavior of each database (the inventory screen always uses the Inventory group), leaves the screen accumulation disabled and maps the 15.0 move_lines value of source_pending_moves to move_ids. The unused show_all_quantities and allow_direct_partial_delivery options are removed: nothing reads them since the candidate picking wizard was removed. The help of every option describes what the code does, and strings that called a packaging "package" (packaging quantity, "More than one packaging found", the "Put in back" typo of the put in pack button) are fixed. The readme documents every option grouped by purpose, starting from the analysis of each operation flow with the customer, and the roadmap lists common flows not covered yet.
In 15.0 the picking internal note was shown in the candidate pickings kanban, so operators could see special instructions (e.g. coming from sale_stock_picking_note). That kanban was removed during the migration and the note was no longer displayed. Add a computed picking_note field on the picking wizard that ignores empty HTML values, and show it at the top of the scan content in red, italic and bold. It can be hidden with the hide_note context key, as in 15.0.
Once a product is read, a button next to it on the scan screen opens a touch friendly dialog with the on hand, incoming, outgoing and forecasted quantities of the product and its stock in each internal location of the operation scope. Locations are listed in removal strategy order, reversed on receptions, and tapping one fills the destination location on receptions and the source location otherwise. Buttons next to the source and destination location fields open the same dialog without the product quantities to just pick a location. Their context (location_stock_field, location_stock_reverse) forces the filled field and the order, so internal transfers list the source locations in removal order and the destination ones reversed. On small screens, where labels become icons, the icons replace these buttons. _get_location_stock_field, _is_location_stock_reversed, _get_location_stock_parent_locations and _sort_location_stock let other modules change the filled field, the order and the scope.
…nation In receptions, choosing another destination bin redirected the existing move line of the product to it, including the units already read in the previous bin. Receiving three units of a product without tracking in one bin and the last one in another left the three units in the last bin.
…sers(2,) | res.users.tester(1,)
07c47da to
8771c71
Compare
Thanks @KKamaa , I reviewed your branch: your 19.0 fixes (Odoo 19 API alignment, packaging UoM dispatch, scanner tests) are included in the [MIG] commit with you as co-author. Instead of the upstream sync commit I forward-ported the 18.0 commits individually to keep their authorship. |
Thanks, fixed: the override now uses the Odoo 19 signature and passes date through. |
| const _origOnBarcodeScanned = BarcodeHandlerField.prototype.onBarcodeScanned; | ||
|
|
||
| patch(BarcodeHandlerField.prototype, { | ||
| onBarcodeScanned(event) { |
There was a problem hiding this comment.
@hoattk-komit Odoo 19's barcode handler updates the record asynchronously. Here the original handler is called without awaiting record.update(), and dummy_on_barcode_scanned is clicked immediately afterward.
The button can therefore process an empty or previously scanned barcode before _barcode_scanned finishes its onchange.
Could we await the update before clicking, restrict this behavior to the OCA wizard's _barcode_scanned field, and add a Hoot regression test?
We fixed this in Therp commit 361bfdc0, including tests for asynchronous ordering and preserving standard Odoo barcode behavior.
| import {kanbanView} from "@web/views/kanban/kanban_view"; | ||
| import {registry} from "@web/core/registry"; | ||
|
|
||
| registry.category("views").add("stock_barcodes_kanban", { |
There was a problem hiding this comment.
@hoattk-komit It looks like removing the custom kanban renderer also removed the subscriber for stock_barcodes_kanban_update.
stock_quant.enable_current_operations() still sends the enable_operations notification, while stock_barcodes_read_inventory_views.xml still renders the +/- buttons inside an element with d-none (line 160).
I couldn't find a replacement subscriber that removes this class, so those quantity-adjustment controls appear to remain hidden.
Could we restore this behavior in the kanban renderer or another suitable component and add a Hoot test?
The implementation in Therp's kanban_renderer.esm.js shows the previous subscription and visibility update.
| vals["location_dest_id"] = self.location_dest_id.id | ||
| return vals | ||
|
|
||
| def action_barcode_scan(self, option_group=False, wiz=False): |
There was a problem hiding this comment.
@hoattk-komit Could we add self.ensure_one() at the beginning of action_barcode_scan()?
The method creates one wizard using self.id and the picking's individual fields, so its contract is clearly single-record. Making that explicit avoids confusing failures when invoked on multiple pickings.
Our Therp branch already includes this guard.
| @@ -0,0 +1,2 @@ | |||
| odoo-addon-web_widget_numeric_step @ git+https://github.com/OCA/web.git@refs/pull/3429/head#subdirectory=web_widget_numeric_step | |||
There was a problem hiding this comment.
@hoattk-komit OCA/web#3429 (web_widget_numeric_step) was already merged into 19.0, so we can remove its temporary PR dependency here and use the standard addon dependency.
stock_move_line_qty_picked is still pending in OCA/stock-logistics-workflow#2459, which explains the remaining unreleased-dependency CI failure.
Could we clean up the merged dependency now and remove the remaining temporary PR reference once #2459 is merged?
|
@hoattk-komit check codecov errors found so that the pipeline can be green |
8771c71 to
7657162
Compare
|
The following commit authors need to sign the Contributor License Agreement: |
| name="lot_id" | ||
| options="{'no_create': True, 'no_open': True}" | ||
| domain="[('product_id', '=', product_id)]" | ||
| domain="[('id', 'in', product_packaging_uom_ids)]" |
There was a problem hiding this comment.
Why do we have Lot ID in product_packaging_uom_ids ??
| "qty_picked": qty_done, | ||
| "qty_picked": self.product_id.uom_id._compute_quantity( | ||
| qty_done, line.product_uom_id, round=False | ||
| ), |
There was a problem hiding this comment.
I think the qty_done already _compute_quantity in line 692
line_qty = scan_uom._compute_quantity(
assigned_qty, line.product_uom_id, round=False
)
| ) | ||
| # Assign lot created or found to wizard scanning barcode lot_id field | ||
| product = self.product_id.sudo() if is_stock_manager else self.product_id | ||
| uom = Uom.create(self._prepare_uom_values()) |
There was a problem hiding this comment.
Should we check if the UoM is existed or not before create a new UoM ?
- Packagings are units of measure: packaging_uom_id on the scan wizards, packaging barcodes read from product.uom, new packaging wizard creating a uom.uom relative to the product unit and its product.uom barcode - stock.quant.package -> stock.package, digits "Product Unit", no stock.move name, no posx/posy/posz (locations sorted by complete name) - qty_picked comes from stock_move_line_qty_picked, as in 18.0 - action_apply_inventory(date=None) signature - JS adapted to the Odoo 19 web client: dropped the view_button and view_compiler patches (core renders data-hotkey), Owl/bus API updates, Hoot tests - Tests adapted to Odoo 19 Co-authored-by: Agentiko <amuntri@gmail.com> Co-authored-by: KKamaa <kevkamaa96@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
7657162 to
3d35632
Compare

Depend on: