| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Purchase (purchase)
• Invoicing (account) • Discuss (mail) |
| Community Apps Dependencies | Show |
| Lines of code | 5695 |
| Technical Name |
eh_account_intercompany_so_po |
| License | LGPL-3 |
| Website | https://www.erpheritage.com.au/ |
| Versions | 16.0 17.0 18.0 19.0 |
Inter-Company SO/PO Mirroring
Automatically draft matching purchase and sales orders when inter-company partners confirm orders, completing the mirror cycle from invoices to order lines.
Why this module
Inter-Company SO/PO Mirroring
No manual order re-entry
Confirming an order in one company automatically drafts the mirror in the partner company, eliminating duplicate data entry and synchronization delays.
Review before acceptance
Mirror orders land in draft so the receiving company can review lines, pricing, and quantities before confirming, preventing unwanted order commitments.
Order-to-invoice alignment
Extends inter-company automation beyond invoices to include SO and PO, so mirror orders and mirror invoices stay aligned across the trade cycle.
Day in the life
Monday morning: multi-company order sync
Company A sales rep confirms a $50k SO to Company B (a sister entity). The module instantly drafts a PO in Company B with Company A as vendor, matching product, qty, and price. Company B procurement reviews the drafted PO, confirms it aligns with internal demand, and accepts. Later, when the purchase bill posts in Company B, the parent Inter-Company Rules module mirrors it back to a customer invoice in Company A. No manual PO creation, no pricing disputes, full audit trail.
Edge cases
The cases most modules quietly ignore.
In the shipped code today, each one a place where a cheaper module silently does the wrong thing.
A mirror is never mirrored back. If SO A -> PO B is created and then PO B is confirmed, no back-mirror SO is generated; the system detects the eh_ic_origin_so_id flag and skips re-mirroring.
Partners without a Represented Company or whose company matches the order company are skipped; no mirror is drafted, so regular external customers and internal transfers never trigger unintended mirroring.
Lines without a product_id (section headers, service lines with display_type set) are filtered out during line mapping, so only concrete line items with product and quantity transfer to the mirror.
If the destination company has no enabled eh.intercompany.config record, mirroring is silently skipped; the order confirms normally without blocking, so missing config is not an error.
If the inter-company config specifies an intercompany_user_id, the mirror is created with that user's context; otherwise sudo() is used per standard Odoo multi-company patterns.
What is inside
Built to do the job, end to end.
- models/intercompany_order_mixin.py. Shared abstract mixin resolving destination company from partner Represented Company, loading inter-company config, and applying configured user context; reused by both SO and PO so logic stays consistent with invoice-mirroring engine.
- models/sale_order.py. Extends sale.order, adding eh_ic_mirror_po_id and eh_ic_origin_po_id fields; overrides action_confirm() to call _eh_ic_create_mirror_po() which builds draft PO lines and posts confirmation message to source SO chatter.
- models/purchase_order.py. Extends purchase.order, adding eh_ic_mirror_so_id and eh_ic_origin_so_id fields; overrides button_confirm() to call _eh_ic_create_mirror_so() which builds draft SO lines and posts confirmation message to source PO chatter.
- tests/test_so_po_mirror.py. Integration tests validating SO confirm -> PO draft creation, PO confirm -> SO draft creation, no mirroring for non-inter-company partners, and no back-mirroring of mirrors; covers both company contexts and line mapping.
Honest about the edges
What this does not do, so nothing surprises you.
- Requires eh_account_intercompany to be installed; mirrors are only created when a matching enabled inter-company config exists in the destination company.
- Does not auto-confirm mirrored orders; mirrors land in draft state for manual review and confirmation by the receiving company.
- Inter-company user context is applied only if the destination company's inter-company config specifies one; otherwise sudo() is used, so the creator's identity is not preserved in the mirror.
- No tax or analytic distribution mapping; only product, quantity, unit price, and label are transferred. Tax and accounts are determined by the receiving company's standard rules when the mirror is confirmed.
- Line-level discounts on the source order are not mapped; only the final price_unit on each line is transferred.
inter-company sales order, inter-company purchase order, SO to PO automation, multi-company order mirroring, Odoo 16 intercompany, sister company orders, order mirroring automation, draft PO generation, automated intercompany purchasing, Odoo Community intercompany, group accounting orders, cross-company SO PO, intercompany order synchronization
Languages
Available in 19 languages
The interface ships translated out of the box. Switch language in Odoo and the fields, menus, and messages follow.
Modules teams pair with this one.
Premium ERP Heritage modules that extend the same stack, each built to the same engineering bar.
Sync Employment Hero employees, departments and payroll bank details into standard Odoo Community HR over the pla...
Inbound webhook receiver for the Employment Hero people and payroll platform on Odoo 16 Community
Real-time fiscalisation of customer invoices and credit notes with the Mauritius Revenue Authority e-Invoicing (E...
The Canada country pack for the ERP Heritage Employment Hero integration
Please log in to comment on this module