Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IJOL opened this issue Apr 8, 2021 · 0 comments
Open

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

IJOL opened this issue Apr 8, 2021 · 0 comments

Comments

@IJOL
Copy link

IJOL commented Apr 8, 2021

  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..

@IJOL IJOL changed the title Importing from a regular magento 1.7 gives us an syntax alike error... Importing from a regular magento 1.7 gives us a TypeError. Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant