Merge lp:~initos.com/openerp-connector-magento/7.0-small-kwargs-improvement-sale into lp:~openerp-connector-core-editors/openerp-connector-magento/7.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~initos.com/openerp-connector-magento/7.0-small-kwargs-improvement-sale |
Merge into: | lp:~openerp-connector-core-editors/openerp-connector-magento/7.0 |
Diff against target: |
17 lines (+4/-3) 1 file modified
magentoerpconnect/sale.py (+4/-3) |
To merge this branch: | bzr merge lp:~initos.com/openerp-connector-magento/7.0-small-kwargs-improvement-sale |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guewen Baconnier @ Camptocamp | Needs Resubmitting | ||
Review via email: mp+223564@code.launchpad.net |
Description of the change
The method 'search' of the SaleOrderAdapter uses keyword arguments. This code branch changes the call so that is uses keyword arguments. This allows inheriting classes to be lazy and do something like
def search(self, filters=None, **kwargs):
# add state to filters
filters = filters or {}
filters[
return super(mySaleOrd
**kwargs)
instead of explicitly writing down all other keyword arguments.
I know that there are some other places in the code where functions are not called by keyword. With this merge proposal I want to start a discussion if such a change goes in the right direction. Its obvious disadvantage is that it makes the call a bit more cumbersome.
Unmerged revisions
- 1004. By Thomas Rehn
-
make change pep-8 compliant
- 1003. By Thomas Rehn
-
keyword arguments should be called as such
I totally agree that keyword arguments should be called using the keyword.
I have just one remark about pep8 regarding the indentation, it says "Arguments on first line forbidden when not using vertical alignment" [0]
So I propose to write
record_ids = self.backend_ adapter. search(
filters= filters,
from_date= from_date,
magento_ storeview_ ids=magento_ storeview_ ids)
[0] ref: http:// legacy. python. org/dev/ peps/pep- 0008/#indentati on