Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1298 Widoki

Error:

Odoo Server Error


Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch

    result = request.dispatch()

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 683, in dispatch

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

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 359, in _call_function

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

  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper

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

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 347, in checked_call

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

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 912, in __call__

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

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 531, in response_wrap

    response = f(*args, **kw)

  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1400, in call_kw

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

  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1392, in _call_kw

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

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 399, in call_kw

    result = _call_kw_multi(method, model, args, kwargs)

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 386, in _call_kw_multi

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

  File "/home/odoo/erp_cs360/live/edu_admissions/models/edu_admission.py", line 238, in write

    obj = super(campus_applicant, self).write(vals)

  File "/home/odoo/erp_cs360/live/ks_dashboard_ninja/models/ks_odoo_base.py", line 24, in write

    recs = super(Base, self).write(vals)

  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3671, in write

    field.write(self, vals[fname])

  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 3048, in write

    return self.write_batch([(records, value)])

  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 3069, in write_batch

    return self.write_real(records_commands_list, create)

  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 3245, in write_real

    flush()

  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 3207, in flush

    comodel.create(to_create)

  File "", line 2, in create

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 329, in _model_create_single

    return self.browse().concat(*(create(self, vals) for vals in arg))

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 329, in

    return self.browse().concat(*(create(self, vals) for vals in arg))

  File "/home/odoo/erp_cs360/live/edu_academics/edu_academics.py", line 6416, in create

    return super(campus_parent_details, self).create(vals)

  File "", line 2, in create

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 347, in _model_create_multi

    return create(self, [arg])

  File "/home/odoo/erp_cs360/live/ks_dashboard_ninja/models/ks_odoo_base.py", line 9, in create

    recs = super(Base, self).create(vals_list)

  File "", line 2, in create

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 348, in _model_create_multi

    return create(self, arg)

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_fields.py", line 534, in create

    recs = super().create(vals_list)

  File "", line 2, in create

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 348, in _model_create_multi

    return create(self, arg)

  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3876, in create

    records = self._create(data_list)

  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3948, in _create

    col_val = field.convert_to_column(val, self, stored)

  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 2404, in convert_to_column

    value = self.convert_to_cache(value, record)

  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 2416, in convert_to_cache

    raise ValueError("Wrong value for %s: %r" % (self, value))

Exception


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


Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception

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

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception

    raise exception.with_traceback(None) from new_cause

ValueError: Wrong value for campus.parent.details.contact_type: 'Regular'

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

I am an Odoo user, I don't know about code, but if I get an error like this I use chat GPT or other AI and enter the error text. Sometimes this helps me identify the issue, sometimes I have to contact my Odoo partner for support.   

Here is what it says about your error.

The error message indicates that there is a value error for the field campus.parent.details.contact_type with the value 'Regular'. It seems that the value 'Regular' is not allowed for the contact_type field in the campus.parent.details model.

Here are a few steps you can take to resolve this issue:

  1. Check Field Type: Make sure that the field contact_type in the model campus.parent.details is of the correct type. If it is supposed to be a selection field, verify that 'Regular' is one of the allowed values.
  2. Check Constraints: Review any constraints or validations that are applied to the contact_type field. If there are constraints that restrict the allowed values, ensure that 'Regular' is a valid value.
  3. Check Dependencies: If the campus.parent.details model has any dependencies or related models, check if there are constraints or validations in those models that might affect the contact_type field.
  4. Check Code: Review the code in the edu_academics.py file around line 6416 where the create method for the campus.parent.details model is defined. Look for any custom logic or constraints that might be causing the issue.
  5. Update Data: If the field contact_type is supposed to have a different value, you may need to update the data in your system to ensure that it conforms to the expected values.
  6. Review Recent Changes: If this issue started occurring after recent changes, review the changes that were made to the code, models, or data to identify any modifications that might have led to this error.
  7. Check Log Files: Check the Odoo server logs for any additional information or error messages that might provide more details about the issue.

Once you identify the cause of the error, you can take appropriate actions to fix the problem, such as updating the data, modifying the field definition, or adjusting constraints in your models.


Awatar
Odrzuć