OCA / survey

Survey addons
GNU Affero General Public License v3.0
27 stars 110 forks source link

[15.0][ADD] survey_answer_generation: New module #92

Open chienandalu opened 1 year ago

chienandalu commented 1 year ago

cc @Tecnativa TT40984

please review @pedrobaeza @pilarvargas-tecnativa

pedrobaeza commented 6 months ago

Any news here?

pilarvargas-tecnativa commented 6 months ago

I have an error when I try to complete a survey with the Demo user.

I have done local testing and my flow has been:

When completing the original survey "Feedback form" to generate answers, I have left the previous question blank which is not mandatory and that is when the following error occurs:

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 368, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 364, in checked_call
    self._cr.flush()
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 109, in flush
    self.transaction.flush()
  File "/opt/odoo/custom/src/odoo/odoo/api.py", line 845, in flush
    env_to_flush['base'].flush()
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5687, in flush
    self.recompute()
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 6160, in recompute
    process(field)
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 6144, in process
    field.recompute(recs)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1273, in recompute
    self.compute_value(recs)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1295, in compute_value
    records._compute_field_value(self)
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4277, in _compute_field_value
    fields.determine(field.compute, self)
  File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 88, in determine
    return needle(*args)
  File "/opt/odoo/auto/addons/survey_answer_generation/models/survey_user_input.py", line 109, in _compute_diff_with_origin
    previous_value = str(line.origin_input_line[value])
  File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5931, in __getitem__
    return self._fields[key].__get__(self, self.env.registry[self._name])
Exception

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

Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 654, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/custom/src/odoo/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
KeyError: 'value_False'