Skip to content

Bugs in examples for group_expand in odoo ORM API #12557

@holasoftware

Description

@holasoftware

In the documentation of the odoo ORM API:

https://www.odoo.com/documentation/18.0/developer/reference/backend/orm.html

In the examples for group_expand field attribute the functions are accepting an order keyword parameter:

@api.model
def _read_group_selection_field(self, values, domain, order):
    return ['choice1', 'choice2', ...] # available selection choices.

@api.model
def _read_group_many2one_field(self, records, domain, order):
    return records + self.search([custom_domain])

But this keyword parameter order is not used anymore internally. I was checking this file inside thr source code:

odoo/models.py

And this function there:

_read_group_fill_results

In that function, the group_expand method of the odoo model is never called with the order parameter.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions