Issue 9992

Title
Traceback if i try to enter a payment on an unsaved sale.
Priority
bug
Status
resolved
Nosy list
2cadz, ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

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

Messages

New changeset c9f21b1d7cb2 by Cédric Krier in branch '5.8':
Manage missing attribute on sale in on_change_origin
https://hg.tryton.org/modules/sale_payment/rev/c9f21b1d7cb2
New changeset f38ad30c6b0c by Cédric Krier in branch 'default':
Manage missing attribute on sale in on_change_origin
https://hg.tryton.org/tryton-env/rev/f38ad30c6b0c
New changeset 009610ee7f1c by Cédric Krier in branch 'default':
Manage missing attribute on sale in on_change_origin
https://hg.tryton.org/modules/sale_payment/rev/009610ee7f1c
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/model.py", 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/wsgi.py", line 111, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 48, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 78, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 186, in _dispatch
    result = rpc.result(meth(inst, *c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 88, in wrapper
    result = func(self, *args, **kwargs)
  File "/trytond/model/fields/field.py", line 118, in wrapper
    return func(self, *args, **kwargs)
  File "/trytond/modules/sale_payment/account.py", line 47, in on_change_origin
    self.party = sale.invoice_party or sale.party
  File "/trytond/model/modelstorage.py", line 1443, in __getattr__
    return super(ModelStorage, self).__getattr__(name)
  File "/trytond/model/model.py", line 293, in __getattr__
    % (self.__name__, name, self._values))
AttributeError: 'sale.sale' Model has no attribute 'invoice_party': None

Fault: 'sale.sale' Model has no attribute 'invoice_party': None
History
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)