[Erp5-dev] own workflow state catalogged in own table, its translation - how to?

Łukasz Nowak lukasz.nowak at ventis.com.pl
Fri Sep 12 14:58:56 CEST 2008


Hello,

On Fri, 2008-09-12 at 14:23 +0200, Jérome Perrin wrote:
> Le jeudi 11 septembre 2008 à 11:55 +0200, Łukasz Nowak a écrit :
> > Hello,
> > 
> > We are using our own workflow state - operation_state.
> > 
> > I created my own table for this state in catalog: ventisopstate.
> > 
> > Searching/sorting is working for this operation_state column. So far so
> > good.
> > 
> > But I wanted to be able to sort/search by this state translated title.
> > 
> > So I've copy&pasted:
> >  * z_related_translated_validation_state
> > => z_related_translated_operation_state
> > 
> >  * z_related_translated_validation_state_title =>
> > z_related_translated_operation_state_title
> > 
> > Modified both scripts, updated sql_catalog_related_keys.
> 
> Hello,
> 
> What did you add in sql_catalog_related_keys ?
> My guess is that you should add ventisopstate table in the related key
> definition, so that the query builder adds it in the FROM clause.
> Maybe something like:
> 
> translated_operation_state_title
> | ventisopstate/translation/translated_message/z_related_translated_operation_state_title

I did have:

translated_operation_state |
translation/translated_message/z_related_translated_operation_state

translated_operation_state_title |
translation/translated_message/z_related_translated_operation_state_title


After changing to:
translated_operation_state |
venitsopstate/translation/translated_message/z_related_translated_operation_state

translated_operation_state_title |
ventisopstate/translation/translated_message/z_related_translated_operation_state_title

only part of traceback changed to:

OperationalError: (1054, "Unknown column
'related_ventisopstate_0.translation' in 'where clause': SELECT\n
COUNT(DISTINCT catalog.uid) FROM\n catalog AS catalog WHERE\n 1 = 1\n
AND (1) AND (1) AND (1) AND (1) AND (1) AND (1) AND (1) AND (1) AND (1)
AND (1) AND (((((catalog.portal_type = 'Production Order'))))) AND (1)
AND (((((related_ventisopstate_0.translation = 'finished'))))) AND
(((catalog.security_uid IN (147, 148, 149, 150, 151, 152, 153, 154, 155,
156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196)) OR
(((((((catalog.viewable_owner = 'ERP5TypeTestCase'))))))))) AND (1) AND
(1) AND (1) AND (((((catalog.parent_uid = '1152'))))) AND (1)\nLIMIT 1")

Regards,
Luke

-- 
Łukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.





More information about the Erp5-dev mailing list