Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] stock_barcodes #668

Open
wants to merge 9 commits into
base: 16.0
Choose a base branch
from

Conversation

edescalona
Copy link

@edescalona edescalona commented Dec 25, 2024

@BinhexTeam The different views for the barcode have been modified.

@edescalona edescalona closed this Dec 27, 2024
@edescalona edescalona reopened this Jan 7, 2025
@edescalona edescalona force-pushed the 16.0-imp-stock-barcodes-styles branch from 40a5fff to 8db115d Compare January 7, 2025 06:28
@edescalona edescalona closed this Jan 7, 2025
@edescalona edescalona reopened this Jan 7, 2025
@edescalona edescalona force-pushed the 16.0-imp-stock-barcodes-styles branch from 5b174db to ebdc6c8 Compare January 21, 2025 04:08
@edescalona edescalona mentioned this pull request Jan 21, 2025
7 tasks
@edescalona edescalona force-pushed the 16.0-imp-stock-barcodes-styles branch from 626a984 to ddcf9f7 Compare January 23, 2025 02:39
@rousseldenis
Copy link
Contributor

@edescalona As the changes in this are quite different than the PR description, could you enhance it to enumerate them?

And it is better to add the module name in the commit messages like [IMP] stock_barcodes: (...).

Thanks!

@edescalona
Copy link
Author

@edescalona As the changes in this are quite different than the PR description, could you enhance it to enumerate them?

And it is better to add the module name in the commit messages like [IMP] stock_barcodes: (...).

Thanks!

Hello @rousseldenis , ok, I'll upload other improvements in a while and with their description, greetings

@edescalona edescalona force-pushed the 16.0-imp-stock-barcodes-styles branch from 15699bc to 3353c3a Compare January 23, 2025 18:14
@mrsavage
Copy link

mrsavage commented Jan 24, 2025

I really would like to have this :) Thanks for the work

@edescalona edescalona force-pushed the 16.0-imp-stock-barcodes-styles branch 3 times, most recently from 03c8f1e to bbd2046 Compare January 24, 2025 23:50
@edescalona
Copy link
Author

Hi @mrsavage @rousseldenis , the PR is ready to be reviewed again, any opinion is welcome, thanks.

@Christian-RB
Copy link

@edescalona Can you check the files changed? There are modules that shouldn't be envolved here

@edescalona edescalona force-pushed the 16.0-imp-stock-barcodes-styles branch from 597bc39 to 1559540 Compare January 27, 2025 15:37
@edescalona
Copy link
Author

@edescalona Can you check the files changed? There are modules that shouldn't be envolved here

Hi @Christian-RB I have already checked and corrected the changes in other modules that should not be involved. Ready to be reviewed, thanks for your contribution.

@hitrosol
Copy link

Thanks for this PR.
I try this on runboat.

  1. Set the Barcode Option Group of Picking IN options in the Receipts
  2. Click the Picking IN, in the Barcode menu.
  3. Click the x to process button.
  4. It shows the Picking In orders.
  5. Validate one of them.
  6. The screen now show all picking order. IMHO it should only shows the same picking type order.

@edescalona
Copy link
Author

Thanks for this PR. I try this on runboat.

  1. Set the Barcode Option Group of Picking IN options in the Receipts
  2. Click the Picking IN, in the Barcode menu.
  3. Click the x to process button.
  4. It shows the Picking In orders.
  5. Validate one of them.
  6. The screen now show all picking order. IMHO it should only shows the same picking type order.

Hello @hitrosol , thank you for your contribution. I will review the details you mentioned. Thank you very much.

@edescalona
Copy link
Author

Hello @hitrosol I have already made the change you suggested, thanks for your contribution, it can be reviewed again, greetings

Copy link
Member

@baguenth baguenth left a comment

Choose a reason for hiding this comment

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

Your pull requests could have more code documentation from my point of view.
Currently there are only a few doc strings and code comments.

Especially when changing a lot of code (what you did) I highly recommend to document the code well. This helps reviewers to understand the changes.

if len(matched_actions) > len(all_barcode):
raise ValidationError(
_(
f"Barcode has already been assigned to "
Copy link
Member

Choose a reason for hiding this comment

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

Odoos translation engine (babel) doesn't support F-strings in the used version.
Please use format strings or something similar.

Copy link
Author

Choose a reason for hiding this comment

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

Your comment has been resolved, thank you for your contribution.


@api.constrains("context")
def _constrains_context(self):
if self.context and not bool(
Copy link
Member

Choose a reason for hiding this comment

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

Odoos translation engine (babel) doesn't support F-strings in the used version.
Please use format strings or something similar.

Copy link
Author

Choose a reason for hiding this comment

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

Your comment has been resolved, thank you for your contribution.

@@ -396,7 +408,7 @@ def _prepare_stock_moves_domain(self):
]
if self.picking_id:
domain.append(("picking_id", "=", self.picking_id.id))
return domain
return []
Copy link
Member

Choose a reason for hiding this comment

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

This function statically returns [] now. I guess this is not correct.

Copy link
Author

Choose a reason for hiding this comment

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

Your comment has been resolved, thank you for your contribution.

@edescalona
Copy link
Author

Hi @baguenth I've already reviewed your comments, thanks for your contribution

@edescalona
Copy link
Author

Your pull requests could have more code documentation from my point of view. Currently there are only a few doc strings and code comments.

Especially when changing a lot of code (what you did) I highly recommend to document the code well. This helps reviewers to understand the changes.

Ok, I will add some other indications for better understanding, thanks

[16.0][IMP] stock_barcodes: Readme
@edescalona
Copy link
Author

Hi @baguenth , I have already made improvements to the documentation. Please let me know when you can. Thanks for your contribution.

for action in self:
if not re.match(REGEX.get("barcode", False), action.barcode):
raise ValidationError(
_(
Copy link
Member

Choose a reason for hiding this comment

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

Tbh I am not sure if we can and should use the format part within the translation bracket. Better use:

_("...").format(...)

matched_actions = self.sudo().search(domain, order="id")
if len(matched_actions) > len(all_barcode):
raise ValidationError(
_(
Copy link
Member

Choose a reason for hiding this comment

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

Tbh I am not sure if we can and should use the format part within the translation bracket. Better use:

_("...").format(...)

@edescalona
Copy link
Author

Hi @baguenth , you can now review the changes, thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants