On 2017-05-16 09:02, Cédric Krier wrote: > 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.
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 > [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: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/20170524143007.GB13073%40tetsuo.
