OCA / partner-contact

Odoo Partner and Contact related addons
GNU Affero General Public License v3.0
208 stars 851 forks source link

[12.0] Installation hangs and never finiches #853

Closed asm8073 closed 4 years ago

asm8073 commented 4 years ago

Hi, I'm using the Odoo Enterprise 12 (Odoo 12.0+e-20191215). I have downloaded the module from the OCA site, have unzipped it and put in the modules folder of our Odoo server, I have changed the folder owner in the same manner as for other modules. Once the server is restarted, I have clicked on Update Apps List and have got the module n the interface : image

Once I’ve clicked on the “Install”, the screen gets in waiting for a minute and then shows the message “Connection lost” : image image

In a minute or so, I get the connection restored, but the module is not in the installed status and not usable image

The Odoo server logs during the installation are attached.

module_first_name_install.log

NL66278 commented 4 years ago

@asm8073 Your problem is the time it takes to recompute all the partners. If you install the module, it will try to split all existing names in firstname and lastname.

You might try to install the module from the commandline (start the server with -i partner_firstname).

If this still failes, due to a large number of partners, you might need some coding to disable the immediate recomputation, and have a cronjob recompute the partner names in batches (like every hour the next 1024).

asm8073 commented 4 years ago

Hi @NL66278 , Thank you for your advises. I have more than 30 000 contacts in the DB, so I think the command line installation would not make big difference. I would like to adjust the code in order to disable the immediate recalculation. Could you please give me a hint where to disable the immediate recalculation? Thanks!

NL66278 commented 4 years ago

@asm8073 Comment out this line: https://github.com/OCA/partner-contact/blob/43fee0870ae261cf733fcd5e95e402c169912e1d/partner_firstname/__init__.py#L2

asm8073 commented 4 years ago

@NL66278 , thank you for the hint! Changing init.py made error on the installation, as the post_init_hook function is also mentioned in the manifest file. So, I commented out the 4th line in the code below from the hooks.py file:

def post_inithook(cr, ): with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {}) # env['res.partner']._install_partner_firstname()

Also, I needed to delete pycache and then I was able to install the module successfully. Thank you for your help!

NL66278 commented 4 years ago

@asm8073 I a glad your issue is resolved!