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

ported hr_public_holidays to api 8 #85

Closed
wants to merge 10 commits into from

Conversation

grzekru
Copy link

@grzekru grzekru commented Mar 26, 2015

No description provided.

@api.one
@api.constrains('year')
def _check_year(self):
for data in self:
Copy link

Choose a reason for hiding this comment

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

If you use @api.one, you don't need to iterate over self.

@oca-clabot
Copy link

Hey @grzekru, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/website.cla
Here is a list of the users:

  • @grzekru (login unknown in OCA database)

Appreciation of efforts,
OCA CLAbot

@max3903 max3903 added this to the 8.0 milestone Apr 3, 2015
@max3903 max3903 mentioned this pull request Apr 3, 2015
58 tasks
@max3903
Copy link
Sponsor Member

max3903 commented Apr 3, 2015

Can you use the todo listed here: #86 please ?


from openerp import models, fields, api, _
from datetime import date
from openerp.http import request
Copy link
Member

Choose a reason for hiding this comment

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

./hr_public_holidays/hr_public_holidays.py:26:1: F401 'request' imported but unused

@@ -19,4 +19,4 @@
#
#

from . import hr_public_holidays
import models
Copy link
Member

Choose a reason for hiding this comment

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

Add relative import:
from . import models

@alexis-via
Copy link

@grzekru I made a PR to your branch that takes into account the remarks of @feketemihai and avoids code duplication. Could you merge it ?

Once my PR is merged in this branch, it will be ready to merge in main branch.

hr_public_holidays: take into account the remarks of the reviewers, avoid code duplication
('id', '!=', self.id)])
if pholidays:
raise ValidationError(
_('Error: Duplicate year %s') % self.year)
Copy link

Choose a reason for hiding this comment

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

This validation is not required (from line 50 to 57). It is checked by the unique constraint below.

@mmalorni
Copy link

Works OK but there is a glitch in the treeview in the "Related State" column. 👍
screen shot 2015-07-28 at 9 55 58 am

class HrPublicHolidays(models.Model):
_name = 'hr.holidays.public'
_description = 'Public Holidays'
_rec_name = 'year'
Copy link
Member

Choose a reason for hiding this comment

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

This rec_name is not enough for identifying a record. You should create a name_get method.

Choose a reason for hiding this comment

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

I disagree with that. This module uses the new API and name_get() is sort of "deprecated" with the new API, to be replaced by a display_name as compute field.
In this case, I think _rec_name is enough.

Copy link
Member

Choose a reason for hiding this comment

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

OK, what I mean is that we need a more complete name, not only the year, but possibly the states between brackets. Instead of using name_get, you can use display_name computed field, but the principle is to complete the shown info

@ghost
Copy link

ghost commented Oct 21, 2015

@grzekru I'm closing this PR, since no work is done on it. We will continue with #173.

@ghost ghost closed this Oct 21, 2015
@alexis-via
Copy link

The pb is that should PR should have been merged long ago. It's an issue with those important PRs that stays under review for too long and never get merged. This code works well, I contributed to it and I use it in production, so I'm not happy that it is abandoned now.

@pedrobaeza
Copy link
Member

@dufresnedavid, have you started from this branch in your PR or is a totally fresh work?

@ghost
Copy link

ghost commented Oct 21, 2015

I would reopen this branch in another PR. The fact is that @grzekru abandonned this PR. @alexis-via are you willing to finish his work ?

@ghost ghost mentioned this pull request Oct 21, 2015
sambarros pushed a commit to sambarros/hr that referenced this pull request Jul 26, 2018
[BSSFL-194] Stock picking crystal report packing list link
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants