This question has been flagged
1 Reply
5887 Views

Hi,

I would like make a "group by" on a many2one field but when i make this on the note view i have this error : TypeError: read_group() got multiple values for keyword argument 'offset' . 

I don't understand because it's not my first "group by" on the same field.

More, the display of the task_id field in the tree view work's.

It's possible that it's a bug ?

Watch my code :

project.py

class Note(osv.Model):
    _inherit="note.note"
    
    _columns = {
        'task_id':fields.many2one('project.task','Tâche associée', select=True)
    }

Note()

 

project.xml :

<record id="at_note_task_checklist_tree" model="ir.ui.view">
        <field name="name">at.note_task.checklist.tree</field>
        <field name="model">note.note</field>
        <field eval="15" name="priority"/>
        <field name="arch" type="xml">
            <tree string="Stages">
                <field name="name"/>
                <field name="open"/>
                <field name="stage_id"/>
                <field name="tag_ids" widget="many2many_tags"/>
                <field name="task_id"/>
            </tree>
        </field>

</record>

 

<record id="view_note_filter" model="ir.ui.view">
            <field name="name">at.note.filter</field>
            <field name="model">note.note</field>
            <field name="arch" type="xml">
            
                <search string="Notes">                    
                    <filter name="open_true" string="Active" domain="[('open', '=', True)]"/>
                    <filter name="open_false" string="Archive" domain="[('open', '=', False)]"/>

                    <group expand="0" string="Grouper par...">
                        <filter string="task" context="{'group_by': 'task_id'}"/>
                    </group>
                </search>
            </field>
    </record>

 

Avatar
Discard
Best Answer

You can not group on a many 2 many field

Avatar
Discard