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

8.0 project task subtask #740

Merged
merged 2 commits into from May 20, 2019

Conversation

Projects
None yet
5 participants
@Ommo73
Copy link
Member

commented Apr 22, 2019

  • New: added group "Allow edit others tasks"
  • Fix: changed message after status update
  • Iprovement: name in the message is not duplicated if reviewer and assigned user are one person

@Ommo73 Ommo73 force-pushed the Ommo73:8.0-project_task_subtask branch from 8904f06 to f7c9db9 Apr 30, 2019

Show resolved Hide resolved project_task_subtask/security/ir.model.access.csv Outdated
@@ -34,8 +38,13 @@ def _compute_recolor(self):

@api.multi
def _compute_hide_button(self):
group_id = self.env['res.groups'].search([('name', '=', 'Allow edit others tasks')])

This comment has been minimized.

Copy link
@KolushovAlexandr

KolushovAlexandr Apr 30, 2019

Member

use ref instead of search by name

<field name="name"/>
<field name="recolor" invisible='True'/>
<field name="user_id"/>
<field name="state"/>
<field name="hide_button" invisible='True'/>
<button name="change_state_done" string="Change state to DONE" type="object" icon="gtk-apply" attrs="{'invisible': ['|', ('state', 'in',['done', 'cancelled']), ('hide_button', '=', True)]}"/>
<button name="change_state_done" string="Change state to DONE" type="object" icon="gtk-apply" attrs="{'invisible': ['|', ('state', 'in',['done', 'cancelled']), ('hide_button', '=', True)]}" />

This comment has been minimized.

Copy link
@KolushovAlexandr

KolushovAlexandr Apr 30, 2019

Member

keep commit history clean

@@ -56,12 +65,12 @@ def write(self, vals):
for r in self:
if vals.get('state'):
r.task_id.send_subtask_email(r.name, r.state, r.reviewer_id.id, r.user_id.id)
if self.env.user != r.reviewer_id and self.env.user != r.user_id:
raise UserError(_('Only users related to that subtask can change state.'))
if self.env.user != r.reviewer_id and self.env.user != r.user_id and self.env.user.commercial_partner_id not in r.task_id.message_follower_ids:

This comment has been minimized.

Copy link
@KolushovAlexandr

KolushovAlexandr Apr 30, 2019

Member

i think it should be partner_id instead of commercial_partner_id

@@ -56,12 +65,12 @@ def write(self, vals):
for r in self:

This comment has been minimized.

Copy link
@KolushovAlexandr

KolushovAlexandr Apr 30, 2019

Member

make a refactor to make the code readable. I mean change r to smth else

if self.env.user != r.reviewer_id and self.env.user != r.user_id:
raise UserError(_('Only users related to that subtask can change state.'))
if self.env.user != r.reviewer_id and self.env.user != r.user_id and self.env.user.commercial_partner_id not in r.task_id.message_follower_ids:
raise UserError(_('Only users related to that task can change state.'))

This comment has been minimized.

Copy link
@KolushovAlexandr

KolushovAlexandr Apr 30, 2019

Member

Only users related to that subtask or users with special rights can change state.

@Ommo73 Ommo73 force-pushed the Ommo73:8.0-project_task_subtask branch from f7c9db9 to c257817 May 7, 2019

@Ommo73 Ommo73 force-pushed the Ommo73:8.0-project_task_subtask branch 2 times, most recently from e6ad7ac to 4166230 May 7, 2019

@KolushovAlexandr
Copy link
Member

left a comment

1 Please squash first two commits and delete there commented code in the security xml file.
2 Also the 3th and the 4thcommits are better to be squashed too because it's the related improvement done in the 4th one
3 correct the changelog after this. It Should contain the line about renamings.

@Ommo73 Ommo73 force-pushed the Ommo73:8.0-project_task_subtask branch 2 times, most recently from 569c330 to 86be2ee May 8, 2019

@Ommo73 Ommo73 force-pushed the Ommo73:8.0-project_task_subtask branch from 86be2ee to 681280a May 8, 2019

@Ramil-Mukhametzyanov
Copy link
Member

left a comment

A task followers can change every To-Do status through Edit button.

@Ramil-Mukhametzyanov

This comment has been minimized.

Copy link
Member

commented May 16, 2019

can change
even if the user is not in the group "Allow edit others tasks".
The name of the group is confusing. I suppose it should be "Allow editing tasks from other followers"

@Ommo73 Ommo73 force-pushed the Ommo73:8.0-project_task_subtask branch from 681280a to 89b9fa5 May 17, 2019

@Ommo73

This comment has been minimized.

Copy link
Member Author

commented May 17, 2019

A task followers can change every To-Do status through Edit button.

fixed

@Ramil-Mukhametzyanov
Copy link
Member

left a comment

A task follower can change each subtask executor using the Edit button.
If he/she is only a reviewer of a subtask, he/she should be able to modify the "Assigned to" field of the subtask (if he/she does not have the permission "Allow edit others tasks")

@Ramil-Mukhametzyanov
Copy link
Member

left a comment

A comma is missing between the follower names in the status update message.
Screenshot_2019-05-17 Tasks - Odoo

@Ommo73 Ommo73 force-pushed the Ommo73:8.0-project_task_subtask branch from 89b9fa5 to f2ebbca May 20, 2019

@yelizariev yelizariev merged commit bba613a into it-projects-llc:8.0 May 20, 2019

3 of 5 checks passed

Travis CI - Pull Request Build Failed
Details
coverage/coveralls Coverage decreased (-0.09%) to 42.836%
Details
Hound No violations found. Woof!
ci/branches Branch names are correct
Details
ci/runbot runbot build 31989-740-f2ebbc (runtime 934s)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.