Skip to Content
Menu
This question has been flagged
3 Replies
2007 Views

Hey guys, I am new to Odoo. I have installed the Fleet Management App that is built in Odoo 10. I also installed the app Freight Management system. https://www.odoo.com/apps/modules/9.0/tms/ (Except v10.0 of course). When I have everything installed and all the dependency I get this error when  I attempted to create a vehicle.


Traceback (most recent call last):


  File "/opt/odoo/odoo-10.0/odoo/http.py", line 640, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/opt/odoo/odoo-10.0/odoo/http.py", line 677, in dispatch

    result = self._call_function(**self.params)

  File "/opt/odoo/odoo-10.0/odoo/http.py", line 333, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/opt/odoo/odoo-10.0/odoo/service/model.py", line 101, in wrapper

    return f(dbname, *args, **kwargs)

  File "/opt/odoo/odoo-10.0/odoo/http.py", line 326, in checked_call

    result = self.endpoint(*a, **kw)

  File "/opt/odoo/odoo-10.0/odoo/http.py", line 935, in __call__

    return self.method(*args, **kw)

  File "/opt/odoo/odoo-10.0/odoo/http.py", line 506, in response_wrap

    response = f(*args, **kw)

  File "/opt/odoo/odoo-10.0/addons/web/controllers/main.py", line 885, in call_kw

    return self._call_kw(model, method, args, kwargs)

  File "/opt/odoo/odoo-10.0/addons/web/controllers/main.py", line 877, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/opt/odoo/odoo-10.0/odoo/api.py", line 689, in call_kw

    return call_kw_multi(method, model, args, kwargs)

  File "/opt/odoo/odoo-10.0/odoo/api.py", line 680, in call_kw_multi

    result = method(recs, *args, **kwargs)

  File "/opt/odoo/odoo-10.0/odoo/models.py", line 5505, in onchange

    newval = record[name]

  File "/opt/odoo/odoo-10.0/odoo/models.py", line 5210, in __getitem__

    return self._fields[key].__get__(self, type(self))

  File "/opt/odoo/odoo-10.0/odoo/fields.py", line 872, in __get__

    self.determine_draft_value(record)

  File "/opt/odoo/odoo-10.0/odoo/fields.py", line 993, in determine_draft_value

    self._compute_value(record)

  File "/opt/odoo/odoo-10.0/odoo/fields.py", line 927, in _compute_value

    getattr(records, self.compute)()

  File "/opt/odoo/odoo-10.0/addons/fleet/models/fleet.py", line 191, in _compute_vehicle_name

    record.name = record.model_id.brand_id.name + '/' + record.model_id.name + '/' + record.license_plate

TypeError: unsupported operand type(s) for +: 'bool' and 'str'

 

Can I get some fixing this issue. And it doesn't matter when I try to add the Vehicle from. 

Avatar
Discard

@niyas, has given the correct answer, I'm agree with that. when we concate any two or more than two fields value, then Make sure those field has the value otherwise it will raise the following error, TypeError: unsupported operand type(s) for +: 'bool' and

'str'. Just improve the existing code with some checks on the fields which are get contacted.

Best Answer

Hi,

The default fleet module have no any error. The error comes from the the other module that you have taken from the git.

record.name = record.model_id.brand_id.name + '/' + record.model_id.name + '/' +record.license_plate

The error says that , in the above operation , any of the field have no values in it. So while trying to do concatenation, the field will return the value as False.

that is why this error,  unsupported operand type(s) for +: 'bool' and 'str'

So what you have to do is, uninstall the module that you have taken from the git and make sure that there is no error in the original fleet.

Then later, install the module again and make necessary changes in the above compute function, rather than directly concatenate , first check whether the variable has value in it or not. Add such a condition and do it.

Thanks

Avatar
Discard
Best Answer

Hi,
Your Odoo version is 10.
and you install a v9 module in it.
The module may be install, but it will not work properly.
Please install Modules that are in the same version. else your system gets damaged.
If you want the v10 version of the module that you installed, please contact the providers of that module or any Odoo partners.

 

Thank you.

Avatar
Discard
Author Best Answer

So I have done that, Fleet works perfectly on its own, but the minute I install Freight, its when the issue starts occurring. I will re attempt to install v9 I just never have luck doing so. And try it there. Maybe its not ready to be on v10

Avatar
Discard

You did not mention that in your question.Right?

How could I know that module you get is from git without mention that in your question?

Try the answer given from Niyas Raphy. it may help you.

Thank you.