Comment 3 for bug 1138698

Revision history for this message
Francisco Martinez (pxntium) wrote : Re: [Bug 1138698] Re: Problem closing POS session when exists a refund

Hello,
the problem is when the option "Group Journal entries" in POS configuration
is enabled. If the option is disabled then works fine.

Regards
Fran

2013/3/6 Twinkle Christian(OpenERP) <email address hidden>

> Hello Francisco Martinez,
>
> I have checked your issue with latest trunk as well as with 7.0, But I
> am not able to reproduce this issue. So, Would you please check it again
> with latest code and also provide me more information with video or
> image.
>
> I hope you understand.
>
> Thanks & Waiting for your Answer.. :)
>
> ** Changed in: openobject-addons
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1138698
>
> Title:
> Problem closing POS session when exists a refund
>
> Status in OpenERP Addons (modules):
> Incomplete
>
> Bug description:
> Hello all,
> this bug is related to OpenERP v7
> When you try to close a session that includes a refund, the system
> reports the following message error:
>
> ##################
> Constraint Error
>
> Wrong credit or debit value in accounting entry !
> ##################
>
> and the session can't be closed. The log shows the following:
>
> 2013-03-01 22:24:18,996 21492 ERROR None openerp.sql_db: bad query:
> insert into "account_move_line"
> (id,"account_id","company_id","currency_id","period_id","date_created","date","partner_id","move_id","blocked","tax_amount","product_id","centralisation","journal_id","name","tax_code_id","credit","state","debit","amount_currency","ref","quantity",create_uid,create_date,write_uid,write_date)
> values
> (28252,1158,'1',NULL,'4','2013-03-01','2013-03-01',NULL,10969,'False','43.65',407,'normal','1','PACK
> ARBOL
> NAVIDAD',8,'29.10','draft','14.55','0.00','POS/2013/03/07222','1.00',14,(now()
> at time zone 'UTC'),14,(now() at time zone 'UTC'))
> Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 227, in
> execute
> res = self._obj.execute(query, params)
> IntegrityError: el nuevo registro para la relación «account_move_line»
> viola la restricción check «account_move_line_credit_debit1»
>
> 2013-03-01 22:24:18,996 21492 ERROR None openerp.tools.safe_eval: Cannot
> eval u'wkf_action_close()'
> Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.7/openerp/tools/safe_eval.py", line
> 241, in safe_eval
> return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict,
> locals_dict)
> File "", line 1, in <module>
> File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 374, in
> function_proxy
> return attr(self._cr, self._uid, [self._id], *args, **kwargs)
> File
> "/usr/share/pyshared/openerp/addons/point_of_sale/point_of_sale.py", line
> 433, in wkf_action_close
> self._confirm_orders(cr, uid, ids, context=context)
> File
> "/usr/share/pyshared/openerp/addons/point_of_sale/point_of_sale.py", line
> 452, in _confirm_orders
> self.pool.get('pos.order')._create_account_move_line(cr, uid,
> order_ids, session, move_id, context=context)
> File
> "/usr/share/pyshared/openerp/addons/point_of_sale/point_of_sale.py", line
> 1101, in _create_account_move_line
> account_move_line_obj.create(cr, uid, value, context=context)
> File
> "/usr/share/pyshared/openerp/addons/account/account_move_line.py", line
> 1229, in create
> result = super(account_move_line, self).create(cr, uid, vals,
> context=context)
> File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4436, in
> create
> cr.execute('insert into "'+self._table+'" (id'+upd0+") values
> ("+str(id_new)+upd1+')', tuple(upd2))
> File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 162, in
> wrapper
> return f(self, *args, **kwargs)
> File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 227, in
> execute
> res = self._obj.execute(query, params)
> IntegrityError: el nuevo registro para la relación «account_move_line»
> viola la restricción check «account_move_line_credit_debit1»
>
> 2013-03-01 22:24:18,996 21492 ERROR None openerp.netsvc: Constraint Error
> Wrong credit or debit value in accounting entry !
> Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 289, in
> dispatch_rpc
> result = ExportService.getService(service_name).dispatch(method,
> params)
> File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py",
> line 614, in dispatch
> res = fn(db, uid, *params)
> File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 133, in
> wrapper
> tr(osv_pool._sql_error[key], 'sql_constraint') or inst[0])
> File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 72, in
> abort_response
> raise openerp.osv.osv.except_osv(description, details)
> except_osv: ('Constraint Error', 'Wrong credit or debit value in
> accounting entry !')
>
> If you deletes in pos_order the refund line, the session closes
> successfully.
>
>
> Regards
> Fran
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/1138698/+subscriptions
>