-
- Downloads
[FIX] base: preserve context when duplicating a record
Keep the original context after duplication
This is a partial fix for this issue raised at opw-2868550
To reproduce:
- activate 2 languages (e.g. es_ES and en_US)
- set es_ES as default language
- edit an existing page (e.g. contactus) in the default language
- change a small detail (e.g. field label in form)
- save
When writing for the first time on a website page from the editor,
with the website creates a new page using copy
The copy removed the language on the record when creating the new
record but did not reset it.
>>> self.env.context
{'lang': 'es_ES'}
>>> copy = self.copy()
>>> copy.env.context
{'lang': None}
Not having the right language is an issue as the code following the
copy call bypass the translation system with a lang=None
This patch is only the server part.
The language still needs to be propagated in the context from the
editor.
closes odoo/odoo#100308
Signed-off-by:
Martin Trigaux (mat) <mat@odoo.com>
Loading
Please register or sign in to comment