Template Content Swapper

template_content_swapper
REPOSITORY
REPOSITORYOCA/server-ux
GIT
GIThttps://github.com/OCA/server-ux.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-ux/tree/18.0/template_content_swapper
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Quartile
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Quartile
COMMITTERS
COMMITTERSOCA-git-bot, oca-ci, Aungkokolin1997
WEBSITE
WEBSITEhttps://github.com/OCA/server-ux
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:16
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module offers a generic functionality for replacing QWeb view
elements. Typically, element replacements are conducted through a
template using an XPATH replacement by creating a new module. With this
module, users don't need to do this; they simply need to create
template.content.mapping records for the templates they wish to modify.

Examples:

- Replace 'Salesperson' label with 'Sales Representative' in the
  quotation print.
- Replace 'Add to Cart' button with 'Add to Basket' in the eCommerce
  product page.

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_template_content_mapping_search template.content.mapping.search template.content.mapping search New
view_template_content_mapping_tree template.content.mapping.list template.content.mapping list New
Models touched (2)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (6)
  • content_from Char
    help="Set the content (string) to be replaced. e.g. 'Salesperson'." required=True
  • content_to Char
    help="Set your new content (string). e.g. 'Sales Representative'."
  • lang Selection
    default=<expr> help='If no language is selected, the mapping will be applied to all languages.' string='Language' args: _lang_get
  • name Char
    compute='_compute_name' readonly=True store=True
  • report_id Many2one → ir.actions.report
    args: 'ir.actions.report'
  • template_id Many2one → ir.ui.view
    compute='_compute_template_id' domain=[('type', '=', 'qweb')] help='Select the main template of the report / frontend page to be modified.' precompute=True readonly=False required=True store=True args: 'ir.ui.view'
Public methods (1)
  • open_template_mapping(self)
REPOSITORY
REPOSITORYOCA/server-ux
GIT
GIThttps://github.com/OCA/server-ux.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-ux/tree/16.0/template_content_swapper
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Quartile Limited
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Quartile Limited
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Aungkokolin1997
WEBSITE
WEBSITEhttps://github.com/OCA/server-ux
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:54
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_template_content_mapping_search template.content.mapping.search template.content.mapping search New
view_template_content_mapping_tree template.content.mapping.tree template.content.mapping tree New
Models touched (2)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (7)
  • active_lang_count Integer
    compute='_compute_active_lang_count'
  • content_from Char
    help="Set the content (string) to be replaced. e.g. 'Salesperson'." required=True
  • content_to Char
    help="Set your new content (string). e.g. 'Sales Representative'."
  • lang Selection
    default=<expr> help='If no language is selected, the mapping will be applied to all languages.' string='Language' args: _lang_get
  • name Char
    compute='_compute_name' readonly=True store=True
  • report_id Many2one → ir.actions.report
    args: 'ir.actions.report'
  • template_id Many2one → ir.ui.view
    compute='_compute_template_id' domain=[('type', '=', 'qweb')] help='Select the main template of the report / frontend page to be modified.' precompute=True readonly=False required=True store=True args: 'ir.ui.view'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-ux
GIT
GIThttps://github.com/OCA/server-ux.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-ux/tree/15.0/template_content_swapper
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Quartile
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Quartile
COMMITTERS
COMMITTERSOCA-git-bot, oca-ci, Aungkokolin1997
WEBSITE
WEBSITEhttps://github.com/OCA/server-ux
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:39
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
view_template_content_mapping_search template.content.mapping.search template.content.mapping search New
view_template_content_mapping_tree template.content.mapping.tree template.content.mapping tree New
Models touched (2)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (7)
  • active_lang_count Integer
    compute='_compute_active_lang_count'
  • content_from Char
    help="Set the content (string) to be replaced. e.g. 'Salesperson'." required=True
  • content_to Char
    help="Set your new content (string). e.g. 'Sales Representative'."
  • lang Selection
    default=<expr> help='If no language is selected, the mapping will be applied to all languages.' string='Language' args: _lang_get
  • name Char
    compute='_compute_name' readonly=True store=True
  • report_id Many2one → ir.actions.report
    args: 'ir.actions.report'
  • template_id Many2one → ir.ui.view
    domain=[('type', '=', 'qweb')] help='Select the main template of the report / frontend page to be modified.' required=True args: 'ir.ui.view'
Public methods (0)

No public methods.

STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-ux
PULL REQUEST
PULL REQUEST[17.0][MIG] template_content_swapper: Migration to 17.0 (#1140)
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-ux
PULL REQUEST
PULL REQUEST[19.0][MIG] template_content_swapper: Migration to 19.0 (#1166)