Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] quality_control_oca #1478

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion quality_control_oca/models/qc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class QcTest(models.Model):
_inherit = "mail.thread"

def object_selection_values(self):
return set()
return super().object_selection_values()

@api.onchange("type")
def onchange_type(self):
Expand Down
11 changes: 11 additions & 0 deletions quality_control_oca/tests/test_quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,14 @@ def test_qc_test_question_constraints(self):
"ql_values": [(0, 0, {"name": "Qualitative answer", "ok": False})],
}
)
def test_object_selection_values(self):
qc_test = self.env["qc.test"].create({"name": "Quality Test", "type": "related"})
selection_values = qc_test.object_selection_values()
self.assertIsInstance(selection_values, set)
self.assertGreaterEqual(len(selection_values), 0)

def test_qc_test_object_id(self):
qc_test = self.env["qc.test"].create({"name": "Quality Test", "type": "generic"})
self.assertFalse(qc_test.object_id)
qc_test.write({"type": "related"})
self.assertTrue(qc_test.object_id is not None or qc_test.object_selection_values())
Loading