fix: resolve missing item, tax account and payment schedule in PEPPOL parser#38
Merged
pritambiswal merged 1 commit intoprilk-consulting:developfrom Feb 13, 2026
Conversation
… parser Three issues preventing Purchase Invoice creation from incoming EDocuments: 1. Items not matched by name: when no matching_data, buyer_item_id or seller_product_id match exists, try matching by item_name (exact match on Item doctype). Without item_code, set_missing_item_details skips the item and expense_account is never resolved. 2. Tax account_head left empty: the tax guessing stub was a no-op. Now looks up account_head from existing Purchase Taxes templates matching the rate and company. 3. Payment schedule entry with only due_date (no payment_amount) caused a TypeError in set_payment_schedule. Don't create a default entry; let ERPNext compute it from payment_terms_template.
102ca1f to
9562017
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When creating a Purchase Invoice from an incoming EDocument without
matching_data, three issues prevent successful document creation:item_codestays None. ERPNext'sset_missing_item_details()skips items withoutitem_code, so the expense account from Item Defaults is never loaded → "Compte de charge est obligatoire pour l'article X"guess_missing_valueswas a no-op stub (pass). Missingaccount_headanddescriptionare mandatory fields on the taxes child tablePayment Scheduleentry was created with onlydue_dateand nopayment_amount, causing aTypeErrorin ERPNext'sset_payment_schedule()Changes
Item name matching (
guess_missing_values): after seller_product_id lookup fails, try matching byitem_nameas a last resort (exact match on Item doctype name, then byitem_namefield).Tax account lookup (
guess_missing_values): queryPurchase Taxes and Charges Templaterows matching the tax rate and company to resolveaccount_head. Set a defaultdescriptionwhen missing.Payment schedule (
parse_peppol_payment_terms): don't create a default entry with onlydue_date. ERPNext will compute the schedule from thepayment_terms_template(resolved via supplier defaults byset_missing_values).Test plan