Skip to content

[Main]-Bin content Block Movement does not prevent outbound posting for negative adjustments and sales orders#9333

Open
DeepsShukla wants to merge 2 commits into
mainfrom
bugs/Bug-639575-Bin-content-Block-Movement-does-not-prevent-outbound-posting-error
Open

[Main]-Bin content Block Movement does not prevent outbound posting for negative adjustments and sales orders#9333
DeepsShukla wants to merge 2 commits into
mainfrom
bugs/Bug-639575-Bin-content-Block-Movement-does-not-prevent-outbound-posting-error

Conversation

@DeepsShukla

@DeepsShukla DeepsShukla commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Workitem Bug 639575: [All-E] Bin content Block Movement does not prevent outbound posting for negative adjustments and sales orders
Fixes AB#639575

@DeepsShukla
DeepsShukla requested a review from a team July 13, 2026 06:23
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 13, 2026
Comment thread src/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al Outdated
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 5 · Outcome: completed

All 16 sub-skills ran to completion; no domain flagged a violation. The self-review pass found no cross-cutting defect clearing the agent-finding precision bar.

Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf

Orchestrator pre-filter (2 file(s) excluded)

  • layer-disabled (knowledge) : 2 file(s)

Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives.

v-ankitgoyal
v-ankitgoyal previously approved these changes Jul 13, 2026
@DeepsShukla DeepsShukla added SCM GitHub request for SCM area and removed SCM GitHub request for SCM area labels Jul 13, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Accept with Suggestions

What this PR does

This PR blocks outbound postings from a Bin Content when Block Movement is Outbound or All. It does this for non-directed bin-mandatory item journal decreases, and it adds the same warehouse journal validation before sales warehouse journal lines are posted.

For the linked repro, the fix addresses the root cause. The new check runs before WhseJnlPostLine.Run, so the blocked warehouse entry is not posted. The new tests cover both Outbound and All for negative adjustments and sales shipments. No public event or API signature is changed.

Suggestions

S1 - Check the purchase return path
The same outbound movement can happen through purchase return shipment, but PurchPost.PostItemJnlLineWhseLine still posts the warehouse journal line without WMSMgt.CheckWhseJnlLine. If purchase returns must obey Bin Content Block Movement, add the same validation there or document why that document type is outside this bug.

S2 - Add an inbound control test
The new tests cover the blocked paths. Please also add a small control check that Block Movement = Outbound still allows an inbound positive adjustment, so the new decrease check cannot accidentally block inbound movement later.

Risk assessment and necessity

Risk: The risk is in warehouse posting. WMS Management is a shared codeunit, so the new decrease check can affect item-journal-source outbound flows that already call CheckWhseJnlLine. The sales change also adds a new validation point before posting warehouse journal lines in the Sales-Post copies. This is the right place for the linked sales scenario, but it can block postings that previously bypassed this rule.

Necessity: The bug is valid and important. Without this change, a bin content marked as blocked for outbound movement can still be depleted by negative adjustments and sales shipments. The scope is mostly right for the linked repro, and the tests cover the main reported cases.


[AI-PR-REVIEW] version=1 system=github pr=9333 round=1 by=alexei-dobriansky at=2026-07-13T17:05:45Z lastSha=0197474a2f3feddadde0c7592376b8ba581846ac suggestions=S1,S2

@DeepsShukla DeepsShukla reopened this Jul 16, 2026

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

S1: The new unconditional WMSMgt.CheckWhseJnlLine(...) call in PostItemJnlLineWhseLine breaks sales posting when the temporary warehouse journal line has no location. CheckWhseJnlLine immediately requires Location Code, and the current CI failures reproduce this broadly across localizations with Location Code must have a value in Warehouse Journal Line, with the stack pointing to the added call.

Please guard this validation so it only runs for the bin/location scenario it is intended to protect, and add a regression test covering sales posting without a location. The targeted blocked-bin tests cover the bug scenario but not this newly broken path.

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

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants