Skip to content

[17.0][ADD] stock_available_portal_owner: add module - #85

Open
ajfebres wants to merge 1 commit into
OCA:17.0from
BinhexTeam:17.0-add-stock-available_portal_owner
Open

ajfebres wants to merge 1 commit into
OCA:17.0from
BinhexTeam:17.0-add-stock-available_portal_owner

Conversation

@ajfebres

@ajfebres ajfebres commented Aug 24, 2026 •

Copy link
Copy Markdown

@BinhexTeam

[ADD] stock_available_portal_owner: Portal visibility for consigned stock

📝 Context & Need

In logistics models handling consignment inventory, third-party merchandise owners require autonomous visibility over their stock levels stored in third-party warehouses. While Odoo natively tracks stock ownership using the standard owner_id field in the inventory module, it lacks a built-in portal interface for owners to view their specific stock availability. Currently, this limitation creates an operational dependency on the logistics operator's internal staff to manually provide stock reports (physical stock, forecasted, incoming/outgoing, etc.).

🚀 What it incorporates

This PR introduces the stock_available_portal_owner module, which adds a dedicated and secure portal section for consigned stock. Specifically, it includes:

  • 📦 "My Consigned Stock" Portal Section: A new menu in the customer portal dedicated entirely to consigned inventory.
  • 🔒 Strict Data Isolation: Automatically filters all queries to ensure the authenticated user can only view stock associated with their specific owner_id.
  • 📊 Availability Metrics: Exposes native Odoo and OCA availability metrics (e.g., Physical Stock, Free Stock, Incoming Qty, Outgoing Qty, Forecasted Stock, and Immediately Usable Qty).
  • 🔍 Portal Features: Includes search capabilities (by product name or internal reference), sorting, pagination, and a warehouse filter.
  • ⚙️ Standard Calculation Reuse: Leverages existing Odoo standard calculations and OCA extensions for stock availability, ensuring no parallel calculation logic is introduced in the portal layer.

✨ Benefits

  • 📈 Autonomous Decision-Making: Provides consignees with real-time, self-service visibility to assess whether they need to send new supplies to the logistics operator.
  • ⏱️ Reduced Administrative Overhead: Eliminates the need for internal staff to manually extract and send stock availability information to external owners.
  • 🛡️ Data Security & Privacy: Guarantees that users cannot access stock information belonging to other owners or the operator's private stock.
  • 🧩 Modular & Reusable: Built as a decoupled solution without customer-specific business rules, making it easily reusable for any Odoo implementation managing consignment inventory or third-party logistics (3PL).

@ajfebres
ajfebres marked this pull request as draft August 24, 2026 20:00
@OCA-git-bot OCA-git-bot added series:17.0 mod:stock_available_portal_owner Module stock_available_portal_owner labels Aug 24, 2026
@ajfebres ajfebres changed the title [ADD] stock_available_portal_owner: add module [17.0][ADD] stock_available_portal_owner: add module Aug 24, 2026
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch 3 times, most recently from a14c023 to cca0f34 Compare September 1, 2026 09:15
@ajfebres
ajfebres marked this pull request as ready for review September 1, 2026 09:18
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch 4 times, most recently from c3aa3c9 to 1534b78 Compare September 3, 2026 08:07
@ajfebres
ajfebres marked this pull request as draft September 3, 2026 08:10
@ajfebres
ajfebres marked this pull request as ready for review September 3, 2026 08:11
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch from 1534b78 to ba2b7c3 Compare September 3, 2026 08:15
@ajfebres
ajfebres marked this pull request as draft September 3, 2026 09:19
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch 3 times, most recently from b2f12d1 to 5c1f059 Compare September 10, 2026 09:40
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch 5 times, most recently from 5091c88 to 554c7c2 Compare September 17, 2026 10:52
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch from 554c7c2 to 3593e2a Compare September 21, 2026 17:02
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch 3 times, most recently from e9bc32d to 45c2c3c Compare September 30, 2026 22:12

@jorgeglez1990 jorgeglez1990 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.

LGTM, functional review.

@Daniel-Melian Daniel-Melian 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.

Functionally reviewed, LGTM!

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch 2 times, most recently from 44f0475 to b6b9c7d Compare October 6, 2026 22:20
@ajfebres
ajfebres marked this pull request as ready for review October 7, 2026 06:51
@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch from b6b9c7d to 37df6f0 Compare October 8, 2026 22:34
"version": "17.0.1.0.0",
"category": "Inventory/Inventory",
"website": "https://github.com/OCA/stock-logistics-availability",
"author": "Binhex Systems Solutions S.L., Odoo Community Association (OCA)",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@ajfebres please fix the Author name

@ajfebres ajfebres Oct 23, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@jelenapoblet Ready 👍

@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch from 37df6f0 to 494181c Compare October 23, 2026 06:38
@jelenapoblet

Copy link
Copy Markdown

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 17.0-ocabot-merge-pr-85-by-jelenapoblet-bump-nobump, awaiting test results.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

@jelenapoblet The merge process could not be finalized, because command twine upload --disable-progress-bar --non-interactive --repository-url https://upload.pypi.org/legacy/ -u __token__ odoo_addon_stock_available_portal_owner-17.0.1.0.0.2-py3-none-any.whl failed with output:

Uploading distributions to https://upload.pypi.org/legacy/
Uploading odoo_addon_stock_available_portal_owner-17.0.1.0.0.2-py3-none-any.whl
�[33mWARNING �[0m Error during upload. Retry with the --verbose option for more details. 
�[31mERROR   �[0m HTTPError: 429 Too Many Requests from https://upload.pypi.org/legacy/  
         Too Many Requests                                                      

@jelenapoblet

Copy link
Copy Markdown

@OCA/pypi-support reserve this name please.

cls.env["stock.quant"].sudo().with_company(
company_id
)._update_available_quantity(product, location, qty, owner_id=owner)
return cls.env["stock.quant"].search(

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.

If you want tot be sure to get the proper quant, I'd suggest you to do:

quant = cls.env["stock.quant"].with_context(inventory_mode=True).create({
    "inventory_quantity": qty,
    "location_id": location.id,
    "owner_id": owner.id if owner else False,
})
quant._apply_inventory()
return quant

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks!

)
move._action_confirm()

if create_move_line:

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.

Why creating move_line manually ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The test requires that the line have the exact owner_id specified for the test case (owner_a, owner_b, or none). Automatically generated lines may not reflect that owner, and since the consigned stock portal filters by owner, the test might fail to represent the scenario intended for testing.

@ajfebres
ajfebres force-pushed the 17.0-add-stock-available_portal_owner branch from 494181c to 3ab10bd Compare November 2, 2026 11:31
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.

6 participants