Select origin in stock move has no attribute 'unit'
Scenario:
1- Edit a Stock Shipment Out
2- In outgoing moves, edit origin field and select "Sale line" or "Purchase Line" in selector (reference field).
Purchase Line traceback:
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 679, in on_change_with
changes[fieldname] = getattr(self, method_name)()
File "/trytond/model/fields/field.py", line 113, in wrapper
return func(self, *args, **kwargs)
File "/trytond/modules/sale/stock.py", line 186, in on_change_with_product_uom_category
name=name)
File "/trytond/model/fields/field.py", line 113, in wrapper
return func(self, *args, **kwargs)
File "/trytond/modules/purchase/stock.py", line 298, in on_change_with_product_uom_category
if isinstance(self.origin, PurchaseLine) and self.origin.unit:
File "/trytond/model/modelstorage.py", line 1259, in __getattr__
return super(ModelStorage, self).__getattr__(name)
File "/trytond/model/model.py", line 389, in __getattr__
% (self.__name__, name, self._values))
AttributeError: 'purchase.line' Model has no attribute 'unit': None
Sale Line traceback:
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 679, in on_change_with
changes[fieldname] = getattr(self, method_name)()
File "/trytond/model/fields/field.py", line 113, in wrapper
return func(self, *args, **kwargs)
File "/trytond/modules/sale/stock.py", line 189, in on_change_with_product_uom_category
if isinstance(self.origin, SaleLine) and self.origin.unit:
File "/trytond/model/modelstorage.py", line 1259, in __getattr__
return super(ModelStorage, self).__getattr__(name)
File "/trytond/model/model.py", line 389, in __getattr__
% (self.__name__, name, self._values))
AttributeError: 'sale.line' Model has no attribute 'unit': None