OCA / dms

Odoo modules for a Document Management System
GNU Affero General Public License v3.0
113 stars 170 forks source link

14c - DMS uninstall/install error #189

Closed kimasplund closed 8 months ago

kimasplund commented 2 years ago

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

victoralmau commented 2 years ago

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 commented 2 years ago

Hi all,

I'm following the same path as Kimasplund... As DMS didn't work as expected (see issue 187 - https://github.com/OCA/dms/issues/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

https://user-images.githubusercontent.com/96236659/187870791-64ea7e8e-d9e1-409a-bcbd-5cd0fe26747d.mov

Sabeel84 commented 2 years ago

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

Puhlik77 commented 1 year ago

Same happens to me...

victoralmau commented 1 year ago

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

daerisadmin commented 1 year ago

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 commented 1 year ago

Hi,Thanks for clarifying, but I'm not a developer. If you provide the instruction how to truncate the tables would be helpful.The module is already uninstalled but still gives me an error when trying to install again. See attached

On Thursday, April 13, 2023 at 06:20:01 a.m. EDT, daeris admin ***@***.***> wrote:  

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.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

daerisadmin commented 1 year ago

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 commented 1 year ago

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 :+1:
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 commented 1 year ago

Hi all,

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

Home-Based commented 1 year ago

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 commented 1 year ago

i confirmed the issue and the procidure to resolved it temporary

github-actions[bot] commented 9 months ago

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 commented 7 months ago

Solved in 15.0 (https://github.com/OCA/dms/pull/289) and 16.0 (https://github.com/OCA/dms/pull/305)