Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


[Solved] Getting errors on code that was working previously - Odoo8

on 6/15/15, 3:43 AM 311 views

I had code for incrementing a ticket number with a prefix of year and month and it was working perfect until I uninstalled the module and reinstalled. Getting this error:

Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 530, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 567, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 303, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 300, in checked_call

return self.endpoint(*a, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 796, in __call__

return self.method(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 396, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 936, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 928, in _call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/vagrant/addons/helpdesk/helpdesk.py", line 38, in create

return super(helpdesk, self).create(cr, uid, vals, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/addons/mail/mail_thread.py", line 384, in create

thread_id = super(mail_thread, self).create(cr, uid, values, context=context)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 336, in old_api

result = method(recs, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4062, in create

record = self.browse(self._create(old_vals))

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 462, in new_api

result = method(self._model, cr, uid, *args, **kwargs)

File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4161, in _create

updates.append((field, '%s', current_field._symbol_set[1](vals[field])))

File "/usr/lib/python2.7/dist-packages/openerp/osv/fields.py", line 270, in <lambda>

_symbol_f = lambda x: int(x or 0)

ValueError: invalid literal for int() with base 10: '2015/06000000002'

.py code:

def create(self, cr, uid, vals, context=None):

vals['ticketnumber'] = self.pool.get('ir.sequence').get(cr, uid, 'helpdesk.ticket')

return super(helpdesk, self).create(cr, uid, vals, context=context)

_defaults = {

'ticketnumber': lambda obj, cr, uid, context: 0


.xml code:

<data noupdate="1">

<record id="seq__responsible_code_inh1" model="ir.sequence.type">

<field name="name">ticketnumber</field>

<field name="code">helpdesk.ticket</field>


<record id="seq_res_code_inh2" model="ir.sequence">

<field name="name">ticketnumber</field>

<field name="code">helpdesk.ticket</field>

<field name="padding">9</field>

<field name="prefix">%(year)s/%(month)s</field>

<field name="number_next">001</field>

<field name="number_increment">1</field>



Why would it suddenly stop working?

On 6/15/15, 3:58 AM

Although I had code written, it was hard code in Sequences in Odoo so I had to alter it there in order for the code to work

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 6/15/15, 3:43 AM
Seen: 311 times
Last updated: 6/15/15, 3:58 AM