parameters: (self, page_id, page_name=None, clone_menu=True)
return_statement: return new_page.url + '?enable_editor=1'
docstring: Clone a page, given its identifier
              :param page_id : website.page identifier
docstring_summary: Clone a page, given its identifier
              :param page_id : website.page identifier
docstring_tokens: Clone a page given its identifier : param page_id : website . page identifier
function: def clone_page(self, page_id, page_name=None, clone_menu=True):
          """ Clone a page, given its identifier
              :param page_id : website.page identifier
          """
          page = self.browse(int(page_id))
          copy_param = dict(name=page_name or page.name, website_id=self.env['website'].get_current_website().id)
          if page_name:
              page_url = '/' + slugify(page_name, max_length=1024, path=True)
              copy_param['url'] = self.env['website'].get_unique_path(page_url)
  
          new_page = page.copy(copy_param)
          # Should not clone menu if the page was cloned from one website to another
          # Eg: Cloning a generic page (no website) will create a page with a website, we can't clone menu (not same container)
          if clone_menu and new_page.website_id == page.website_id:
              menu = self.env['website.menu'].search([('page_id', '=', page_id)], limit=1)
              if menu:
                  # If the page being cloned has a menu, clone it too
                  menu.copy({'url': new_page.url, 'name': new_page.name, 'page_id': new_page.id})
  
          return new_page.url + '?enable_editor=1'
function_tokens: def clone_page ( self , page_id , page_name = None , clone_menu = True ) : page = self . browse ( int ( page_id ) ) copy_param = dict ( name = page_name or page . name , website_id = self . env [ 'website' ] . get_current_website ( ) . id ) if page_name : page_url = '/' + slugify ( page_name , max_length = 1024 , path = True ) copy_param [ 'url' ] = self . env [ 'website' ] . get_unique_path ( page_url ) new_page = page . copy ( copy_param ) # Should not clone menu if the page was cloned from one website to another # Eg: Cloning a generic page (no website) will create a page with a website, we can't clone menu (not same container) if clone_menu and new_page . website_id == page . website_id : menu = self . env [ 'website.menu' ] . search ( [ ( 'page_id' , '=' , page_id ) ] , limit = 1 ) if menu : # If the page being cloned has a menu, clone it too menu . copy ( { 'url' : new_page . url , 'name' : new_page . name , 'page_id' : new_page . id } ) return new_page . url + '?enable_editor=1'