This question has been flagged

i create a function for field called v_neuf that's contain a value of this field (aquisition_date) bytheway v_neuf it's a compute field  & when when i update the app fleet vehicule everythings work fine until i try to open the app i get this error message :

Odoo Server Error
Traceback (most recent call last):
  File "/home/odoo/odoo/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/odoo/odoo/http.py", line 312, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/odoo/odoo/odoo/http.py", line 696, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/odoo/odoo/http.py", line 344, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/odoo/odoo/http.py", line 337, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/odoo/odoo/http.py", line 939, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/odoo/odoo/http.py", line 517, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/odoo/addons/web/controllers/main.py", line 962, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/odoo/addons/web/controllers/main.py", line 954, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/odoo/odoo/api.py", line 745, in call_kw
    return _call_kw_model(method, model, args, kwargs)
  File "/home/odoo/odoo/odoo/api.py", line 718, in _call_kw_model
    result = method(recs, *args, **kwargs)
  File "/home/odoo/odoo/odoo/models.py", line 2070, in read_group
    result = self._read_group_raw(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
  File "/home/odoo/odoo/odoo/models.py", line 2206, in _read_group_raw
    aggregated_fields, count_field, result, read_group_order=order,
  File "/home/odoo/odoo/odoo/models.py", line 1727, in _read_group_fill_results
    groups = getattr(self, field.group_expand)(groups, domain, order)
AttributeError: 'fleet.vehicle' object has no attribute '_read_group_stage_ids'

Avatar
Discard
Best Answer

Hi,

You might be calling some function as compute of the field and you might not define the function which is called, Check whether the _read_group_stage_ids has called in compute attribute of a filed and see. Or just search for the _read_group_stage_ids in your custom code.


Thanks

Avatar
Discard
Author Best Answer

Thank you So much i fix the problem , i have one another question about how to get date at this moment is there any function in odoo like date.now() ior something like that beacause i have a compute field and i need it to make dvision between aquisition date wich a field that i have and date.now() 

Example : 

date_now= ???? function to get date .now 

Duree_ct = ((aquisition_date - date_now).days / 30)

Avatar
Discard

use datetime.now().date() to get the current date