Odoo Help

0

search function not working [Closed]

By
remi mores
on 7/19/13, 9:11 AM 1,672 views

The Question has been closed

by
Ray Carnes
on 07/20/2013 01:55:41

hi,

I've got a table, agreement_account_periodical_invoice, which contains records.

when i search this table, using search() like this:

agreement_model = self.pool.get('account.periodical_invoice.agreement')
agreement_ids = agreement_model.search(cr,uid,[])

agreement_ids should contain ALL ids from that table, right?

My problem is that it returns an EMPTY list?!

And when i use browse i do get a record???

agreement = agreement_model.browse(cr,uid,[1])

The documentation tells that specifying an empty list in search() returns all records?? Or is my english that bad i don't understand the sentence 'all records'?

if i check the table with an sql-client, the record (1) is really there. Why isn't search() showing that existing id??

1

Ray Carnes

--Ray Carnes--
17486
| 9 7 9
Atlanta, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 7/20/13, 1:55 AM

Reposted as an answer instead of a comment:

I found the solution:

When a table has a column 'Active:boolean', search() will NOT return the rows with 'Active:false'

This should/could at least be documented in the openerp docs. Now it says search() with an empty condition returns ALL records. This is not true, it returns only the rows with 'Active:true' (if a table has such a column)

remi mores

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 7/19/13, 9:11 AM
Seen: 1672 times
Last updated: 3/16/15, 8:10 AM