-
-
Notifications
You must be signed in to change notification settings - Fork 128
[NEW] survey_record_generation #149
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
base: 16.0
Are you sure you want to change the base?
Conversation
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
|
@OCA/crm-sales-marketing-maintainers I'm discussing with the authors of this module at OCA days and reopened the PR. I think it is interesting, and your feedback is welcome. |
|
@petrus-v Could there be a path on this for the product configuration? |
gurneyalex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review, not super in depth, with some typo fixes and rewording suggestions.
I would like to see some automated tests for this module.
Having in the data an example of the module an example survey, for instance the "typical case" explained (or a subset which does not require a dependency on crm could be a great addition.
| @@ -0,0 +1 @@ | |||
| This module allows to generate any record from surveys answers. No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This module allows to generate any record from surveys answers. | |
| This module allows to generate any record from survey answers. |
| .. |Image of record creation list| image:: ../static/description/record-creations.png | ||
|
|
||
| #. Go to the the survey | ||
| #. In *Record creation* tab add a new line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #. In *Record creation* tab add a new line | |
| #. In the *Record creation* tab, add a new line |
|
|
||
| #. Go to the the survey | ||
| #. In *Record creation* tab add a new line | ||
| #. Set a name for created record, select the Model of the record (eg: Prospect) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear reading this what the name will be used for. It also seems there are two steps. Or setting a name and selecting the model is the same thing?
| .. |Image of record creation fields| image:: ../static/description/record-creation-customer.png | ||
|
|
||
| #. You can check "unicity constraint" to prevent duplicates. | ||
| In case of duplicates and if other record use this record to fill a m2o field, the founded record will be used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| In case of duplicates and if other record use this record to fill a m2o field, the founded record will be used | |
| In case of duplicates and if other records use this record to fill a m2o field, the already present record will be used |
|
|
||
| #. You can check "unicity constraint" to prevent duplicates. | ||
| In case of duplicates and if other record use this record to fill a m2o field, the founded record will be used | ||
| #. You can configure explicitly where Odoo should retrieve the value of field : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #. You can configure explicitly where Odoo should retrieve the value of field : | |
| #. You can configure explicitly how Odoo should retrieve the value of field : |
| if not rec: | ||
| raise UserError(_("No record found in %s", self.model_id.name)) | ||
| else: | ||
| for answer in self.suggested_answer_ids: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you explain the logic of this onchange? Maybe it's me not understanding the structure of the Survey models but this looks strange.
| ) | ||
| model_id = fields.Many2one("ir.model", related="question_id.model_id") | ||
| answer_values_type = fields.Selection(related="question_id.answer_values_type") | ||
| value_char = fields.Char("Value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a help string explaining what this field is for?
| survey_record_creation_id = fields.Many2one( | ||
| "survey.record.creation", "Survey record creation", readonly=True | ||
| ) | ||
| user_input_id = fields.Many2one("survey.user_input", "Participation", readonly=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the name. Is it a leftover from a version not in English?
| survey_record_creation_ids = fields.One2many( | ||
| "survey.record.creation", | ||
| "survey_id", | ||
| "Records creation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "Records creation", | |
| "Created records", |
| def _selection_target_model(self): | ||
| return [ | ||
| (model.model, model.name) | ||
| for model in self.env["ir.model"].sudo().search([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remark about the domain
A new module used to create records when user responds to a survey.