Tryton - Issues

 

Issue6680

Title generate invoice from consumption doesn't link with related invoice_line
Priority bug Status resolved
Superseder Nosy List ced, cypp, pokoli, reviewbot, roundup-bot
Type behavior Components sale_subscription
Assigned To cypp Keywords review
Reviews 41471002
View: 41471002

Created on 2017-07-27.09:06:38 by cypp, last changed by roundup-bot.

Messages
New changeset 828814d818d1 by Cyprien p in branch '4.4':
Save all consumptions
http://hg.tryton.org/modules/sale_subscription/rev/828814d818d1
New changeset 5b97c6d8ec15 by Cyprien p in branch 'default':
Save all consumptions
http://hg.tryton.org/modules/sale_subscription/rev/5b97c6d8ec15
review41471002 updated at https://codereview.tryton.org/41471002/#ps20001
review41471002 updated at https://codereview.tryton.org/41471002/#ps1
msg34828 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-07-27.09:46:23
Hi Cyprien, 

Thanks for reporting it. May you upload a patch as explainded on: 

http://www.tryton.org/how-to-contribute.html
msg34827 (view) Author: [hidden] (cypp) Date: 2017-07-27.09:06:38
I create a subscription with several lines, 
when invoices are generated from consumptions there is only one consumption updated with the related invoice_line.
the others are not updated (the invoice line exists but not linked with consumption).

i think this solve the problem :

--- a/subscription.py   Wed Jul 05 14:51:49 2017 +0200
+++ b/subscription.py   Thu Jul 27 09:03:12 2017 +0000
@@ -333,7 +333,7 @@
                     assert not consumption.invoice_line
                     consumption.invoice_line = invoice_line
                     all_consumptions.append(consumption)
-        Consumption.save(consumptions)
+        Consumption.save(all_consumptions)

         Invoice.update_taxes(all_invoices)
History
Date User Action Args
2017-09-15 19:53:25roundup-botsetmessages: + msg35664
2017-09-09 16:30:36roundup-botsetstatus: chatting -> resolved
nosy: + roundup-bot
messages: + msg35610
2017-07-29 23:33:24cedsetnosy: + ced
2017-07-27 16:09:50reviewbotsetmessages: + msg34848
2017-07-27 15:41:46reviewbotsetnosy: + reviewbot
messages: + msg34846
2017-07-27 15:28:57cyppsetreviews: 41471002
keyword: + review
2017-07-27 10:43:12cyppsetassignedto: cypp
2017-07-27 09:46:23pokolisetstatus: unread -> chatting
nosy: + pokoli
messages: + msg34828
2017-07-27 09:06:38cyppcreate

Showing 10 items. Show all history (warning: this could be VERY long)