Skip to content

Commit

Permalink
[FIX] mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkoNikolovski authored and dreispt committed Apr 27, 2024
1 parent f53584b commit 8970fce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 7 additions & 2 deletions connector_magento/models/partner/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,15 @@ class BaseAddressImportMapper(AbstractComponent):

@mapping
def state(self, record):
if not record.get("region"):
region = record.get("region")
if isinstance(region, dict):
region = region.get("region")

if not region:
return

state = self.env["res.country.state"].search(
[("name", "=ilike", record["region"])], limit=1,
[("name", "=ilike", region)], limit=1,
)
if state:
return {"state_id": state.id}
Expand Down
2 changes: 1 addition & 1 deletion connector_magento/wizards/magento_binding_backend_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _get_magento_binding_model(self):
_logger.info(
"No component registry for database %s. "
"Probably because the Odoo registry has not been built "
"yet."
"yet." % (self.env.cr.dbname)
)
return []
component_classes = components_registry.lookup(
Expand Down
8 changes: 8 additions & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
connector
connector-ecommerce
e-commerce
product-attribute
sale-workflow
server-tools
bank-payment
partner-contact

0 comments on commit 8970fce

Please sign in to comment.