Skip to content

[IMP] project_timesheet_holidays: prevent modifying leave timesheets#30863

Open
alexey-pelykh wants to merge 1 commit into
odoo:masterfrom
brainbeanapps:imp-project_timesheet_holidays
Open

[IMP] project_timesheet_holidays: prevent modifying leave timesheets#30863
alexey-pelykh wants to merge 1 commit into
odoo:masterfrom
brainbeanapps:imp-project_timesheet_holidays

Conversation

@alexey-pelykh

@alexey-pelykh alexey-pelykh commented Feb 6, 2019

Copy link
Copy Markdown
Contributor

Description of the issue/feature this PR addresses:
#30850

Current behavior before PR:

  • Can modify timesheet lines on approved leaves

Desired behavior after PR is merged:

  • Can not modify timesheet lines on approved leaves

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@pedrobaeza

Copy link
Copy Markdown
Collaborator

You have making several changes in the same PR. Better to address little things each time. You are adding a hook and also avoiding data modification. Do only one here and the other in another PR (although hooks are not usually accepted in stable).

@alexey-pelykh

Copy link
Copy Markdown
Contributor Author

@pedrobaeza no hooks here - not sure I'm on the same page, this PR only refactors code and adds write() as well as addresses privacy issue + it's for master, such PR won't make it to 12.0 I guess

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the hook I'm mentioning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it. Well, I can move it back, though other modules in Odoo use same approach.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me rephrase - if this going to be the reason of rejection - I'll move it back, since it was added w/o any particular usage in mind at least right now

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as said, 1 change each time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, now there's #30867

@alexey-pelykh
alexey-pelykh force-pushed the imp-project_timesheet_holidays branch from 3700f68 to 3fb053d Compare February 6, 2019 10:15
Comment thread addons/project_timesheet_holidays/models/account_analytic.py Outdated
Comment thread addons/project_timesheet_holidays/tests/test_timesheet_holidays.py Outdated
@alexey-pelykh
alexey-pelykh force-pushed the imp-project_timesheet_holidays branch from 3fb053d to b7e3aaf Compare February 6, 2019 12:03
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Feb 6, 2019
@mart-e mart-e added the Services Project, timesheet, helpdesk,... label Apr 8, 2019

@jem-odoo jem-odoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding review. Interesting feature for master.

Please detail a little the use case motivation and consequence in your commit message. The commit title should not be "ensure data integrity" but "prevent modifying leave timesheets"

Comment thread addons/project_timesheet_holidays/models/account_analytic.py Outdated
Comment thread addons/project_timesheet_holidays/models/account_analytic.py Outdated
Comment thread addons/project_timesheet_holidays/models/account_analytic.py Outdated
Comment thread addons/project_timesheet_holidays/models/account_analytic.py Outdated
Comment thread addons/project_timesheet_holidays/models/account_analytic.py Outdated
Comment thread addons/project_timesheet_holidays/tests/test_timesheet_holidays.py Outdated
@jem-odoo jem-odoo self-assigned this Jul 5, 2019
@alexey-pelykh
alexey-pelykh force-pushed the imp-project_timesheet_holidays branch from b7e3aaf to d2e887f Compare July 10, 2019 09:53
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Jul 10, 2019
@alexey-pelykh
alexey-pelykh force-pushed the imp-project_timesheet_holidays branch from d2e887f to 7cac70a Compare July 23, 2019 15:08
@alexey-pelykh alexey-pelykh changed the title [IMP] project_timesheet_holidays: ensure data integrity [IMP] project_timesheet_holidays: prevent modifying leave timesheets Jul 23, 2019
@alexey-pelykh
alexey-pelykh force-pushed the imp-project_timesheet_holidays branch from 7cac70a to fdd8d5b Compare July 23, 2019 19:15
@jem-odoo

jem-odoo commented Oct 2, 2019

Copy link
Copy Markdown
Contributor

Note for myself: prevent leave timesheet modification can cause problem when adjust a timesheet in grid view. We will need to exlude those kind of timesheet, which implies a bridge module between timesheet_grid and project_timesheet_holidays.

@alexey-pelykh

Copy link
Copy Markdown
Contributor Author

@jem-odoo do I need to fix the conflicts?

@jem-odoo

jem-odoo commented Oct 2, 2019

Copy link
Copy Markdown
Contributor

@alexey-pelykh I will have to discuss with the Product Owner if it is worthy to handle that use case.

@alexey-pelykh

Copy link
Copy Markdown
Contributor Author

@jem-odoo any feedback available?

@alexey-pelykh

Copy link
Copy Markdown
Contributor Author

It's impressive how a PR can be unattended for 6 years without any feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Services Project, timesheet, helpdesk,...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants