diff options
| author | xmo-odoo <xmo@odoo.com> | 2017-04-27 13:59:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-27 13:59:33 +0200 |
| commit | 2e6a589f417af48e3322955ffff6e94b6d8a24e3 (patch) | |
| tree | aa613ecc1f74a9531a03de89aa2bdc7bb32eed3b /addons/gamification | |
| parent | de4a2216b953abb86094c9bfa5f45b1eaaa79d3d (diff) | |
[FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)
issue 8530
Diffstat (limited to 'addons/gamification')
| -rw-r--r-- | addons/gamification/models/goal.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index 1e9975ea97f..5a306ae9a33 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -7,6 +7,7 @@ from datetime import date, datetime, timedelta from odoo import api, fields, models, _, exceptions from odoo.osv import expression +from odoo.tools import pycompat from odoo.tools.safe_eval import safe_eval _logger = logging.getLogger(__name__) @@ -281,7 +282,7 @@ class Goal(models.Model): safe_eval(code, cxt, mode="exec", nocopy=True) # the result of the evaluated codeis put in the 'result' local variable, propagated to the context result = cxt.get('result') - if result is not None and isinstance(result, (float, int, long)): + if result is not None and isinstance(result, (float, pycompat.integer_types)): goals_to_write.update(goal._get_write_values(result)) else: _logger.error( @@ -322,7 +323,7 @@ class Goal(models.Model): for goal in [g for g in goals if g.id in query_goals]: for user_value in user_values: queried_value = field_name in user_value and user_value[field_name] or False - if isinstance(queried_value, tuple) and len(queried_value) == 2 and isinstance(queried_value[0], (int, long)): + if isinstance(queried_value, tuple) and len(queried_value) == 2 and isinstance(queried_value[0], pycompat.integer_types): queried_value = queried_value[0] if queried_value == query_goals[goal.id]: new_value = user_value.get(field_name+'_count', goal.current) |
