Order_code in party.Party

What is the purpose of the method “order_code(tables)” in party.Party?

I tried to look in ModelSQL for some clues, but I couldn’t.

I know that it is possible to set the default field to order a model with _order.insert(0, (‘name’, ‘ASC’)).

The order_<field_name> function is used to customize the expression used to order the field. In this case, when ordering by the party code the lenght of the code is taken in account when ordering.

Not sure to understand you here, but you can extend the _order property of the model in a separate module in order to customize which is the default order for the model.

Hope it helps.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.