Connectors mailing list archives

connectors@odoo-community.org

Avatar

Re: Force Automatic Workflo

by
dominique.k
- 11/03/2016 01:27:35

The log says that there is a problem of duplicated invoice number?

On 11 Mar, 2016 2:53 am, "Michael Aigner" <michael@stilnest.com> wrote:
Sorry to blow this topic up so much, but I guess I am to the ground of the problem now, but I quite don’t understand what’s happening here as we’ve never had issues like that before. This is what I get now during validating invoices:

“
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 537, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 574, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 310, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 307, in checked_call
    return self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 803, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 955, in exec_workflow
    return request.session.exec_workflow(model, id, signal)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1111, in exec_workflow
    r = self.proxy('object').exec_workflow(self.db, self.uid, self.password, model, signal, id)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 879, in proxy_method
    result = dispatch_rpc(self.service_name, method, args)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 115, in dispatch_rpc
    result = dispatch(method, params)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 37, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 188, in exec_workflow
    return exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 182, in exec_workflow_cr
    return execute_cr(cr, uid, obj, 'signal_workflow', [res_id], signal)[res_id]
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3570, in signal_workflow
    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/__init__.py", line 85, in trg_validate
    return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/service.py", line 91, in validate
    res2 = wi.validate(signal)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/instance.py", line 80, in validate
    wi.process(signal=signal, force_running=force_running, stack=stack)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 120, in process
    ok = self._split_test(activity['split_mode'], signal, stack)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 248, in _split_test
    self._join_test(t[0], t[1], stack)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 257, in _join_test
    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 95, in create
    workflow_item.process(stack=stack)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 116, in process
    if not self._execute(activity, stack):
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 162, in _execute
    returned_action = self.wkf_expr_execute(activity)
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 313, in wkf_expr_execute
    return self.wkf_expr_eval_expr(activity['action'])
  File "/usr/lib/python2.7/dist-packages/openerp/workflow/workitem.py", line 291, in wkf_expr_eval_expr
    result = eval(line, env, nocopy=True)
  File "/usr/lib/python2.7/dist-packages/openerp/tools/safe_eval.py", line 314, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in 
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/account/account_invoice.py", line 927, in action_move_create
    inv.with_context(ctx).write(vals)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/mail/mail_thread.py", line 432, in write
    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 372, in old_api
    result = method(recs, *args, **kwargs)
  File "/opt/odoo/addons/connector/connector/producer.py", line 62, in write
    result = write_original(self, vals)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3787, in write
    self._write(old_vals)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4039, in _write
    recs.recompute()
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5732, in recompute
    rec._write(values)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
    return new_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api
    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3898, in _write
    cr.execute(query, params + (sub_ids,))
  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 158, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 234, 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)=(/, 1, 1, out_invoice) already exists.
" while evaluating
u'action_move_create()’
“

Any idea what’s wrong here?

Thanks,
Michael

> On Mar 10, 2016, at 7:07 PM, Michael Aigner <michael@stilnest.com> wrote:
> 
> Ok, I guess I found an issue with the Automatic Workflow in the log files:
> 
> "2016-03-10 18:05:24,231 17177 ERROR odoo-production openerp.addons.sale_automatic_workflow.automatic_workflow_job: Error during an automatic workflow action.
> Traceback (most recent call last):
>  File "/opt/odoo/addons/e-commerce/sale_automatic_workflow/automatic_workflow_job.py", line 63, in commit
>    yield
>  File "/opt/odoo/addons/e-commerce/sale_automatic_workflow/automatic_workflow_job.py", line 113, in _validate_pickings
>    pickings.validate_picking()
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
>    return new_api(self, *args, **kwargs)
>  File "/opt/odoo/addons/e-commerce/sale_automatic_workflow/stock_picking.py", line 43, in validate_picking
>    self.force_assign()
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
>    return new_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api
>    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/addons/stock/stock.py", line 915, in force_assign
>    self.write(cr, uid, ids, {'recompute_pack_op': True}, context=context)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
>    return old_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 372, in old_api
>    result = method(recs, *args, **kwargs)
>  File "/opt/odoo/addons/connector-ecommerce/connector_ecommerce/stock.py", line 39, in write
>    res = super(StockPicking, self).write(vals)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
>    return new_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api
>    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/addons/stock/stock.py", line 958, in write
>    res = super(stock_picking, self).write(cr, uid, ids, vals, context=context)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
>    return old_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/addons/mail/mail_thread.py", line 432, in write
>    result = super(mail_thread, self).write(cr, uid, ids, values, context=context)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 250, in wrapper
>    return old_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 372, in old_api
>    result = method(recs, *args, **kwargs)
>  File "/opt/odoo/addons/connector/connector/producer.py", line 62, in write
>    result = write_original(self, vals)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
>    return new_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3787, in write
>    self._write(old_vals)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
>    return new_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api
>    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 4039, in _write
>    recs.recompute()
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
>    return new_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5732, in recompute
>    rec._write(values)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
>    return new_api(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 565, in new_api
>    result = method(self._model, cr, uid, self.ids, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 3898, in _write
>    cr.execute(query, params + (sub_ids,))
>  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 158, in wrapper
>    return f(self, *args, **kwargs)
>  File "/usr/lib/python2.7/dist-packages/openerp/sql_db.py", line 234, in execute
>    res = self._obj.execute(query, params)
> TransactionRollbackError: could not serialize access due to concurrent update”
> 
> Any Ides on why the automator could run into a concurrent update?? I guess that’s the problem why my transactions are not completed.
> 
> Thanks,
> Michael
> 
>> On Mar 10, 2016, at 6:57 PM, Michael Aigner <michael@stilnest.com> wrote:
>> 
>> hi,
>> 
>> i have around 10000 open orders and stock pickings that are on status available. how can i mass process them? i guess the problem was that “Confirm and Close Picking” was not activated in the Automatic Workflow, which I changed now. Is there a way to batch process all of them?
>> 
>> thanks,
>> michael
> 

_______________________________________________
Mailing-List: http://odoo-community.org/groups/connectors-30
Post to: mailto:connectors@odoo-community.org
Unsubscribe: http://odoo-community.org/groups?unsubscribe

Reference