Skip to content

Conversation

@chienandalu
Copy link
Member

Followup to #587

  • Drop scan read logs feature, which use was deprecated already in the
    previous versions.
  • Pass bootstrap migration scripts.
  • Fix views issues.
  • Other code fixes.

cc @Tecnativa

@FranzPoize I've been doing the migration with @sergio-teruel, who's the main developer of the module in the spanish OCA days. We started from your migration head.

At this point the module is completely functional, although we're still tweaking the views to fit the previous state.

@pedrobaeza
Copy link
Member

This doesn't contain #604

@pedrobaeza
Copy link
Member

/ocabot migration stock_barcodes

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone May 13, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request May 13, 2024
13 tasks
@chienandalu
Copy link
Member Author

This doesn't contain #604

Fixed

@chienandalu chienandalu force-pushed the 16.0-mig-stock_barcodes-3 branch from e88a48f to 470385b Compare May 13, 2024 08:48
@FranzPoize
Copy link

FranzPoize commented May 13, 2024

Hello ! I pushed some stuff just after you created this PR I think. In it there was a lot of work to replace the always_reload feature of old odoo version.

@chienandalu
Copy link
Member Author

Hi, @FranzPoize !

Do you mean this new stuff or something else?: 3828828#diff-f69121127ec9ebdc28296fa3a7f3760d71865de0267308101bf6d467fef4769cR106-R121

@FranzPoize
Copy link

No I mean this stuff 3828828#diff-00871f58b13dd92c5ff7599bc210323e9a6e64bdbf58abd5a3c19c83428d5dbb

What you linked to is some other features we added:

  • Allowing scanning product on at a time in new picking (not use the total quant by default)
  • Forbidding picking validation if their is a move_line with the same location_id and location_dest_id
  • Offer an option to not check demand during picking (this solve the issue where if you reload after a picking creation you will not be able to pick more product without using the force action done)
  • Update all destination of all move_line when scanning a location (This allows destination to be scanned last because otherwise it does not work)

@chienandalu
Copy link
Member Author

there was a lot of work to replace the always_reload feature of old odoo version.
I mean this stuff 3828828#diff-00871f58b13dd92c5ff7599bc210323e9a6e64bdbf58abd5a3c19c83428d5dbb

Can you elaborate on why this is needed? What's the issue you're trying to solve?

other features we added:

  • Allowing scanning product on at a time in new picking (not use the total quant by default)
  • Forbidding picking validation if their is a move_line with the same location_id and location_dest_id
  • Offer an option to not check demand during picking (this solve the issue where if you reload after a picking creation you will not be able to pick more product without using the force action done)
  • Update all destination of all move_line when scanning a location (This allows destination to be scanned last because otherwise it does not work)

I commented these with @sergio-teruel last week and some of them could be accomplished with the current config (I'm sure he can elaborate in detail :)). In any case, is better to limit the scope the PR to the module migration stuff and do any feature proposal in a later one

@FranzPoize
Copy link

You don't have to take those features if you don't want to. But you should take the always_reload feature imho because otherwise there is no update of many2one field unless there is a button pressed.

@chienandalu chienandalu force-pushed the 16.0-mig-stock_barcodes-3 branch 2 times, most recently from 81e7e27 to 11c42f5 Compare May 15, 2024 10:15
@FranzPoize
Copy link

In 14.0 there was this

options="{'no_open': True, 'always_reload': True}"
This does not work anymore the code here 3828828#diff-00871f58b13dd92c5ff7599bc210323e9a6e64bdbf58abd5a3c19c83428d5dbb replaces this always_reload feature.

And I said many2ones in my previous comment I made a mistake. This allows one2many fields and many2many field to update their data when an onchange event is triggered.

@chienandalu
Copy link
Member Author

Hi @FranzPoize let me check it and I tell you

@lk-eska
Copy link

lk-eska commented May 27, 2024

Is there any progress on this PR?

@sergio-teruel
Copy link
Contributor

Hi @ik-eska two commits 4 days ago... Any progress?? Yes...

@lk-eska
Copy link

lk-eska commented May 27, 2024

Sorry @sergio-teruel I haven't noticed them.

@sergio-teruel
Copy link
Contributor

jaja... don't worry... 😄

@sergio-teruel
Copy link
Contributor

Cherry pick from 15.0 ef65da1

@pedrobaeza
Copy link
Member

@chienandalu @sergio-teruel please fix the CI and finish this for merging it.

@chienandalu chienandalu force-pushed the 16.0-mig-stock_barcodes-3 branch from 5ca89b3 to 1c9371a Compare September 12, 2024 14:29
@sergio-teruel sergio-teruel force-pushed the 16.0-mig-stock_barcodes-3 branch 2 times, most recently from ee83d7c to a97f2f3 Compare October 8, 2024 13:58
@sergio-teruel
Copy link
Contributor

@pedrobaeza Tests ok

@pedrobaeza
Copy link
Member

@carlosdauden should I merge or should I wait for your last patches? Can you give your approval?

carlosdauden and others added 5 commits October 9, 2024 21:56
…de_scanned instead of onchange

Onchange limits documented in method:
It is not possible for a ``one2many`` or ``many2many`` field to modify
itself via onchange. This is a webclient limitation - see `#2693 <https://github.com/odoo/odoo/issues/2693>`_.

This causes refresh problems when creating or modifying records, and it is also not ideal to create records in "onchange mode"
@carlosdauden carlosdauden force-pushed the 16.0-mig-stock_barcodes-3 branch from a97f2f3 to ec1e99c Compare October 9, 2024 19:56
@abhinavvaidya-tsd
Copy link

is this PR stuck?

@carlosdauden
Copy link
Contributor

We plan to finish the work by the end of this week.

Copy link
Member

@houzefa-abba houzefa-abba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this work, I tested on runboat / in local env:

  • Scan interface works fine with my Inateck BCST-23 without any specific config
  • "Picking IN" mode with the "Create lots if not match" setting
  • "Picking OUT" mode
  • "Show Detailed Operations" setting
  • Disable "Fill Fields From Lot" setting to scan the same product several times if multiple quantities are expected
  • Play with combos of these settings to scan multiple serial numbers of the same product within 1 picking
  • Scan more quantities than expected, get "quantities higher than necessary" message, click on red ✔️ to force adding it
  • Scan less quantities than expected, click "Validate" early on ➔ Partial transfer gets validated & second one is created with remaining quantities

@houzefa-abba
Copy link
Member

Hi I have this issue in inventory mode:

  • Give a product a barcode + tracking by serial number
  • Go to Barcodes > Inventory
  • Scan the product barcode added above

➔ Error:

  File "/mnt/data/odoo-addons-dir/stock_barcodes/wizard/stock_barcodes_read.py", line 142, in _compute_qty_available
    done_move_lines = self.move_line_ids.filtered(
AttributeError: 'wiz.stock.barcodes.read.inventory' object has no attribute 'move_line_ids'

In 15.0, this displays an "Expected serial number scan" popup, but does not crash.

Also note:

  • No error when the product has no tracking by s/n
  • No error when scanning a serial number instead

@sergio-teruel
Copy link
Contributor

Hi @houzefa-abba Fixed in last commit (4978de6)

Thanks

@alexis-via
Copy link
Contributor

Thanks for your great work on the migration of this great module.

I have a usability remark on inventory: you added a new boolean option "display_read_quant" on the wizard wiz.stock.barcodes.read.inventory. When this option is not checked, the user doesn't see the result of the scans, which is error-prone.
So I suggest 3 solutions:

  1. modify the definition of this field to set default=True
  2. move this option to stock.barcodes.option.group, so that we can enable this option for all inventories
  3. add an option on stock.barcodes.option.group that will act as a default value for the field "display_read_quant" of the wizard (combination of solution 1 and 2)
    I don't have a strong opinion myself about the best option. As of today, my opinion is : it should not be an option, because I think it's too risky to scan without visibility on the result !
    If you want, I'm ready to make a PR to your branch to implement the preferred solution.

for fname in quant._fields:
if fname in self._get_fields_to_edit():
wiz_barcode[fname] = quant[fname]
wiz_barcode.product_qty = quant.inventory_quantity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When reading this code, I see that, on line 30, in the loop on quant._fields that are in _get_fields_to_edit(), it will write:

wiz_barcode.product_qty

then, on line 31, it will write:

wiz_barcode.product_qty = quant.inventory_quantity

Is it normal ? Shouldn't we remove "product_qty" from _get_fields_to_edit ?

@sergio-teruel
Copy link
Contributor

Hi @alexis-via thanks for your comments

I have added display read items in the option group to apply as a default value.
Also fix the view and your suggestion in stock quant

@alexis-via
Copy link
Contributor

@sergio-teruel I made some tests with your last commit: it works very well, thanks a lot !
Thanks for fixing the view with the display of the quants!

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-610-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 0558e6d into OCA:16.0 Nov 19, 2024
5 of 7 checks passed
@pedrobaeza pedrobaeza deleted the 16.0-mig-stock_barcodes-3 branch November 19, 2024 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.