Skip to content

Instantly share code, notes, and snippets.

@katyukha
Created April 29, 2014 12:57
Show Gist options
  • Save katyukha/11399542 to your computer and use it in GitHub Desktop.
Save katyukha/11399542 to your computer and use it in GitHub Desktop.
OpenERP nullable int
# -*- coding: utf-8 -*-
from osv import fields
class integer_x(fields._column):
_type = 'integer'
_symbol_c = '%s'
_symbol_f = lambda x: x and int(x) or None
_symbol_set = (_symbol_c, _symbol_f)
_symbol_get = lambda self,x: x #or 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment