[15.0][IMP] document_page: copy document function.

This commit is contained in:
angel
2022-06-13 14:59:05 +02:00
committed by FernandoRomera
parent 61e5c86251
commit 478b735975
2 changed files with 18 additions and 0 deletions

View File

@@ -180,3 +180,13 @@ class DocumentPage(models.Model):
res = super().unlink()
menus.unlink()
return res
def copy(self, default=None):
default = dict(
default or {},
name=_("%s (copy)") % self.name,
content=self.content,
draft_name="1.0",
draft_summary=_("summary"),
)
return super(DocumentPage, self).copy(default=default)