Issue 9992

Traceback if i try to enter a payment on an unsaved sale.
Nosy list
2cadz, ced, reviewbot, roundup-bot
Assigned to

Created on 2021-01-13.12:38:54 by 2cadz, last changed 2 months ago by roundup-bot.


New changeset c9f21b1d7cb2 by Cédric Krier in branch '5.8':
Manage missing attribute on sale in on_change_origin
New changeset f38ad30c6b0c by Cédric Krier in branch 'default':
Manage missing attribute on sale in on_change_origin
New changeset 009610ee7f1c by Cédric Krier in branch 'default':
Manage missing attribute on sale in on_change_origin
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-01-20.20:38:03

Indeed the on_change_origin method should not consider that all attribute of origin are available.

Author: [hidden] (2cadz)
Date: 2021-01-13.15:53:09

Ok it is not possible to make the payment of a draft sale :-) ... can be deactivate the button as long as the sale is not in the state or it is possible to enter a payment.

Author: [hidden] (2cadz)
Date: 2021-01-13.12:38:54

Tryton Version 5.9

To reproduce: On an new Tryton session, create a new sale, click on the 'payment' button, and in the new open view click on '+' to create a new payment:

Traceback (most recent call last):
  File "/trytond/model/", line 290, in __getattr__
    return self._values[name]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/trytond/", line 111, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/", line 48, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/", line 78, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/", line 186, in _dispatch
    result = rpc.result(meth(inst, *c_args, **c_kwargs))
  File "/trytond/model/", line 88, in wrapper
    result = func(self, *args, **kwargs)
  File "/trytond/model/fields/", line 118, in wrapper
    return func(self, *args, **kwargs)
  File "/trytond/modules/sale_payment/", line 47, in on_change_origin = sale.invoice_party or
  File "/trytond/model/", line 1443, in __getattr__
    return super(ModelStorage, self).__getattr__(name)
  File "/trytond/model/", line 293, in __getattr__
    % (self.__name__, name, self._values))
AttributeError: '' Model has no attribute 'invoice_party': None

Fault: '' Model has no attribute 'invoice_party': None
Date User Action Args
2021-01-28 23:00:04roundup-botsetkeyword: - backport
messages: + msg64150
2021-01-22 01:17:43cedsetkeyword: + backport
2021-01-22 01:17:06roundup-botsetmessages: + msg64030
2021-01-22 01:16:59roundup-botsetmessages: + msg64029
nosy: + roundup-bot
status: testing -> resolved
2021-01-20 22:16:24reviewbotsetmessages: + msg64008
nosy: + reviewbot
2021-01-20 22:04:14cedsetkeyword: + review
reviews: 355071002
status: in-progress -> testing
2021-01-20 20:38:03cedsetassignedto: ced
messages: + msg64007
nosy: + ced
status: unread -> in-progress
type: crash
2021-01-13 15:53:092cadzsetmessages: + msg63870
2021-01-13 12:38:542cadzcreate

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