Cannot post an invoice - "already reconciled"

30 views
Skip to first unread message

Mark Shane Hayden

unread,
May 14, 2017, 6:19:26 PM5/14/17
to tryton
Hi all,

I have an invoice I cannot post--not sure if it is a bug or that I am fllowing the wrong procedure.

Here is the scenario:

  1. a customer orders two products, sale is processed to completion but one was the incorrect size
  2. I create a return sale from the original sale, then I remove the item the customer is keeping from the return sale, then add a new item of the correct size, so this sale has two line items:  "Item B Size Small" with quantity -1 and "Item B size Large" quantity 1.  Because the sizes are all the same price the net amount is zero.
  3. I process the return/exchange sale.  A $0 invoice is made as a result, but when I go to post it I get a "line already reconciled" error.  There are no lines in the database for this invoice so obviously the line in question was a newly created line that was rolled back in a failed transaction.
Why would newly created lines be reconciled and how do I fix this?  Should I not have an invoice at all since it is $0, and what do I give the customer as a record of the exchange if I do not have a posted invoice?

Thanks in advance...

Cédric Krier

unread,
May 16, 2017, 3:05:11 AM5/16/17
to tryton
On 2017-05-14 15:19, Mark Shane Hayden wrote:
> Hi all,
>
> I have an invoice I cannot post--not sure if it is a bug or that I am
> fllowing the wrong procedure.
>
> Here is the scenario:
>
>
> 1. a customer orders two products, sale is processed to completion but
> one was the incorrect size
> 2. I create a return sale from the original sale, then I remove the item
> the customer is keeping from the return sale, then add a new item of the
> correct size, so this sale has two line items: "Item B Size Small" with
> quantity -1 and "Item B size Large" quantity 1. Because the sizes are all
> the same price the net amount is zero.
> 3. I process the return/exchange sale. A $0 invoice is made as a
> result, but when I go to post it I get a "line already reconciled" error.
> There are no lines in the database for this invoice so obviously the line
> in question was a newly created line that was rolled back in a failed
> transaction.
>
> Why would newly created lines be reconciled and how do I fix this? Should
> I not have an invoice at all since it is $0, and what do I give the
> customer as a record of the exchange if I do not have a posted invoice?

Indeed the automatic reconciliation of "zero" lines does not check if
the line is not yet reconciled [1].

What is strange is that it is a newly created move so its lines should
not be already reconciled. But I think the issue6184 [2] is also part of it.

And by the way, the reconciliation could be done outside the loop for
performance if we add the uniqueness check of the list of moves.

[1] http://hg.tryton.org/modules/account/file/c8829bb311a2/move.py#l421
[2] https://bugs.tryton.org/issue6184
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Cédric Krier

unread,
May 24, 2017, 10:35:08 AM5/24/17
to tryton
Also if you are using sale_payment module, I just uploaded a fix that
was showing a similar error: https://tryton-rietveld.appspot.com/37371002/#ps150001
Reply all
Reply to author
Forward
0 new messages