1. I have downloaded the point_of_sale.py from the rev 8792
2. Restarted the Openerp server
3. Create a new session in POS
4. Making 3 orders
5. Refund the second order
6. Try to close the session, and I have the same error
The log says:
2013-04-23 21:02:56,825 10212 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
(164226,1158,'1',NULL,'5','2013-04-23','2013-04-23',NULL,43162,'False','5.64',863,'normal','1','PIRULETA
ARBOL
LECHE',8,'2.82','draft','2.82','0.00','POS/2013/04/29332','0.00',15,(now()
at time zone 'UTC'),15,(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-04-23 21:02:56,826 10212 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 435, 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 454, 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 1110, in _create_account_move_line
self.pool.get("account.move").write(cr, uid, [move_id],
{'line_id':all_lines}, context=context)
File "/usr/share/pyshared/openerp/addons/account/account.py", line 1339,
in write
result = super(account_move, self).write(cr, uid, ids, vals, c)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4180, in
write
result += self._columns[field].set(cr, self, id, field, vals[field],
user, context=rel_context) or []
File "/usr/lib/pymodules/python2.7/openerp/osv/fields.py", line 557, in
set
id_new = obj.create(cr, user, act[2], 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-04-23 21:02:56,828 10212 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 !')
It's possible that I have wrong other thing?
Thanks in advance.
Regards
Fran
2013/4/23 Ravi Gohil (OpenERP) <email address hidden>
> ** Attachment added: "journal_items_for_session_main_00003.png"
>
> https://bugs.launchpad.net/openobject-addons/+bug/1127114/+attachment/3651320/+files/journal_items_for_session_main_00003.png
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1138698).
> https://bugs.launchpad.net/bugs/1127114
>
> Title:
> [Trunk/7.0]: Returning products causing credit - debit value error
>
> Status in OpenERP Addons (modules):
> Fix Committed
>
> Bug description:
> Hello,
>
> Also tested on latest runbot for 7.0 (built 3921)
>
> Crete some sales in one pos session.
> When you return a product using the Point of Sales - Orders list. Choose
> a previous POS order ref of that day, return a product, pay it back (it
> proposes a negative saldo which seems to be correct).
>
> At the end of your session when you want to close and post your
> session to the sales journal it gives you an error:
>
> "Constraint Error - Wrong credit or debit value in accounting entry !"
>
> When you have a session without returning products it seems to work
> fine, even with taking money in or out your session using the
> corresponding buttons.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/1127114/+subscriptions
>
Hi Ravi,
I think I'm doing something wrong:
1. I have downloaded the point_of_sale.py from the rev 8792
2. Restarted the Openerp server
3. Create a new session in POS
4. Making 3 orders
5. Refund the second order
6. Try to close the session, and I have the same error
The log says: id","company_ id","currency_ id","period_ id","date_ created" ,"date" ,"partner_ id","move_ id","blocked" ,"tax_amount" ,"product_ id","centralisa tion"," journal_ id","name" ,"tax_code_ id","credit" ,"state" ,"debit" ,"amount_ currency" ,"ref", "quantity" ,create_ uid,create_ date,write_ uid,write_ date) 1158,'1' ,NULL,' 5','2013- 04-23', '2013-04- 23',NULL, 43162,' False', '5.64', 863,'normal' ,'1','PIRULETA 8,'2.82' ,'draft' ,'2.82' ,'0.00' ,'POS/2013/ 04/29332' ,'0.00' ,15,(now( ) pymodules/ python2. 7/openerp/ sql_db. py", line 227, in execute( query, params) move_line_ credit_ debit1»
2013-04-23 21:02:56,825 10212 ERROR None openerp.sql_db: bad query: insert
into "account_move_line"
(id,"account_
values
(164226,
ARBOL
LECHE',
at time zone 'UTC'),15,(now() at time zone 'UTC'))
Traceback (most recent call last):
File "/usr/lib/
execute
res = self._obj.
IntegrityError: el nuevo registro para la relación «account_move_line»
viola la restricción check «account_
2013-04-23 21:02:56,826 10212 ERROR None openerp. tools.safe_ eval: Cannot close() ' pymodules/ python2. 7/openerp/ tools/safe_ eval.py" , line 241, expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, pymodules/ python2. 7/openerp/ osv/orm. py", line 374, in pyshared/ openerp/ addons/ point_of_ sale/point_ of_sale. py", _confirm_ orders( cr, uid, ids, context=context) pyshared/ openerp/ addons/ point_of_ sale/point_ of_sale. py", pool.get( 'pos.order' )._create_ account_ move_line( cr, uid, pyshared/ openerp/ addons/ point_of_ sale/point_ of_sale. py", account_ move_line pool.get( "account. move"). write(cr, uid, [move_id], id':all_ lines}, context=context) pyshared/ openerp/ addons/ account/ account. py", line 1339, pymodules/ python2. 7/openerp/ osv/orm. py", line 4180, in field]. set(cr, self, id, field, vals[field], rel_context) or [] pymodules/ python2. 7/openerp/ osv/fields. py", line 557, in pyshared/ openerp/ addons/ account/ account_ move_line. py", move_line, self).create(cr, uid, vals, pymodules/ python2. 7/openerp/ osv/orm. py", line 4436, in execute( 'insert into "'+self._table+'" (id'+upd0+") values id_new) +upd1+' )', tuple(upd2)) pymodules/ python2. 7/openerp/ sql_db. py", line 162, in pymodules/ python2. 7/openerp/ sql_db. py", line 227, in execute( query, params) move_line_ credit_ debit1»
eval u'wkf_action_
Traceback (most recent call last):
File "/usr/lib/
in safe_eval
return eval(test_
locals_dict)
File "", line 1, in <module>
File "/usr/lib/
function_proxy
return attr(self._cr, self._uid, [self._id], *args, **kwargs)
File "/usr/share/
line 435, in wkf_action_close
self.
File "/usr/share/
line 454, in _confirm_orders
self.
order_ids, session, move_id, context=context)
File "/usr/share/
line 1110, in _create_
self.
{'line_
File "/usr/share/
in write
result = super(account_move, self).write(cr, uid, ids, vals, c)
File "/usr/lib/
write
result += self._columns[
user, context=
File "/usr/lib/
set
id_new = obj.create(cr, user, act[2], context=context)
File "/usr/share/
line 1229, in create
result = super(account_
context=context)
File "/usr/lib/
create
cr.
("+str(
File "/usr/lib/
wrapper
return f(self, *args, **kwargs)
File "/usr/lib/
execute
res = self._obj.
IntegrityError: el nuevo registro para la relación «account_move_line»
viola la restricción check «account_
2013-04-23 21:02:56,828 10212 ERROR None openerp.netsvc: Constraint Error pymodules/ python2. 7/openerp/ netsvc. py", line 289, in getService( service_ name).dispatch( method, params) pymodules/ python2. 7/openerp/ service/ web_services. py", line pymodules/ python2. 7/openerp/ osv/osv. py", line 133, in osv_pool. _sql_error[ key], 'sql_constraint') or inst[0]) pymodules/ python2. 7/openerp/ netsvc. py", line 72, in osv.osv. except_ osv(description , details)
Wrong credit or debit value in accounting entry !
Traceback (most recent call last):
File "/usr/lib/
dispatch_rpc
result = ExportService.
File "/usr/lib/
614, in dispatch
res = fn(db, uid, *params)
File "/usr/lib/
wrapper
tr(
File "/usr/lib/
abort_response
raise openerp.
except_osv: ('Constraint Error', 'Wrong credit or debit value in accounting
entry !')
It's possible that I have wrong other thing?
Thanks in advance.
Regards
Fran
2013/4/23 Ravi Gohil (OpenERP) <email address hidden>
> ** Attachment added: "journal_ items_for_ session_ main_00003. png" /bugs.launchpad .net/openobject -addons/ +bug/1127114/ +attachment/ 3651320/ +files/ journal_ items_for_ session_ main_00003. png /bugs.launchpad .net/bugs/ 1127114 /bugs.launchpad .net/openobject -addons/ +bug/1127114/ +subscriptions
>
> https:/
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1138698).
> https:/
>
> Title:
> [Trunk/7.0]: Returning products causing credit - debit value error
>
> Status in OpenERP Addons (modules):
> Fix Committed
>
> Bug description:
> Hello,
>
> Also tested on latest runbot for 7.0 (built 3921)
>
> Crete some sales in one pos session.
> When you return a product using the Point of Sales - Orders list. Choose
> a previous POS order ref of that day, return a product, pay it back (it
> proposes a negative saldo which seems to be correct).
>
> At the end of your session when you want to close and post your
> session to the sales journal it gives you an error:
>
> "Constraint Error - Wrong credit or debit value in accounting entry !"
>
> When you have a session without returning products it seems to work
> fine, even with taking money in or out your session using the
> corresponding buttons.
>
> To manage notifications about this bug go to:
> https:/
>