Merge lp:~openerp-dev/openobject-server/6.0-opw-19972-rha into lp:openobject-server/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: no longer in the source branch.
Merged at revision: 3590
Proposed branch: lp:~openerp-dev/openobject-server/6.0-opw-19972-rha
Merge into: lp:openobject-server/6.0
Diff against target: 35 lines (+5/-6)
1 file modified
bin/osv/orm.py (+5/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.0-opw-19972-rha
Reviewer Review Type Date Requested Status
Xavier ALT (community) Approve
Naresh(OpenERP) (community) Approve
nel Pending
Review via email: mp+82502@code.launchpad.net

Description of the change

Hello,

Corrected behavior of search method of osv memory object which was giving wrong result with limit and offset.

Currently it was searching for records till the limit instead of giving number of record of that limit and offset did not take into account also.

Regards,
Rifakat

To post a comment you must log in.
3543. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3544. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3545. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3546. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3547. By Olivier Laurent (Open ERP)

[MERGE] opw 50559

3548. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3549. By Olivier Laurent (Open ERP)

[MERGE] opw 50997

3550. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3551. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3552. By Olivier Laurent (Open ERP)

[MERGE] opw 51206

3553. By Olivier Laurent (Open ERP)

[FIX] revert r3552 (opw 51206)

3554. By Olivier Laurent (Open ERP)

[FIX] opw 51206 (code improved)

3555. By Olivier Laurent (Open ERP)

[FIX] fixed r3554

3556. By Olivier Laurent (Open ERP)

[MERGE] opw 50912

3557. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3558. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3559. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3560. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3561. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3562. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3563. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3564. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3565. By Olivier Laurent (Open ERP)

[MERGE] backport of revision 3900: groupby boolean field with 3 distinct values (True, False, NULL)

3566. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3567. By Olivier Laurent (Open ERP)

[MERGE] opw 51127

3568. By Olivier Laurent (Open ERP)

[MERGE] opw 54583

3569. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3570. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3571. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
3572. By Olivier Laurent (Open ERP)

[MERGE] opw 51026

3573. By Olivier Laurent (Open ERP)

[MERGE] opw 51093

3574. By Olivier Laurent (Open ERP)

[MERGE] opw 50831

3575. By Olivier Laurent (Open ERP)

[MERGE] opw 5801

3576. By Olivier Laurent (Open ERP)

reverted patch for 'opw 51026'

3577. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3578. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3579. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3580. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3581. By Olivier Laurent (Open ERP)

[FIX] ir_values: revert r3568: caused a crash when creating a new purchase.order

3582. By Christophe Simonis (OpenERP)

[IMP] backport of rev <email address hidden> of trunk: tools.translate: be more lenient and accept standart gettext source annotations

Original commit information:
------------------------------------------------------------
revno: 4002
revision-id: <email address hidden>
parent: <email address hidden>
committer: Olivier Dony <email address hidden>
branch nick: trunk
timestamp: Thu 2012-02-02 15:32:10 +0100
message:
  [IMP] tools.translate: be more lenient and accept standart gettext source annotations

   The GetText spec says that PO auto-comments indicating
    the source location have this form:
     #: /path/to/file:lineno
    However OpenERP's POT export system defaults to a modified
    version of this format with an extra 'type' field:
     #: type:/path/to/file:lineno
    The babel extractors we use for openerp-web's translations
    have the GetText format hardcoded, so it's a good idea
    to be more lenient and allow the standards annotations too.
    We can use a default 'code' type for such cases.

    For openerp-web translations the type does not matter,
    as the translations will be directly loaded by the
    web engine from the PO files and served in Javascript
   to the browser, with no typing needed.

    This patch simply avoids failing to parse updated PO files
    that will contain standard GetText annotations for the
    openerp-web related terms.

3583. By tfr (Openerp)

[MERGE] fix opw issue 56037 : res.log context need to allow more the 250 char

3584. By Olivier Laurent (Open ERP)

[FIX] resubmit patch for opw 51206 (cfr r3552, r3553, r3576). Also check addons revision 5056

3585. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3586. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3587. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3588. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

3589. By Xavier ALT

[MERGE] OPW 18390

Revision history for this message
Xavier ALT (dex-phx) wrote :

Hello,

First "if" is equivalent to the "elif" in default case (offset = 0), so a unique "if" is sufficient, like:

if limit and (counter > int(limit)+int(offset))

Cheers,
Xavier

review: Needs Fixing
3590. By Rifakat Husen (OpenERP)

[FIX] osv: small imp for if condition

Revision history for this message
Xavier ALT (dex-phx) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/osv/orm.py'
2--- bin/osv/orm.py 2012-02-24 10:04:28 +0000
3+++ bin/osv/orm.py 2012-02-24 13:17:18 +0000
4@@ -2060,14 +2060,13 @@
5 return self.datas.keys()
6
7 res = []
8- counter = 0
9+ counter = 1
10 #Find the value of dict
11 f = False
12 if result:
13 for id, data in self.datas.items():
14- counter = counter + 1
15 data['id'] = id
16- if limit and (counter > int(limit)):
17+ if limit and (counter > int(limit) + int(offset)):
18 break
19 f = True
20 for arg in result:
21@@ -2077,11 +2076,11 @@
22 val = eval('data[arg[0]]'+arg[1] +' arg[2]', locals())
23 elif arg[1] in ['ilike']:
24 val = (str(data[arg[0]]).find(str(arg[2]))!=-1)
25-
26 f = f and val
27-
28 if f:
29- res.append(id)
30+ if counter > offset:
31+ res.append(id)
32+ counter += 1
33 if count:
34 return len(res)
35 return res or []