Skip to Content
Menu
This question has been flagged
2 Replies
2873 Views

Dear all,

I’m trying to use odoo for my organisation but I’m experiencing problems with the on-line software.

I am not able to create invoice and the following error occurs.

Could you please,provide me support?

Best regards,

M. Tranfaglia

 

OpenERP Server Error

Traceback (most recent call last):

  File "/home/odoo/src/odoo/saas-3/openerp/http.py", line 379, in _handle_exception

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

  File "/home/odoo/src/odoo/saas-3/openerp/http.py", line 398, in dispatch

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

  File "/home/odoo/src/odoo/saas-3/openerp/http.py", line 235, in _call_function

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

  File "/home/odoo/src/odoo/saas-3/openerp/service/model.py", line 114, in wrapper

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

  File "/home/odoo/src/odoo/saas-3/openerp/http.py", line 232, in checked_call

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

  File "/home/odoo/src/odoo/saas-3/openerp/http.py", line 562, in __call__

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

  File "/home/odoo/src/odoo/saas-3/addons/web/controllers/main.py", line 1247, in exec_workflow

    return request.session.exec_workflow(model, id, signal)

  File "/home/odoo/src/odoo/saas-3/openerp/http.py", line 849, in exec_workflow

    r = self.proxy('object').exec_workflow(self.db, self.uid, self.password, model, signal, id)

  File "/home/odoo/src/odoo/saas-3/openerp/http.py", line 621, in proxy_method

    result = openerp.netsvc.dispatch_rpc(self.service_name, method, args)

  File "/home/odoo/src/odoo/saas-3/openerp/netsvc.py", line 240, in dispatch_rpc

    result = dispatch(method, params)

  File "/home/odoo/src/odoo/saas-3/openerp/service/model.py", line 37, in dispatch

    res = fn(db, uid, *params)

  File "/home/odoo/src/odoo/saas-3/openerp/service/model.py", line 114, in wrapper

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

  File "/home/odoo/src/odoo/saas-3/openerp/service/model.py", line 195, in exec_workflow

    return exec_workflow_cr(cr, uid, obj, signal, *args)

  File "/home/odoo/src/odoo/saas-3/addons/audittrail/audittrail.py", line 540, in exec_workflow_cr

    return fct_src(cr, uid, model, method, *args, **kw)

  File "/home/odoo/src/odoo/saas-3/openerp/service/model.py", line 189, in exec_workflow_cr

    return execute_cr(cr, uid, obj, 'signal_workflow', [res_id], signal)[res_id]

  File "/home/odoo/src/odoo/saas-3/addons/audittrail/audittrail.py", line 534, in execute_cr

    return fct_src(cr, uid, model, method, *args, **kw)

  File "/home/odoo/src/odoo/saas-3/openerp/service/model.py", line 160, in execute_cr

    return getattr(object, method)(cr, uid, *args, **kw)

  File "/home/odoo/src/odoo/saas-3/openerp/osv/orm.py", line 3673, in signal_workflow

    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/__init__.py", line 85, in trg_validate

    return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/service.py", line 91, in validate

    res2 = wi.validate(signal)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/instance.py", line 75, in validate

   wi.process(signal=signal, force_running=force_running, stack=stack)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 121, in process

    ok = self._split_test(activity['split_mode'], signal, stack)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 249, in _split_test

    self._join_test(t[0], t[1], stack)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 258, in _join_test

    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 96, in create

    workflow_item.process(stack=stack)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 117, in process

    if not self._execute(activity, stack):

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 163, in _execute

    returned_action = self.wkf_expr_execute(activity)

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 314, in wkf_expr_execute

    return self.wkf_expr_eval_expr(activity['action'])

  File "/home/odoo/src/odoo/saas-3/openerp/workflow/workitem.py", line 292, in wkf_expr_eval_expr

    result = eval(line, env, nocopy=True)

  File "/home/odoo/src/odoo/saas-3/openerp/tools/safe_eval.py", line 313, in safe_eval

    return eval(c, globals_dict, locals_dict)

  File "", line 1, in <module>

  File "/home/odoo/src/odoo/saas-3/openerp/osv/orm.py", line 379, in function_proxy

    return attr(self._cr, self._uid, [self._id], *args, **kwargs)

  File "/home/odoo/src/odoo/saas-3/addons/account_asset/account_asset_invoice.py", line 28, in action_number

    result = super(account_invoice, self).action_number(cr, uid, ids, *args)

  File "/home/odoo/src/odoo/saas-3/addons/account/account_invoice.py", line 1119, in action_number

    self.write(cr, uid, ids, {})

  File "/home/odoo/src/odoo/saas-3/addons/mail/mail_thread.py", line 402, in write

    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)

  File "/home/odoo/src/odoo/saas-3/openerp/osv/orm.py", line 4045, in write

    self.pool[model_name]._store_set_values(cr, user, todo, fields_to_recompute, context)

  File "/home/odoo/src/odoo/saas-3/openerp/osv/orm.py", line 4441, in _store_set_values

    '"'+f+'"='+self._columns[f]._symbol_set[0] + ' where id = %s', (self._columns[f]._symbol_set[1](value), id))

  File "/home/odoo/src/odoo/saas-3/openerp/sql_db.py", line 156, in wrapper

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

  File "/home/odoo/src/odoo/saas-3/openerp/sql_db.py", line 221, in execute

    res = self._obj.execute(query, params)

ValueError: "duplicate key value violates unique constraint "account_invoice_number_uniq"

DETAIL:  Key (number, company_id, journal_id, type)=(SAJ/2014/0002, 1, 1, out_invoice) already exists.

" while evaluating

u'action_number()'

Avatar
Discard
Best Answer

https://www.odoo.com/nl_NL/forum/help-1/question/invoice-numbers-not-be-created-19007

Avatar
Discard
Best Answer

You go to the menu Settings/Sequences & Identifeirs/Sequences, find sequence "Sales Journal" (code SAJ), modify in this sequence "Next Number" and set, for example 5. You cancel Invoice and create new. Error should disappear.  

Avatar
Discard