Odoo Help

Welcome!

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.

0

Cannot close any POS session

By
Thierry Godin
on 6/17/13, 7:55 PM 3,754 views

Hi all,

I tried to make it to work, but after 3 days digging in the code, I cannot figure out why the POS session cannot be closed.

Here is the error I got each time :

2013-06-17 21:44:36,097 5724 ERROR None openerp.netsvc: __init__() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
  File "/opt/openerp/server/openerp/netsvc.py", line 236, in dispatch_rpc
    result = dispatch(method, params)
  File "/opt/openerp/server/openerp/service/model.py", line 27, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/server/openerp/service/model.py", line 100, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/server/openerp/service/model.py", line 171, in exec_workflow
    res = exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/opt/openerp/server/openerp/service/model.py", line 164, in exec_workflow_cr
    return object.signal_workflow(cr, uid, [res_id], signal)[res_id]
  File "/opt/openerp/server/openerp/osv/orm.py", line 3938, in signal_workflow
    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
  File "/opt/openerp/server/openerp/workflow/__init__.py", line 106, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/opt/openerp/server/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 106, in _execute
    returned_action = wkf_expr.execute(cr, ident, workitem, activity)
  File "/opt/openerp/server/openerp/workflow/wkf_expr.py", line 67, in execute
    return _eval_expr(cr, ident, workitem, activity['action'])
  File "/opt/openerp/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
    ret = eval(line, env, nocopy=True)
  File "/opt/openerp/server/openerp/tools/safe_eval.py", line 244, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/server/openerp/osv/orm.py", line 371, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/kalidev/point_of_sale/point_of_sale.py", line 432, in wkf_action_close
    getattr(st, 'button_confirm_%s' % st.journal_id.type)(context=context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 371, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/addons/account/account_cash_statement.py", line 289, in button_confirm_cash
    super(account_cash_statement, self).button_confirm_bank(cr, uid, ids, context=context)
  File "/opt/openerp/addons/account/account_bank_statement.py", line 428, in button_confirm_bank
    self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context)
  File "/opt/openerp/addons/account_voucher/account_voucher.py", line 1532, in create_move_from_st_line
    return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line.id, company_currency_id, next_number, context=context)
  File "/opt/openerp/addons/account/account_bank_statement.py", line 356, in create_move_from_st_line
    move_line_id = account_move_line_obj.create(cr, uid, bank_move_vals, context=context)
  File "/opt/openerp/addons/account/account_move_line.py", line 1226, in create
    result = super(account_move_line, self).create(cr, uid, vals, context=context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 4492, in create
    self._validate(cr, user, [id_new], context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 1541, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
TypeError: __init__() takes exactly 3 arguments (2 given)

OpenERP v7.0 on Debian.

I created 8 companies, 8 POS , 8 shops, 8 POS managers, Using currency = EU

Another time, I got this error :

2013-06-17 21:35:39,192 5383 WARNING None openerp.osv.orm: Access Denied by record rules for operation: read, uid: 19, model: account.account
2013-06-17 21:35:39,194 5383 ERROR None openerp.netsvc: __init__() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
  File "/opt/openerp/server/openerp/netsvc.py", line 236, in dispatch_rpc
    result = dispatch(method, params)
  File "/opt/openerp/server/openerp/service/model.py", line 27, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/server/openerp/service/model.py", line 100, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/server/openerp/service/model.py", line 171, in exec_workflow
    res = exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/opt/openerp/server/openerp/service/model.py", line 164, in exec_workflow_cr
    return object.signal_workflow(cr, uid, [res_id], signal)[res_id]
  File "/opt/openerp/server/openerp/osv/orm.py", line 3938, in signal_workflow
    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
  File "/opt/openerp/server/openerp/workflow/__init__.py", line 106, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/opt/openerp/server/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 106, in _execute
    returned_action = wkf_expr.execute(cr, ident, workitem, activity)
  File "/opt/openerp/server/openerp/workflow/wkf_expr.py", line 67, in execute
    return _eval_expr(cr, ident, workitem, activity['action'])
  File "/opt/openerp/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
    ret = eval(line, env, nocopy=True)
  File "/opt/openerp/server/openerp/tools/safe_eval.py", line 244, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/server/openerp/osv/orm.py", line 371, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/kalidev/point_of_sale/point_of_sale.py", line 433, in wkf_action_close
    self._confirm_orders(cr, uid, ids, context=context)
  File "/opt/openerp/kalidev/point_of_sale/point_of_sale.py", line 451, in _confirm_orders
    self.pool.get('pos.order')._create_account_move_line(cr, uid, order_ids, session, move_id, context=context)
  File "/opt/openerp/kalidev/point_of_sale/point_of_sale.py", line 1088, in _create_account_move_line
    account_move_line_obj.create(cr, uid, value, context=context)
  File "/opt/openerp/addons/account/account_move_line.py", line 1226, in create
    result = super(account_move_line, self).create(cr, uid, vals, context=context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 4338, in create
    vals = self._add_missing_default_values(cr, user, vals, context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 2484, in _add_missing_default_values
    defaults = self.default_get(cr, uid, missing_defaults, context)
  File "/opt/openerp/addons/account/account_move_line.py", line 163, in default_get
    data = self._default_get(cr, uid, fields, context=context)
  File "/opt/openerp/addons/account/account_move_line.py", line 287, in _default_get
    if account and account.currency_id:
  File "/opt/openerp/server/openerp/osv/orm.py", line 481, in __getattr__
    return self[name]
  File "/opt/openerp/server/openerp/osv/orm.py", line 396, in __getitem__
    field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
  File "/opt/openerp/server/openerp/osv/orm.py", line 3601, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/opt/openerp/server/openerp/osv/orm.py", line 3656, in _read_flat
    self._check_record_rules_result_count(cr, user, sub_ids, result_ids, 'read', context=context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 3859, in _check_record_rules_result_count
    (self._description, operation))
TypeError: __init__() takes exactly 3 arguments (2 given)

I also tried to close the sessions as Admin, but nothing changed I Googled a lot but found nothing relevant.

Could somebody help me, please ?

(my apologies for spelling, my native language is french)

not so bad your english:) A part from this comment, I can't help you as I am not a technician; but for sure someone will help you solve your issue. Courage!

AD LIBITOM, michel Guénard
on 6/17/13, 9:07 PM
0
tinteypelo
On 9/8/15, 1:59 PM

Hi Thierry,

have you solved the problem? If yes, how? I have the same problem now.

Thanks.

0
Thierry Godin
On 6/21/13, 6:45 PM

Hi all,

Yesterday, I have completelly reinstalled OpenERP, created a new database. Created companies, users, shops, warehouses, accounts, and POS. I recreated all the products, all the partners ..

All was fine, I was abble to open a session in all of the POS (i have 8), I was abble to purchase products, and finally i was abble to close all sessions without any problems.

But today, our Customers have used the POS all the day, they have sold a lot of products, and now, they cannot close their sessions.

Cashes balances are fine, all the orders are "Paid"

Here is the message I got in log file :

2013-06-21 20:40:20,590 24442 ERROR None openerp.netsvc: __init__() takes exactly 3 arguments (2 given)
Traceback (most recent call last):
  File "/opt/openerp/server/openerp/netsvc.py", line 236, in dispatch_rpc
    result = dispatch(method, params)
  File "/opt/openerp/server/openerp/service/model.py", line 27, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/server/openerp/service/model.py", line 100, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/openerp/server/openerp/service/model.py", line 171, in exec_workflow
    res = exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/opt/openerp/server/openerp/service/model.py", line 164, in exec_workflow_cr
    return object.signal_workflow(cr, uid, [res_id], signal)[res_id]
  File "/opt/openerp/server/openerp/osv/orm.py", line 3938, in signal_workflow
    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
  File "/opt/openerp/server/openerp/workflow/__init__.py", line 106, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/opt/openerp/server/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/opt/openerp/server/openerp/workflow/workitem.py", line 106, in _execute
    returned_action = wkf_expr.execute(cr, ident, workitem, activity)
  File "/opt/openerp/server/openerp/workflow/wkf_expr.py", line 67, in execute
    return _eval_expr(cr, ident, workitem, activity['action'])
  File "/opt/openerp/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
    ret = eval(line, env, nocopy=True)
  File "/opt/openerp/server/openerp/tools/safe_eval.py", line 244, in safe_eval
    return eval(c, globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/opt/openerp/server/openerp/osv/orm.py", line 371, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/opt/openerp/kalidev/point_of_sale/point_of_sale.py", line 433, in wkf_action_close
    self._confirm_orders(cr, uid, ids, context=context)
  File "/opt/openerp/kalidev/point_of_sale/point_of_sale.py", line 451, in _confirm_orders
    self.pool.get('pos.order')._create_account_move_line(cr, uid, order_ids, session, move_id, context=context)
  File "/opt/openerp/kalidev/point_of_sale/point_of_sale.py", line 1088, in _create_account_move_line
    account_move_line_obj.create(cr, uid, value, context=context)
  File "/opt/openerp/addons/account/account_move_line.py", line 1229, in create
    result = super(account_move_line, self).create(cr, uid, vals, context=context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 4492, in create
    self._validate(cr, user, [id_new], context)
  File "/opt/openerp/server/openerp/osv/orm.py", line 1541, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
TypeError: __init__() takes exactly 3 arguments (2 given)

In one session, there are only 78 lines of orders. That should work, ist'nt it ?

Could someone tell me how to solve this problem please ? Thank you very much

0
Chun Sing
On 7/16/13, 7:35 AM

Hi Thierry,

Maybe the problem is with refunding of pos orders.

To get it to work, you can unchecked the option Group Journal Items, in Point of Sale > Configuration > Point of Sales.

Hope this can solve the problem.

Thank you for reply, But I already unchecked this option.

But now, after multiple hours of investigations, it seems that the former dev team (that worked on openerp project in my company) has dropped the last version of point_of_sale module into an old v6.1 openerp. Because after comparying files of each package, i found a ton of changes ...

Thank you anyway

Thierry Godin
on 7/16/13, 8:18 AM

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

0 follower(s)

Stats

Asked: 6/17/13, 7:55 PM
Seen: 3754 times
Last updated: 9/8/15, 1:59 PM