Issue 10138

Title
unsupported operand type(s) for +: 'int' and 'NoneType'
Priority
bug
Status
testing
Nosy list
ced, deathrake, reviewbot
Assigned to
ced
Keywords
review

Created on 2021-02-28.08:49:26 by deathrake, last changed 2 days ago by reviewbot.

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-04-07.23:54:10

Here is review341981002 which should solve the problem.

Author: [hidden] (deathrake)
Date: 2021-02-28.08:49:24
1 139944508585728 [2021-02-28 05:04:36,808] ERROR trytond.ir.cron Running cron 10
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/trytond/ir/cron.py", line 134, in run
    cron.run_once()
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/descriptors.py", line 31, in newfunc
    return self.func(owner, [instance], *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/modelview.py", line 740, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/modules/company/ir.py", line 99, in run_once
    super(Cron, cls).run_once([cron])
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/descriptors.py", line 33, in newfunc
    return self.func(owner, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/model/modelview.py", line 740, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/trytond/ir/cron.py", line 114, in run_once
    getattr(Model, method)()
  File "/usr/local/lib/python3.7/dist-packages/trytond/modules/sale_subscription/subscription.py", line 377, in generate_invoice
    consumptions, invoice)
  File "/usr/local/lib/python3.7/dist-packages/trytond/modules/sale_subscription/subscription.py", line 885, in get_invoice_lines
    line.quantity = sum(c.quantity for c in sub_consumptions)
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

Steps to reproduce

  1. Create Sale Subscription
  2. Create Line consumption
  3. Create Subscription Invoice Wizard
History
Date User Action Args
2021-04-08 10:50:18reviewbotsetmessages: + msg66173
2021-04-08 00:12:00reviewbotsetmessages: + msg66166
nosy: + reviewbot
2021-04-07 23:54:10cedsetkeyword: + review
messages: + msg66165
reviews: 341981002
status: in-progress -> testing
2021-04-07 23:53:14cedsetassignedto: ced
nosy: + ced
status: unread -> in-progress
2021-02-28 10:51:05cedsetcomponent: + sale_subscription
title: bug in subscription invoice consumpution wizard -> unsupported operand type(s) for +: 'int' and 'NoneType'
type: crash
2021-02-28 08:49:26deathrakecreate

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