Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries ⟶
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    • Affiliate Program
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Extra Tools
  3. Partner Merge in Bulk v 20.0
  4. Sales Conditions FAQ

Partner Merge in Bulk

by Terrabit https://www.terrabit.ro
Odoo
v 20.0 Third Party 10
Download for v 20.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Versions 19.0 20.0
You bought this module and need support? Click here!
Versions 19.0 20.0
  • Description
  • Manifest
  • License
Partner Merge in Bulk

Partner Merge in Bulk

Merge duplicates by VAT number, in bulk

Odoo 20.0 Tools Odoo.sh • On-premise OPL-1
✓ 23 automated tests
★ Did this module help you? It is free, built and maintained by the Terrabit developers. If it saved you time, a rating on this page is the best way to say thanks — and it helps other Odoo users find it too. Thank you for your support!
★ Leave a rating ↓
  • Overview
  • Versions
Overview

Merges partner records that share the same VAT number, in bulk.

Odoo's own merge wizard walks the foreign keys group by group: for every pair it goes through all ~158 columns that reference res_partner. Fine for a handful of duplicates; for thousands of groups it means hundreds of thousands of statements and does not finish in any reasonable window.

This module inverts the loops — one statement per column for the whole batch — and keeps foreign keys enabled throughout, so integrity is guaranteed by PostgreSQL rather than by the procedure being right. On a production database of 538.000 partners, merging 5.350 records took about four and a half minutes.

Merge batches. Settings > Partner Merge > Merge Batches. A batch goes through Analyze, Simulate, Apply and, once applied, Verify. You choose the categories of groups that enter the batch, how many groups (Group Limit, 0 for all) and whether the absorbed records are deleted or archived (Archive instead of delete). The Groups tab lists each group with the kept record, the absorbed ones and their names; Report holds the simulation or merge report, and All groups by category the full classification. Partners are grouped by VAT number and company, so partners of different companies are never merged together.

Safety. The simulation is not a flag you can forget: it runs the whole merge inside a savepoint and rolls it back, so it cannot write even if something is wrong. Applying is a distinct step, reserved to the Partner Merge / Apply group (system administrators have it), checks that every partner of the batch is in your companies and that you may change or delete it, and refuses to finish if any reference is left pointing at an absorbed record. Partner Merge / Prepare and simulate can analyze and simulate, but not apply. Verify compares the result with the figures taken at the analysis: invoices, sales orders and unreconciled balance per kept record.

What it does not touch by itself. Groups are classified A (one record holds the documents, the rest are empty), B (documents on a single record), C (invoices spread over several records) and D (unreconciled balance on several records). A batch takes A and B by default; C and D move figures between ledgers and belong with the accountant. Also left out: groups holding your own company record, groups with portal users on more than one record, and groups whose names differ completely on the same VAT number.

Kept record. Chosen by document volume — most invoices, then most sales orders, then oldest. Since that is not the same as name quality, the surviving record is flagged when its name looks mangled at import, with the names of the absorbed records alongside for correction.

Indexes. When foreign-key columns towards partners have no index, the batch shows a warning and a Create the indexes button, because deleting partners would otherwise scan those tables for each record.

The same procedure also exists as stand-alone SQL scripts, for when it has to be run outside Odoo by the database administrator. They are kept in the source repository of the suite (scripts/partner_merge/) and are not part of the module package downloaded from Odoo Apps.

Finding duplicates beyond the VAT number. Settings > Partner Merge > Find Duplicates looks for partners that are probably the same record, typically individuals created twice by an import or an online order, and leaves the decision to you, group by group. It does not change any partner.

  • Exact matches on the VAT number (without the country prefix), the phone (E.164, so 0722 … and +40 722 … meet), and the email (lowercase).
  • Similar names (without diacritics or legal forms, words sorted) at the same street or postcode, or similar names alone if you choose so. Names are compared only inside a block (same city, or same first letters), so large databases are not compared all against all.
  • Each group shows its score and the reason ("same phone +40722…", "name 92% + same street"). Merge opens the standard Odoo merge wizard on the group, where you choose the record to keep. Not duplicates remembers the pair, so later scans skip it.
  • Left out: partners of internal users and of your companies, a partner and its own contacts, invoice and delivery addresses of the same customer, partners of different companies, and values shared by too many partners (placeholders, switchboards), which are listed in the report.

The name comparison uses rapidfuzz when it is installed on the server. Without it, the scan falls back to Python's difflib, which is slower and only compares blocks of up to 1,500 partners; the larger blocks are listed in the report. phonenumbers and unidecode are used the same way, if present. None of them is required.

Versions

20.0.1.2.1 (2026-11-27)

  • Migration to Odoo 20.
  • Merge in Bulk takes only the parent companies as candidates: on Odoo 20 the contacts of a Romanian company carry its VAT number and, with l10n_ro_edi, are also flagged as companies, so they would have been merged into (and deleted with) their own company.
  • Find Duplicates with Individuals only keeps the contacts of companies among the persons.
  • The candidates no longer read company_registry, removed from the partner in Odoo 20.
  • Create indexes quotes the table and column names (a table name with capitals or special characters broke the command).
  • Merge in Bulk: the table and column names taken from the PostgreSQL catalog are quoted in all the generated statements (remap, deduplication, filling of empty fields).
  • Consultant sheet completed against the code: access rights and menu, company scope, index creation after the analysis, filling of empty fields, Back to draft on scans and batches, the error messages of the batch.

19.0.1.2.1 (2026-11-03)

  • Description: the stand-alone SQL scripts are kept in the source repository of the suite and are not part of the module package from Odoo Apps (the text pointed to them as if they shipped with it).
  • Description: the simulation runs inside a rolled-back savepoint, not a separate transaction.
  • Description: added the menus (Settings > Partner Merge), the batch steps and options, the two access groups, the A–D categories and the index warning.

19.0.1.2.0 (2026-10-23)

  • Find Duplicates uses the shared rules of deltatech_partner_match (new dependency, installed automatically: functions only, no data or behavior of its own) instead of its own copy, so a partner is recognized here the same way as in the marketplace import and the trial balance import. Checked on a database of 551,000 partners against the previous rules:
    • phone and email keys: identical;
    • VAT: the leading zeros are dropped (RO0733329058 = 733329058); 42 codes change, all phone numbers typed in the VAT field, and the number of VAT groups stays the same;
    • names: the legal forms KFT, SARL, s.r.o., SPRL and CMI are dropped too (6,294 names), so "Vario KFT" and "Vario" get the same key;
    • a phone that is not recognized as a valid number is still compared on its last nine digits, as before.

19.0.1.1.0 (2026-10-23)

  • Add: Find Duplicates, a scan for partners that are probably duplicated, on the VAT number, the phone (E.164), the email, and similar names at the same street or postcode. Results are kept as groups with a score and a reason; each group is merged with the standard Odoo merge wizard after you confirm it, or marked as not duplicates so later scans skip it. Partners of internal users and of the companies are left out. The name comparison uses rapidfuzz if it is installed, otherwise difflib on limited blocks; no new required dependency.
  • Romanian translation (i18n/ro.po) for the whole module.
  • Consultant sheet (readme/FISA_CONSULTANT.md) for finding and merging duplicates, with screenshots generated by tests/test_screenshots.py.

19.0.1.0.5 (2026-10-17)

  • MERGE-002: Verify on an applied batch checked the working tables of the latest analyzed batch, so after another batch was analyzed it reported the masters, totals and remaining records of that other batch. The snapshot taken at the analysis (expected invoices, sales orders and unreconciled balance per kept record) is now stored on the batch lines, and Verify compares against it and against the batch's own absorbed records. Batches analyzed before this version have no stored snapshot and Verify refuses them with a message instead of showing another batch's figures.
  • MERGE-003: the stand-alone SQL scripts in deltatech/scripts/partner_merge/ grouped partners by VAT alone, so a manual run on a multi-company database merged partners of different companies into one master. 02_build_map.sql now groups and chooses the master per (VAT, company), with shared partners (no company) in groups of their own, as the module does; the progress count in 04_verify.sql uses the same grouping.

19.0.1.0.4 (2026-10-09)

  • Apps Store banner (banner.json).

19.0.1.0.3 (2026-10-03)

  • MERGE-001 (security): the analysis read the partners of all companies and grouped them by VAT alone, and Apply rewrote and deleted them without any company or access check, so an operator limited to one company could merge or delete partners of other companies, and partners kept separately per company were merged into a partner of another company. Now:
    • a group is (VAT, company): partners of different companies are never merged together; the batch lines show the company;
    • the analysis only takes the partners of the selected companies; shared partners (no company) are taken only for system administrators and users with access to every company;
    • Apply refuses a batch with partners outside the user's companies or groups mixing companies, and requires write access (and delete access, unless Archive instead of delete) on the partners.
  • Behavior change: operators without access to every company no longer see groups of shared partners, and same-VAT partners of different companies are no longer proposed for merging. The SQL scripts in deltatech/scripts/partner_merge/ are unchanged (database-wide, run by the DBA).

19.0.1.0.2 (2026-09-29)

  • Own module icon, instead of the generic gears it had.

19.0.1.0.1 (2026-09-23)

  • The merge simulation rolls back its savepoint through contextlib.suppress(_Rollback) instead of except _Rollback: pass; behavior is unchanged.

19.0.1.0.0 (2026-08-18)

  • Add: bulk merge of partners duplicated on the same VAT number, with classification, guards, simulation on a rolled-back transaction, and verification against a snapshot taken before the merge. Wraps the SQL procedure from deltatech/scripts/partner_merge/, validated on a client's staging database (575 records merged in three batches, zero discrepancies on invoices, orders, deliveries and unreconciled balance).
800+
Modules published on Odoo Apps
Odoo
Silver PartnerImplementation & Support

Need help getting started?

Our 800+ apps on the Odoo Apps Store are used in Odoo implementations across Europe, the Americas, Asia and Africa — by companies we have never even met. That is the advantage of building modules that simply work.

Questions about this module? Write to us — the developers who build it will answer.

Terrabit support →

More apps by Terrabit

Other modules from the same publisher, built to work together. All apps →

DE Deltatech Tools

Shared base for the Deltatech suite: common technical extensions used by all modules

MF Markdown Field Widget Tools

WYSIWYG markdown widget storing raw Markdown in a Text field

NQ No Quick Create Tools

Disable quick create in many2one fields; data-only, importable on Odoo Online

NS Notification Sound Tools

Play a different sound for success, warning, error and info notifications

RR Restrict Reports Access Tools

Restrict Sales Analysis and Invoice Analysis reports by group: own records, all records, or no access.

TS Test System Indicator Tools

Set system status: test or production

WA Watermark Tools

Watermark field

AE Accounting Extensions Accounting & Finance

Extra invoice views, journal options and an Anglo-Saxon cost recognition setting

Availability
Odoo Online
Odoo.sh
On Premise
Community Apps Dependencies Show
Partner Match
Lines of code 1468
Technical Name deltatech_partner_merge
LicenseOPL-1
Websitehttps://www.terrabit.ro
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with