String matching on 'region' field is not strict enough
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP Connector - Magento |
Fix Released
|
Medium
|
Brendan Clune (Logic Supply) |
Bug Description
When importing 'region' information from Magento into OpenERP, the connector uses 'ilike' matching on the region name:
@mapping
def state(self, record):
if not record.
state_ids = self.session.
if state_ids:
In the case where there are regions with similar names, (e.g. 'California' and 'Baja California'), the search will return both, and the connector will pick the one which is first alphabetically. Thus, importing a sale order for 'California' will always return 'Baja California'.
There are two possible fixes:
The first is to use '=ilike' as the domain operator, forcing a full (case-insensitive) match on region name. The second is to continue to use 'ilike', but add country information to the domain search. This is perhaps more flexible, but less elegant.
The proposed branch simply changes 'ilike' to '=ilike'.
Related branches
- Guewen Baconnier @ Camptocamp: Approve (code review)
-
Diff: 11 lines (+1/-1)1 file modifiedmagentoerpconnect/partner.py (+1/-1)
Changed in openerp-connector-magento: | |
status: | Confirmed → Fix Committed |
Thanks for the analysis and proposal.
I prefer the exact insensitive match (=ilike) too.