Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
506 Visualizações

In the Documents Odoo 18 entreprise module, the 'My Drive' and 'Company' sections are of interest in this post. Only one company is present in the system.

The goal is our custom Odoo module to create a folder named 'Lovelace' in the 'Company' section. 

To be able to be created and visible in the 'Company' section, the specific values shall be set to the specific fields below:

  • 'folder_id': False
  • 'company_id': False
  • 'owner_id': 1
  • 'access_internal':'edit|view'

Thus the request would be

        project_folder = self.env['documents.document'].sudo().search([
                ('name', '=', 'Lovelace'),
                ('folder_id', '=', False),
                ('type', '=', 'folder'),
                ('company_id', '=', False),
                ('owner_id', '=', 1),
            ], limit=1)
        if not project_folder:
            project_folder = self.env['documents.document'].sudo().create({
                    'name': 'Lovelace',
                    'folder_id': False,
                    'type':'folder',
                    'company_id': False,
                    'owner_id': 1,
                    'access_internal': 'edit',
                })


Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
jun. 25
1392
1
mai. 25
1692
0
jul. 24
1020
3
ago. 24
7125
0
fev. 20
3107