Repository
OCA/edi · module folder · Try on Runboat
Module version
1.0.0
Category
Uncategorized
Folder size
0.14 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/edi
Last tracking update
2026-08-07 08:09:21
Authors
ACSONE SA/NV, Odoo Community Association (OCA)
Maintainers
ACSONE SA/NV, Odoo Community Association (OCA)
Committers
Weblate, OCA-git-bot, oca-ci, Souheil Bejaoui
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
account_edi_ubl_cii_purchase_match_product_packaging
Description
This module extends the UBL vendor bill import process to improve how vendor
bill lines are linked to purchase order lines.

Instead of replacing the imported UBL lines with the purchase order lines
(standard behavior), this module:

1. **Reads the OrderReference** in the UBL document.
2. **Identifies the corresponding Purchase Order** using the vendor reference
(`partner_ref`) or the purchase order ref.
3. **Matches each UBL line** with a purchase order line based on:
   - product name,
   - supplier product name

4. **Links the vendor bill line** to the matched PO line
5. When a user manually selects a purchase order line from the bill:
   - the system stores the supplier product name,
   - future imports will auto-match using that supplier information.

This ensures accurate line-level linking while preserving the supplier’s
invoice data.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
account_move_form_view account.move form Inherits account.view_move_form
account_move_line_select_purchase_line_wizard_form_view account.move.line.select.purchase.line.wizard form New
purchase_order_line_form_view purchase.order.line form Inherits purchase.purchase_order_line_form2
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (4)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (2)
  • purchase_mismatch Boolean
    compute='_compute_purchase_mismatch' help='Checked when this invoice has at least one line that does not fully match its related purchase order line.'
  • purchase_mismatch_details Text
    compute='_compute_purchase_mismatch' help='Human-readable description of the differences between invoice lines and their related purchase order lines.'
Public methods (0)

No public methods.

New fields (3)
  • purchase_line_mismatch Boolean
    compute='_compute_purchase_line_mismatch' help='Checked when this invoice line does not fully match its related purchase order line.'
  • purchase_line_mismatch_details Text
    compute='_compute_purchase_line_mismatch' help='Human-readable description of the differences between this invoice line and the related purchase order line.'
  • supplier_product_code Char
    readonly=True
Public methods (2)
  • action_select_purchase_line(self)
  • action_show_purchase_line(self)

New fields (16)
  • currency_id Many2one
    related='move_line_id.currency_id'
  • description Char
    related='move_line_id.name'
  • move_line_id Many2one → account.move.line
    comodel_name='account.move.line' readonly=True required=True
  • move_line_price_subtotal Monetary
    related='move_line_id.price_subtotal' string='Move line Subtotal'
  • move_line_price_unit Float
    related='move_line_id.price_unit' string='Move line Unit Price'
  • move_line_quantity Float
    related='move_line_id.quantity'
  • partner_id Many2one → res.partner
    comodel_name='res.partner' readonly=True
  • po_line_price_subtotal Monetary
    related='purchase_order_line_id.price_subtotal' string='PO line Subtotal'
  • po_line_price_unit Float
    related='purchase_order_line_id.price_unit' string='PO line Unit Price'
  • po_line_product_uom_qty Float
    related='purchase_order_line_id.product_uom_qty' string='Ordered Qty'
  • po_line_qty_invoiced Float
    related='purchase_order_line_id.qty_invoiced'
  • po_line_qty_received Float
    related='purchase_order_line_id.qty_received'
  • product_domain Binary
    compute='_compute_product_domain'
  • product_id Many2one → product.product
    comodel_name='product.product' domain='product_domain'
  • purchase_order_ids Many2many → purchase.order
    comodel_name='purchase.order' domain="[('partner_id', '=', partner_id), ('state', 'in', ('purchase', 'done'))]" relation='account_move_line_purchase_match_wizard_rel'
  • purchase_order_line_id Many2one → purchase.order.line
    comodel_name='purchase.order.line' compute='_compute_purchase_order_line_id' domain="[('order_id', 'in', purchase_order_ids), ('product_id', '=', product_id)]" readonly=False store=True string='Line'
Public methods (1)
  • select_purchase_line(self)