Tryton - Issues

 

Issue8751

Title Cannot create commission for agent without a plan
Priority bug Status resolved
Superseder Nosy List ced, pokoli, resteve, reviewbot, roundup-bot
Type crash Components commission
Assigned To pokoli Keywords review
Reviews 319201002
View: 319201002

Created on 2019-10-22.14:54:04 by resteve, last changed by roundup-bot.

Messages
New changeset 777d84e39d6c by Sergi Almacellas Abellana in branch 'default':
Make currency required on agent
https://hg.tryton.org/tryton-env/rev/777d84e39d6c
New changeset 125801867e0b by Sergi Almacellas Abellana in branch 'default':
Make currency required on agent
https://hg.tryton.org/modules/commission/rev/125801867e0b
review319201002 updated at https://codereview.tryton.org/319201002/#ps317261003
review319201002 updated at https://codereview.tryton.org/319201002/#ps321181002
review319201002 updated at https://codereview.tryton.org/319201002/#ps319211002
msg57188 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-04-15.19:50:08
I've uploaded review319201002 make currency required on plan and fixes all the comments of review284291002
review284291002 updated at https://codereview.tryton.org/284291002/#ps250141002
msg52638 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-23.01:23:06
I think only agent with plan should be allowed on commission.
msg52617 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-10-22.15:40:32
Probably we can use the company currency if the plan does not have any currency set
msg52611 (view) Author: [hidden] (resteve) Date: 2019-10-22.14:54:03
1. Create an agent without plan (currency field is invisible)
2. Create a commission with an agent without plan:

Traceback (most recent call last):
File "/trytond/wsgi.py", line 104, 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 72, 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 191, in _dispatch
result = rpc.result(meth(inst, *c_args, **c_kwargs))
File "/trytond/model/modelview.py", line 735, in on_change_with
changes[fieldname] = getattr(self, method_name)()
File "/trytond/model/fields/field.py", line 117, in wrapper
return func(self, *args, **kwargs)
File "/trytond/modules/commission/commission.py", line 279, in on_change_with_currency
return self.agent.currency.id
AttributeError: 'NoneType' object has no attribute 'id'

...because agent has not currency.
History
Date User Action Args
2020-04-20 14:04:03roundup-botsetmessages: + msg57330
2020-04-20 14:03:54roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg57329
2020-04-19 12:33:25reviewbotsetmessages: + msg57294
2020-04-18 14:35:39reviewbotsetmessages: + msg57266
2020-04-15 20:06:06reviewbotsetmessages: + msg57189
2020-04-15 19:50:08pokolisetreviews: 284291002 -> 319201002
assignedto: resteve -> pokoli
messages: + msg57188
2019-10-25 00:08:13cedsetstatus: chatting -> testing
assignedto: resteve
2019-10-24 15:53:41reviewbotsetnosy: + reviewbot
messages: + msg52663
2019-10-24 15:49:14restevesetreviews: 284291002
keyword: + review
2019-10-23 01:23:06cedsetnosy: + ced
messages: + msg52638

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