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
[IMP] rating_*: Improvement #13692
[IMP] rating_*: Improvement #13692
Conversation
7f318ff
to
fd9d13e
Compare
fd9d13e
to
a2f8a51
Compare
0a4752c
to
ca09307
Compare
078e4da
to
29555ed
Compare
29555ed
to
d6b090a
Compare
778b664
to
84dd27a
Compare
fe2e96e
to
1c8e80a
Compare
4af7349
to
deab579
Compare
7be684d
to
7e303a9
Compare
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.
Quick technical review, but I am tired
res_model = fields.Char(string='Document Model', required=True, help="Model name of the rated object", index=True) | ||
res_name = fields.Char(string='Resource name', compute='_compute_res_name', store=True, help="The name of the rated resource.") | ||
res_model_id = fields.Many2one('ir.model', 'Related Document Model', index=True, ondelete='cascade', help='Model of the followed resource') | ||
res_model = fields.Char(string='Document Model', related='res_model_id.model', store=True, index=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.
Probably add a readonly=True
@@ -19,10 +19,11 @@ def write(self, values): | |||
return res | |||
|
|||
def _send_issue_rating_mail(self): | |||
force_send = self.env.context.get('force_send', 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.
Where is this context key used ? What is its purpose ?
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.
Yup
7e303a9
to
232d984
Compare
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.
Tech review
rating.rating_image = False | ||
|
||
@api.multi | ||
def _compute_rating_text(self): |
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.
Missing dependency
message_id = fields.Many2one('mail.message', string="Linked message", help="Associated message when posting a review. Mainly used in website addons.", index=True) | ||
access_token = fields.Char('Security Token', default=new_access_token, help="Access token to set the rating of the value") | ||
consumed = fields.Boolean(string="Filled Rating", help="Enabled if the rating has been filled.") | ||
|
||
@api.multi | ||
def _compute_rating_image(self): |
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.
MIssing depedency
rating_count = fields.Integer('Rating count', compute="_compute_rating_count") | ||
|
||
def write(self, values): |
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.
Write should be below computed fields ;)
@@ -19,10 +19,11 @@ def write(self, values): | |||
return res | |||
|
|||
def _send_issue_rating_mail(self): | |||
force_send = self.env.context.get('force_send', 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.
Yup
232d984
to
19f4815
Compare
In rating module - provide list and form view for rating - better kanban view (remove js code, ellispsis for long name, better feedback display, ...) - provide more field on the mixin to cover more case - update res_name of rating when the ressource name is changed (for consistency) - make the rating web page, a correct html page (by using web.layout template) - some guidelines compliance In rating_project and rating_project_issue: - add filter for rated document - some guidelines compliance
- use rating.mixin field instead of rating_ids to display rating on form view - clean controller method - ...
Automatically deleting a rating was not implemented yet. We find 2 cases : - when uninstalling a module, the same mecanism as mail.follower is used, via a res_model_id field pointing on ir.model. When this model does not exist anymore, remove all related rating. - when deleting a record, its rating should be deleted too.
5dca624
to
8e10f6a
Compare
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
rating:-
rating_project:-