Merge lp:~factorlibre/openerp-connector-magento/openerp-connector-magento-php54-none-values into lp:~openerp-connector-core-editors/openerp-connector-magento/7.0

Proposed by Alberto Garcia (Factor Libre)
Status: Needs review
Proposed branch: lp:~factorlibre/openerp-connector-magento/openerp-connector-magento-php54-none-values
Merge into: lp:~openerp-connector-core-editors/openerp-connector-magento/7.0
Diff against target: 20 lines (+9/-0)
1 file modified
magentoerpconnect/unit/backend_adapter.py (+9/-0)
To merge this branch: bzr merge lp:~factorlibre/openerp-connector-magento/openerp-connector-magento-php54-none-values
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Needs Resubmitting
Review via email: mp+224970@code.launchpad.net
To post a comment you must log in.
1007. By Alberto Garcia (Factor Libre)

Fix api call

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

Thanks for this patch.
What you want is to remove trailing None values, but you remove all None values.
Example, if you have: [7, None, 4, None], you patch will give [7, 4].

Here is want you want:

    if isinstance(arguments, list):
        while arguments and arguments[-1] is None:
            arguments.pop()

Thanks to run the unittests and fix them accordingly. The test data will certainly need to be adapted.

review: Needs Fixing (code review)
1008. By Alberto Garcia (Factor Libre)

Fix

Revision history for this message
Alberto Garcia (Factor Libre) (agarcia-flibre) wrote :

How can I run tests? Y have done new commit with your changes

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

On Mon, Jun 30, 2014 at 3:39 PM, Alberto Garcia (Factor Libre)
<email address hidden> wrote:
> How can I run tests? Y have done new commit with your changes

http://openerp-magento-connector.com/project/contribute.html#run-the-tests

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

This project is now hosted on https://github.com/OCA/connector-magento. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting

Unmerged revisions

1008. By Alberto Garcia (Factor Libre)

Fix

1007. By Alberto Garcia (Factor Libre)

Fix api call

1006. By Alberto Garcia (Factor Libre)

Delete None parameters for connector when Magento use php => 5.4

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'magentoerpconnect/unit/backend_adapter.py'
2--- magentoerpconnect/unit/backend_adapter.py 2014-05-26 09:37:00 +0000
3+++ magentoerpconnect/unit/backend_adapter.py 2014-06-30 13:39:15 +0000
4@@ -153,7 +153,16 @@
5 self.magento.username,
6 self.magento.password,
7 full_url=custom_url) as api:
8+
9+
10+ # If magento is used with PHP version >= 5.4, then we have to remove all
11+ # trailing None values
12+ if isinstance(arguments, list):
13+ while arguments and arguments[-1] is None:
14+ arguments.pop()
15+
16 result = api.call(method, arguments)
17+
18 # Uncomment to record requests/responses in ``recorder``
19 # record(method, arguments, result)
20 _logger.debug("api.call(%s, %s) returned %s",