[FIX] web: reference field calls name_create
An older commit (50bf8309) had refactor part of the basic field _applyX2ManyOperations.
During this refactor, the reference field was forgotten to be included
in a condition that made the field no longer do the quick create behavior.
The name_create function in the backend was no longer called.
Adds a test for the reference field checking the call to the name_create
function and fixes the problem.
Task id 2322048
closes odoo/odoo#59044
X-original-commit: 1400b0b9f46a86254c166b422a0b23ed3b3c7a24
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -1583,7 +1583,8 @@ var BasicModel = AbstractModel.extend({
|
||||
|
||||
const field = record.fields[fieldName];
|
||||
const coModel = field.type === 'reference' ? data.model : field.relation;
|
||||
if (field.type === 'many2one' && !data.id && data.display_name) {
|
||||
const allowedTypes = ['many2one', 'reference'];
|
||||
if (allowedTypes.includes(field.type) && !data.id && data.display_name) {
|
||||
// only display_name given -> do a name_create
|
||||
const result = await this._rpc({
|
||||
model: coModel,
|
||||
|
||||
Reference in New Issue
Block a user