Skip to content

Fork Sync Branch 18.0 - #12

Merged
btl-bot merged 1 commit into
BTLzdravtech:18.0from
ingadhoc:18.0
Aug 6, 2026
Merged

btl-bot merged 1 commit into
BTLzdravtech:18.0from
ingadhoc:18.0

Conversation

@btl-bot

@btl-bot btl-bot commented Aug 6, 2026

Copy link
Copy Markdown

No description provided.

…rchase matching

The 'Match purchase lines' button filtered candidate POLs with
product_qty > qty_invoiced, which does not account for returns:
product_qty (ordered) does not drop with a return, so a fully invoiced
line with a pending credit (qty_to_invoice < 0) was hidden and the
refund could not be created.

Filtering now uses qty_to_invoice depending on the move type: on a bill
(in_invoice) lines still to invoice (> 0), and on a credit note
(in_refund) lines with a pending refund from a return (< 0).

The comparison uses float_compare with the 'Product Unit of Measure'
decimal precision instead of each line's product_uom.rounding, since the
candidate set can include lines without a UoM (e.g. section/note lines),
whose rounding is 0.0 and made float_compare raise
'precision_rounding must be positive, got 0.0'.

closes #351

Signed-off-by: rov-adhoc <rov@adhoc.com.ar>

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

Auto approved

@btl-bot
btl-bot merged commit 845fd78 into BTLzdravtech:18.0 Aug 6, 2026
1 check passed
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.

3 participants