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

[11.0] [MIG] hr_attendance_rfid #469

Merged
merged 3 commits into from
Oct 25, 2018

Conversation

HviorForgeFlow
Copy link
Member

Minor changes

@pedrobaeza pedrobaeza added this to the 11.0 milestone Aug 2, 2018
@pedrobaeza
Copy link
Member

Can you take the occasion to improve the code coverage for the exception cases?

@HviorForgeFlow
Copy link
Member Author

Sure

@HviorForgeFlow HviorForgeFlow force-pushed the 11.0-mig-hr_attendance_rfid branch 9 times, most recently from 932e480 to 701cda4 Compare August 3, 2018 08:33
'logged': False,
'action': 'FALSE',
}
employee = self.search([('rfid_card_code', '=', card_code)], limit=1)

Choose a reason for hiding this comment

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

i think we don't need put limit in here. Because rfid_card_code is unique.

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">

Choose a reason for hiding this comment

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

if noupdate is 0, we don't need to keep <data> tag.


from odoo.tests.common import TransactionCase
from odoo.tools.misc import mute_logger
from datetime import datetime, timedelta

Choose a reason for hiding this comment

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

Copy link

@hieulucky111 hieulucky111 left a comment

Choose a reason for hiding this comment

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

Some minor adjustments.

'data': [
'views/hr_employee_view.xml',
'security/hr_attendance_rfid.xml',
'security/ir.model.access.csv',
Copy link
Member

Choose a reason for hiding this comment

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

# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

import logging
from odoo import api, models, fields, _
Copy link
Member

Choose a reason for hiding this comment

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

@hveficent IMHO uses an alphabetic naming convention, because better to us.

ex. api, fields, models, _

@HviorForgeFlow
Copy link
Member Author

comments attended @nikul-serpentcs. Thank you for reviewing 😺

@rafaelbn
Copy link
Member

rafaelbn commented Oct 2, 2018

@hveficent hello! do you want to complete test?

Copy link
Member

@nikul-serpentcs nikul-serpentcs left a comment

Choose a reason for hiding this comment

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

Code Review LGTM

@HviorForgeFlow HviorForgeFlow force-pushed the 11.0-mig-hr_attendance_rfid branch 2 times, most recently from b5bc12f to 8d33be8 Compare October 8, 2018 10:47
"""Checkout is created for a future datetime"""
self.env['hr.attendance'].create({
'employee_id': self.test_employee.id,
'check_in': datetime.today().strftime(
Copy link
Member

Choose a reason for hiding this comment

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

Use fields.Date.today()

'employee_id': self.test_employee.id,
'check_in': datetime.today().strftime(
DEFAULT_SERVER_DATETIME_FORMAT),
'check_out': (datetime.today()+timedelta(hours=8)).strftime(
Copy link
Member

Choose a reason for hiding this comment

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

Use fields.Datetime.to_string

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

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

I have some comments, but not related to the migration.

res['action'] = 'check_out'
else:
res['action'] = 'check_in'
return res
Copy link
Member

Choose a reason for hiding this comment

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

Should be nice to also add the created attendance id to the res. So it can be used e.g. to display it on the device.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand created attendance id means, an specific id for the device to know where the attendance came from? On res['employee_name'] you can get that name.

Copy link
Member

Choose a reason for hiding this comment

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

Doesn't matter, It's just an idea. I'll create a PR if I really need it 😉 probably not.

Copy link
Member Author

Choose a reason for hiding this comment

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

It would be great

hr_attendance_rfid/models/hr_employee.py Outdated Show resolved Hide resolved
@HviorForgeFlow
Copy link
Member Author

@pedrobaeza, comments attended, could you approve + merge?? Thanks!

@pedrobaeza pedrobaeza merged commit aa3e441 into OCA:11.0 Oct 25, 2018
@pedrobaeza pedrobaeza mentioned this pull request Oct 25, 2018
71 tasks
@HviorForgeFlow HviorForgeFlow deleted the 11.0-mig-hr_attendance_rfid branch October 26, 2018 07:56
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