MCPcopy
hub / github.com/odoo/odoo / copy

Method copy

odoo/orm/models.py:5530–5542  ·  view source on GitHub ↗

Duplicate record ``self`` updating it with default values. :param default: dictionary of field values to override in the original values of the copied record, e.g: ``{'field_name': overridden_value, ...}`` :returns: new records

(self, default: ValuesType | None = None)

Source from the content-addressed store, hash-verified

5528 new.update_field_translations(name, translations)
5529
5530 def copy(self, default: ValuesType | None = None) -> Self:
5531 """ Duplicate record ``self`` updating it with default values.
5532
5533 :param default: dictionary of field values to override in the
5534 original values of the copied record, e.g: ``{'field_name': overridden_value, ...}``
5535 :returns: new records
5536
5537 """
5538 vals_list = self.with_context(active_test=False).copy_data(default)
5539 new_records = self.create(vals_list)
5540 for old_record, new_record in zip(self, new_records):
5541 old_record.copy_translations(new_record, excluded=default or ())
5542 return new_records
5543
5544 @api.private
5545 def exists(self) -> Self:

Callers 8

_gen_fileFunction · 0.45
gen_deb_packageFunction · 0.45
build_imageMethod · 0.45
gen_rpm_repoMethod · 0.45
build_imageMethod · 0.45
rerouteMethod · 0.45
__call__Method · 0.45
copy_dataMethod · 0.45

Calls 5

with_contextMethod · 0.95
createMethod · 0.95
zipFunction · 0.85
copy_dataMethod · 0.45
copy_translationsMethod · 0.45

Tested by

no test coverage detected