Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14c - DMS uninstall/install error #189

Closed
kimasplund opened this issue Jul 4, 2022 · 14 comments
Closed

14c - DMS uninstall/install error #189

kimasplund opened this issue Jul 4, 2022 · 14 comments
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.

Comments

@kimasplund
Copy link

kimasplund commented Jul 4, 2022

So as to my previous error reported here i tried to uninstall and reinstall.
Uninstall went ok but then installing it back produces the following error:

Validation Error
A directory has to have a parent directory.

And then installation fails.

log
2022-07-04 09:01:50,264 311315 INFO xxx.fi odoo.addons.mail.models.mail_alias_mixin: Mail alias created for dms.directory Coolsculpting (id 2)
2022-07-04 09:01:50,267 311315 INFO xxx.fi odoo.addons.mail.models.mail_alias_mixin: Mail alias created for dms.directory Fillers & Botox (id 6)
2022-07-04 09:01:50,269 311315 INFO xxx.fi odoo.addons.mail.models.mail_alias_mixin: Mail alias created for dms.directory IPL (id 4)
2022-07-04 09:01:50,271 311315 INFO xxx.fi odoo.addons.mail.models.mail_alias_mixin: Mail alias created for dms.directory Kundformulär (id 1)
2022-07-04 09:01:50,273 311315 INFO xxx.fi odoo.addons.mail.models.mail_alias_mixin: Mail alias created for dms.directory Kundformulär / Needlepen (id 9)
2022-07-04 09:01:50,274 311315 INFO xxx.fi odoo.addons.mail.models.mail_alias_mixin: Mail alias created for dms.directory Kundformulär / Vi Peel (id 8)
2022-07-04 09:01:50,276 311315 INFO xxx.fi odoo.addons.mail.models.mail_alias_mixin: Mail alias created for dms.directory Tandblekning (id 7)
2022-07-04 09:01:50,279 311315 ERROR xxx.fi odoo.schema: Table 'dms_directory': unable to set NOT NULL on column 'name'
2022-07-04 09:01:50,280 311315 INFO xxx.fi odoo.models: Storing computed values of dms.directory.storage_id
2022-07-04 09:01:50,281 311315 INFO xxx.fi odoo.models: Storing computed values of dms.directory.parent_id
2022-07-04 09:01:50,281 311315 INFO xxx.fi odoo.models: Storing computed values of dms.directory.tag_ids
2022-07-04 09:01:50,281 311315 INFO xxx.fi odoo.models: Storing computed values of dms.directory.model_id
2022-07-04 09:01:50,281 311315 INFO xxx.fi odoo.models: Storing computed values of dms.directory.storage_id_inherit_access_from_parent_record
2022-07-04 09:01:50,281 311315 INFO xxx.fi odoo.models: Storing computed values of dms.directory.is_hidden
2022-07-04 09:01:50,281 311315 INFO xxx.fi odoo.models: Storing computed values of dms.directory.company_id
2022-07-04 09:01:50,282 311315 ERROR xxx.fi odoo.schema: Table 'dms_file': unable to set NOT NULL on column 'directory_id'
2022-07-04 09:01:50,284 311315 INFO xxx.fi odoo.models: Storing computed values of dms.file.storage_id
2022-07-04 09:01:50,284 311315 INFO xxx.fi odoo.models: Storing computed values of dms.file.extension
2022-07-04 09:01:50,284 311315 INFO xxx.fi odoo.models: Storing computed values of dms.file.mimetype
2022-07-04 09:01:50,284 311315 INFO xxx.fi odoo.models: Storing computed values of dms.file.require_migration
2022-07-04 09:01:50,284 311315 INFO xxx.fi odoo.models: Storing computed values of dms.file.is_hidden
2022-07-04 09:01:50,284 311315 INFO xxx.fi odoo.models: Storing computed values of dms.file.company_id
2022-07-04 09:01:50,516 311315 INFO xxx.fi odoo.schema: Keep unexpected index mail_message_subtype_id_index on table mail_message_subtype

@kimasplund kimasplund added the bug label Jul 4, 2022
@victoralmau
Copy link
Member

Hi,

Can you indicate a list of steps to reproduce it in runboat please? Another option could be to add a video here explaining the error and how to get it.

A greeting.

@Home-Based
Copy link

Hi all,

I'm following the same path as Kimasplund... As DMS didn't work as expected (see issue 187 - #187), I tried to uninstall DMS and DMS_field. No issue or error message during uninstallation process.

But re-installation leads to the same error as Kismaplund : "a directory has to have a parent directory."

See screen video in Att.

Impossible to describe steps to reproduce : this appends on the odoo we manage, Odoo CE 14 (Odoo 14.0-20220419 (Community Edition)) in my case. Maybe do we have some other module installed or parameter activated that prevents DMS to work properly ?

Best regards,

SA

Odoo.-.DMS.error.mov

@Sabeel84
Copy link

Sabeel84 commented Sep 7, 2022

We also have the same issue, waiting for a proper answer, happens to be after uninstalling and installing again.

@Puhlik77
Copy link

Same happens to me...

@victoralmau
Copy link
Member

Please explain the exact steps to reproduce the error (I can't reproduce it).
ejemplo

@daerisadmin
Copy link

Buenos días,
Los pasos para reproducir el error son los de instalar por primera vez el modulo dms y añadir anexos asociados a alguna entidad, como por ejemplo res.partner.
Al desinstalar el módulo se puede observar como las tablas dms.directory y dms.file no se borran y que aquellos registros que hemos creado en nuestras pruebas, continúan en la base de datos, aunque han perdido algunos campos como el parent_id.
Cuando volvemos a instalar el módulo, salta la validación de _check_directory_parent indicando que un registro no dispone de el correspondiente parent_id e impide la instalación.
La solución mas simple y sucia es la de realizar un truncate a las tablas dms.directory y dms.file aunque la opción correcta sería que se hiciera durante la desinstalación del módulo.


Good morning,
The steps to reproduce the error are to install the module for the first time and add attachments associated with some entity, such as res.partner.
When uninstalling the module, it can be seen how the dms.directory and dms.file tables are not deleted and that those records that we have created in our tests continue in the database, although they have lost some fields such as parent_id.
When we install the module again, the _check_directory_parent validation skips indicating that a record does not have the corresponding parent_id and prevents the installation.
The simplest and dirty solution is to perform a truncate to the tables dms.directory and dms.file although the correct option would be to do it during the uninstallation of the module.

@Puhlik77
Copy link

Puhlik77 commented Apr 13, 2023 via email

@daerisadmin
Copy link

Buenos días,
Si no tienes conocimientos de desarrollo, te recomieendo que instales una app para ejecutar instrucciones contra la base de datos como por ejemplo https://apps.odoo.com/apps/modules/15.0/query_deluxe/
Una vez instalada ejecuta la instrucción para eliminar las tablas. Por ejemplo:

DROP TABLE dms_directory;
DROP TABLE dms_file;

Saludos


Good morning,
If you do not have development knowledge, I recommend that you install an app to execute instructions against the database, such as https://apps.odoo.com/apps/modules/15.0/query_deluxe/
Once installed, execute the statement to remove the tables. For example:

DROP TABLE dms_directory;
DROP TABLE dms_file;

Best Regards

@CedricAtanane
Copy link

CedricAtanane commented Apr 28, 2023

Buenos días, Si no tienes conocimientos de desarrollo, te recomieendo que instales una app para ejecutar instrucciones contra la base de datos como por ejemplo https://apps.odoo.com/apps/modules/15.0/query_deluxe/ Una vez instalada ejecuta la instrucción para eliminar las tablas. Por ejemplo:

DROP TABLE dms_directory; DROP TABLE dms_file;

Saludos

Good morning, If you do not have development knowledge, I recommend that you install an app to execute instructions against the database, such as https://apps.odoo.com/apps/modules/15.0/query_deluxe/ Once installed, execute the statement to remove the tables. For example:

DROP TABLE dms_directory; DROP TABLE dms_file;

Best Regards

"I confirm that the same problem exists in v15. The solution to drop the dms_directory and dms_file tables worked well. Thank you very much 👍
It may be wise to add an uninstall_hook method to avoid any future problems. Here's an example :

def uninstall_hook(cr, registry):
    cr.execute("DROP TABLE IF EXISTS dms_directory;")
    cr.execute("DROP TABLE IF EXISTS dms_file;")

@Home-Based
Copy link

Hi all,

I confirm the procedure discribed by daerisadmin worked on our side.

@Home-Based
Copy link

But after re-installation, DMS Tab does not show on res.partner model or any other model linked to a storage (same symptom as mentionned within issue #138, btw).

The tables that are causing the issue were linked to the res.partner model, as daerisadmin said : "Good morning,
The steps to reproduce the error are to install the module for the first time and add attachments associated with some entity, such as res.partner."

I suspect the dms_field addon is unable to recreate the tables, once the procedure for re-installation is executed.

I know this is not the place for asking installation or use advice, but digging the web doesn't give me any hint for a solution. Please indicate where to ask questions to the OCA community.

Many thanks to all for your involvement.

Best regards,

SA

@danylook
Copy link

i confirmed the issue and the procidure to resolved it temporary

Copy link

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@victoralmau
Copy link
Member

Solved in 15.0 (#289) and 16.0 (#305)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

No branches or pull requests

8 participants