Skip to Content
Menu
This question has been flagged
1 Reply
1628 Views

Hi everyone,

I am using Odoo online and have crated a custom model 'Consolidated account' within the accounting module.

I use it as a property of account.account and stored in the account.move.line in order to aggregate reports against it. The custom model is created with all custom views form, tree and search. It behaves as I want it to except when trying to quick search the field in the tree view of the chart of account.

I have simply added the model in the tree view of chart of account as such:

<field name="x_conso_account"/>


The search view is defined as such:

<?xml version="1.0"?>

<search string="Consolidated account">

  <field name="x_name" filter_domain="['|', ('x_code', '=like', str(self) + '%'), ('x_description', 'ilike', self)]" string="Consolidated account"/>

  </search>


When trying to set the value of my custom model in the chart of account tree view it is not filtering the dropdown list at all, I only have the option of clicking search more. If I search within the search pop-up then my custom view fires and the list is filtered correctly. 

I noticed that the value I enter in the tree view is picked up by the search more button as Quick search: 'my search value' while searching explicitly in the pop-up instead displays Custom Field string: 'my search value'.

So it would seem the quick search function is not calling my custom search view somehow.

How can I change this behavior?


Avatar
Discard
Author Best Answer

No one has any idea?


I tried modifying the target filter field to the standard display_name but to no avail. Same behaviour, the quicksearch is not targeting anything while the actual search works perfectly. Puzzled...

  <field name="display_name" filter_domain="['|', ('x_code', '=like', str(self) + '%'), ('x_description', 'ilike', self)]" string="Consolidated account"/>

 

Avatar
Discard
Author

meant that as a comment...