Skip to Content
Menú
This question has been flagged
570 Vistes

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
Descartar
Related Posts Respostes Vistes Activitat
1
de juny 25
1490
1
de maig 25
1782
0
de jul. 24
1053
3
d’ag. 24
7216
0
de febr. 20
3184