check length of names needed

Bug #912358 reported by Ferdinand
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP's Framework R&D

Bug Description

sometimes the names for relations can't be stored
example

raising an error with modules to be installed which is hard to recover.

example
account_financial_report_webkit

this works
account_journal_account_report_general_ledger_webkit_rel_account_report_general_ledger_webkit_id_index
but creates an index (cut off)
account_journal_account_report_general_ledger_webkit_rel_accoun

this fails
account_journal_account_report_general_ledger_webkit_rel_account_journal_id_index

obviously name length exceeded

see attachment

Revision history for this message
Ferdinand (office-chricar) wrote :
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hello,

When OpenERP creates relations tables and FK for many2many osv.memory, the generated names should not exceed the postgresql standard maximal size.

Or we should define a limit for the length of the model (osv and osv.memory) names but in a such case the server must check that at the model initialization.

Thanks & Best Regards
Guewen

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Ferdinand (office-chricar) wrote :

IMHO the current implementation creates a lot of unnecessary tables

I suggest to store this information in a table with the following column
* relation name
* col1_id
* col2_id

or
table1_name
col1_name
col1_id
table2_name
col2_name
col2_id

or 2 columns
table1_name + col1_name + col1_id
table2_name + col2_name + col2_id

the design depends a bit on how the search is ececuted

Revision history for this message
Antony Lesuisse (OpenERP) (al-openerp) wrote :

You may optionnaly define a table name when such a case happens.

Anyway if you make a PROPER merge proposal we could merge your patch.

Changed in openobject-server:
importance: Low → Wishlist
Revision history for this message
Ludwik Trammer (ludwik) wrote :

I believe I was just bitten by the issue. And it took me quite a long time to figure out the source of the problem.

I posted a detailed description of the issue and its consequences on Stack Overflow:
http://stackoverflow.com/a/26101401/262618

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.