Skip to content

[16.0][IMP] pos_product_quick_info: The following improvements have been made: - #1440

Open
atgalvez08 wants to merge 1 commit into
OCA:16.0from
BinhexTeam:16.0-IMP-pos_product_quick_info
Open

[16.0][IMP] pos_product_quick_info: The following improvements have been made:#1440
atgalvez08 wants to merge 1 commit into
OCA:16.0from
BinhexTeam:16.0-IMP-pos_product_quick_info

Conversation

@atgalvez08

@atgalvez08 atgalvez08 commented Sep 29, 2025

Copy link
Copy Markdown

@BinhexTeam

  • The sales description is displayed in the information pop-up.
  • The locations within the warehouse where the product is available are displayed.
  • Variants with the same attribute are grouped together to prevent duplicate attribute errors.

@atgalvez08 atgalvez08 changed the title [IMP] pos_product_quick_info: The following improvements have been made: [16.0][IMP] pos_product_quick_info: The following improvements have been made: Sep 29, 2025
Comment thread pos_product_quick_info/models/product_product.py Outdated
Comment thread pos_product_quick_info/models/product_product.py Outdated
Comment thread pos_product_quick_info/static/src/xml/Popups/ProductInfoPopup.xml Outdated
Comment thread pos_product_quick_info/models/product_product.py Outdated
Comment thread pos_product_quick_info/models/product_product.py Outdated
Comment thread pos_product_quick_info/models/product_product.py Outdated
Comment thread pos_product_quick_info/models/product_product.py Outdated
@atgalvez08
atgalvez08 force-pushed the 16.0-IMP-pos_product_quick_info branch from 7a17645 to da54977 Compare October 1, 2025 14:19
@atgalvez08
atgalvez08 marked this pull request as ready for review October 16, 2025 10:57

@rrebollo rrebollo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review: Great work! The code looks good to me (LGTM). Thank you for your contribution! I've provided a few suggestions for your consideration—feel free to address them as you see fit.

Comment on lines +61 to +117
quants = quant_obj.read_group(
domain=[
('product_id', '=', product.id),
('location_id', 'in', location_ids),
],
fields=['quantity', 'location_id'],
groupby=['location_id'],
)

# Future incoming and outgoing movements
incoming_moves = move_obj.read_group(
domain=[
('product_id', '=', product.id),
('location_dest_id', 'in', location_ids),
('state', 'in', ['confirmed', 'waiting', 'assigned']),
],
fields=['product_uom_qty', 'location_dest_id'],
groupby=['location_dest_id'],
)

outgoing_moves = move_obj.read_group(
domain=[
('product_id', '=', product.id),
('location_id', 'in', location_ids),
('state', 'in', ['confirmed', 'waiting', 'assigned']),
],
fields=['product_uom_qty', 'location_id'],
groupby=['location_id'],
)

# Index quantities by location
available_by_location = {
q['location_id'][0]: q['quantity'] for q in quants
}
incoming_by_location = {
m['location_dest_id'][0]: m['product_uom_qty'] for m in incoming_moves
}
outgoing_by_location = {
m['location_id'][0]: m['product_uom_qty'] for m in outgoing_moves
}

# Build list of locations
location_list = []
for loc in internal_locations:
loc_id = loc.id
available = available_by_location.get(loc_id, 0.0)
incoming = incoming_by_location.get(loc_id, 0.0)
outgoing = outgoing_by_location.get(loc_id, 0.0)
forecasted = available + incoming - outgoing

# SOnly show relevant locations (if any exist)
if available or incoming or outgoing:
location_list.append({
'name': loc.display_name,
'available_quantity': available,
'forecasted_quantity': forecasted,
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For consistency, I suggest exploring some built-in resources related to the stock by location request. For example:
https://github.com/odoo/odoo/blob/85073d10a9f4b5a74d31adcba815651d6f217dbf/addons/stock/models/product.py#L136

@rrebollo

Copy link
Copy Markdown

I’m not sure why, but the only check that ran for this PR was Runboat. I haven’t seen anything like this before.

@christian-ramos-tecnativa christian-ramos-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@atgalvez08 you can rebase to try triggering the tests

@github-actions

Copy link
Copy Markdown

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 29, 2026
@atgalvez08
atgalvez08 force-pushed the 16.0-IMP-pos_product_quick_info branch 5 times, most recently from 3f47a6b to cd2194a Compare April 1, 2026 15:06

@rrebollo rrebollo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review. LGTM!

@christian-ramos-tecnativa christian-ramos-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a pos_product_quick_info.zip file in the PR changes, can you remove it?

@atgalvez08
atgalvez08 force-pushed the 16.0-IMP-pos_product_quick_info branch from cd2194a to 69ce53c Compare April 2, 2026 11:10
@atgalvez08

Copy link
Copy Markdown
Author

There is a pos_product_quick_info.zip file in the PR changes, can you remove it?

Done, .zip file deleted

@christian-ramos-tecnativa christian-ramos-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also as a final request, can you remove the empty lines inside the python functions?
It makes the code innecesary longer.
Image
Thanks!

Comment thread pos_product_quick_info/models/product_product.py
@atgalvez08
atgalvez08 force-pushed the 16.0-IMP-pos_product_quick_info branch from 69ce53c to b90d477 Compare April 2, 2026 11:53
@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 5, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 9, 2026
@atgalvez08
atgalvez08 force-pushed the 16.0-IMP-pos_product_quick_info branch from b90d477 to a182289 Compare August 9, 2026 13:09
@OCA-git-bot OCA-git-bot added series:16.0 mod:pos_product_quick_info Module pos_product_quick_info labels Aug 9, 2026
- The sales description is displayed in the information pop-up.
- The locations within the warehouse where the product is available are displayed.
- Variants with the same attribute are grouped together to prevent duplicate attribute errors.
@atgalvez08
atgalvez08 force-pushed the 16.0-IMP-pos_product_quick_info branch from a182289 to 1bfbca5 Compare August 10, 2026 07:12

@jelenapoblet jelenapoblet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Functional review ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:pos_product_quick_info Module pos_product_quick_info series:16.0 stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants