İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
3646 Görünümler

Hello,

I´m getting this error, and I don´t have a clue what trigger it.

Error:

Odoo Server Error


Traceback (most recent call last):

  File "/home/odoo/src/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch

    result = request.dispatch ()

  File "/home/odoo/src/odoo/odoo/http.py", line 683, in dispatch

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

  File "/home/odoo/src/odoo/odoo/http.py", line 359, in _call_function

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

  File "/home/odoo/src/odoo/odoo/service/model.py", line 94, in wrapper

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

  File "/home/odoo/src/odoo/odoo/http.py", line 347, in checked_call

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

  File "/home/odoo/src/odoo/odoo/http.py", line 912, in __call__

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

  File "/home/odoo/src/odoo/odoo/http.py", line 531, in response_wrap

    response = f (* args, ** kw)

  File "/home/odoo/src/odoo/addons/web/controllers/main.py", line 1377, in call_kw

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

  File "/home/odoo/src/odoo/addons/web/controllers/main.py", line 1369, in _call_kw

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

  File "/home/odoo/src/odoo/odoo/api.py", line 397, in call_kw

    model.flush ()

  File "/home/odoo/src/odoo/odoo/models.py", line 5436, in flush

    self.recompute ()

  File "/home/odoo/src/odoo/odoo/models.py", line 5895, in recompute

    process (field)

  File "/home/odoo/src/odoo/odoo/models.py", line 5879, in process

    field.recompute (recs)

  File "/home/odoo/src/odoo/odoo/fields.py", line 1153, in recompute

    self.compute_value (recs)

  File "/home/odoo/src/odoo/odoo/fields.py", line 1175, in compute_value

    records._compute_field_value (self)

  File "/home/odoo/src/odoo/addons/base_automation/models/base_automation.py", line 370, in _compute_field_value

    pre = {action: action._filter_pre (records) for action in actions}

  File "/home/odoo/src/odoo/addons/base_automation/models/base_automation.py", line 370, in <dictcomp>

    pre = {action: action._filter_pre (records) for action in actions}

  File "/home/odoo/src/odoo/addons/base_automation/models/base_automation.py", line 210, in _filter_pre

    return records.sudo (). filtered_domain (domain) .with_env (records.env)

  File "/home/odoo/src/odoo/odoo/models.py", line 5311, in filtered_domain

    value_esc = value.replace ('_', '?'). replace ('%', '*'). replace ('[', '?')

Exception


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "/home/odoo/src/odoo/odoo/http.py", line 639, in _handle_exception

    return super (JsonRequest, self) ._ handle_exception (exception)

  File "/home/odoo/src/odoo/odoo/http.py", line 315, in _handle_exception

    raise exception.with_traceback (None) from new_cause

AttributeError: 'int' object has no attribute 'replace'

Avatar
Vazgeç

Hi Bruno, if you are using vanilla (without any customization) odoo version, I would recommend you to raise an issue w/ Odoo at https://github.com/odoo/odoo/issues or official support channel from odoo (odoo.com/help).

Make sure you provide exact reproducible steps. As it seems coming from base_automation module.

Thanks

En İyi Yanıt

Hi, 

 In your code the variable value is of the datatype integer and .replace can be used only for the datatype string
Try with,
value_esc = str(value).replace ('_', '?'). replace ('%', '*'). replace ('[', '?')

Thanks

Avatar
Vazgeç
Üretici En İyi Yanıt

[update]

So, I figure the source of the error is a automated action to send a email based on a value I have. @ Sandip Mangukiya I have follow up with Odoo support for them to help me out.

@Karthikeyan N R I´m using Studio and I have 3 options for evaluation type available: Value, Reference and Pyton expression so I think is on the Pyton behind that .replace are being called. I will give it a shot changing how I do it. The odd part is the database was running for 2/3 weeks and now the error pop up out of nowhere.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Kas 22
2333
0
Nis 22
1806
2
Ağu 21
7039
2
Tem 21
3978
1
Kas 20
4122