odoo_translate_field
Write translations for simple Odoo fields with translate=True. Supports multiple languages, clearing translations, and dry-run validation.
Instructions
Write translations for a simple translate=True field (Char/Text/Selection). Use for: blog.post.name/subtitle/teaser, product.template.name, res.partner.name, account.account.tag.name — any short/plain field. Format: translations = {lang_code: value, ...}. Pass value=null/'' to remove a language's translation (falls back to source_lang). Errors if field.translate is not True (use odoo_translate_html for HTML). Auto-detects Odoo version: v16+ uses update_field_translations() native API, older falls back to ir.translation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | default | |
| model | Yes | ||
| res_id | Yes | ||
| field_name | Yes | ||
| translations | Yes | Map of language code to new value: {'en_US': 'Name', 'bg_BG': 'Име', 'de_DE': 'Name'}. Supports null/empty to clear. | |
| source_lang | No | Source language for fallback (default 'en_US') | en_US |
| dry_run | No | If true, only validates and reports what would change without writing | |
| mark_identical_as_translated | No | When True (default), a value that equals the source gets a U+200B (zero-width-space) prefix so Odoo keeps it as an explicit 'translated, kept identical' entry (avoids the 'untranslated' flag in the website editor). |