Tryton - Issues

 

Issue7653

Title Possible to fill invalid values when creating record for a m2o
Priority bug Status closed
Superseder Nosy List andres.politi, ced
Type behavior Components
Assigned To Keywords
Reviews

Created on 2018-08-27.15:20:27 by andres.politi, last changed by ced.

Messages
msg44014 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-09-21.21:58:52
So I close it.
msg43105 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-08-27.15:39:05
This is an expected behavior because the domain on product are not reported to the template. I do not think we want to fix that because it will remove the possibility to override template fields on product.
msg43104 (view) Author: [hidden] (andres.politi) Date: 2018-08-27.15:20:27
In previous versions, if a many2one field have a domain, when creating a new record from the create option of the many2one, the fields affected by the domain would be autocompleted and readonly. 
In 4.8.2 this no longer happens and it's possible to fill invalid values.
Example: 
-Create a new project
-In the product many2one field, create a new product
-Create a product with a unit of measure of type != time
-Press save in the product window

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 71, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 41, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 42, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 122, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 172, in _dispatch
    result = rpc.result(meth(inst, *c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 671, in on_change
    method()
  File "/trytond/model/modelview.py", line 84, in wrapper
    result = func(self, *args, **kwargs)
  File "/trytond/model/fields/field.py", line 114, in wrapper
    return func(self, *args, **kwargs)
  File "/trytond/modules/project_revenue/work.py", line 195, in on_change_product
    self.product.list_price, hour_uom)
  File "/trytond/modules/product/uom.py", line 250, in compute_price
    % (from_uom.category.name, to_uom.category.name))
ValueError: cannot convert between Unidades and Tiempo

This was tested in the desktop client in windows, linux, and in Sao.
History
Date User Action Args
2018-09-21 21:58:52cedsetstatus: chatting -> closed
messages: + msg44014
2018-08-27 15:39:05cedsetstatus: unread -> chatting
nosy: + ced
messages: + msg43105
2018-08-27 15:20:27andres.politicreate

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