Skip to content

Importing from a regular magento 1.7 gives us a TypeError. #320

@IJOL

Description

@IJOL
  File "/opt/odoo/run/odoo/connector-magento/connector_magento/models/sale_order/importer.py", line 77, in _rule_paid
    if record['grand_total'] and amount_paid <= 0:
TypeError: unorderable types: str() <= int()

just changed the method:

   def _rule_paid(self, record, method):
        """ Import the order only if it has received a payment, or if there
        is nothing to pay in the first place. """
        amount_paid = float(record.get('payment', {}).get('amount_paid') or 0)
        if record['grand_total'] and amount_paid <= 0:
            raise OrderImportRuleRetry('The order has not been paid.\n'
                                       'The import will be retried later.')

and deleted commit fa27e77, and everything seems to go smoothtly now..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions