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_webcam to 8.0 #65

Merged
merged 14 commits into from
Jun 26, 2015
23 changes: 0 additions & 23 deletions __unported__/hr_webcam/hr.py

This file was deleted.

22 changes: 0 additions & 22 deletions __unported__/hr_webcam/hr_webcam_view.xml

This file was deleted.

60 changes: 60 additions & 0 deletions hr_webcam/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
HR WebCam
=========

Capture employee pictures with an attached web cam.

Installation
============

To install this module, you need to:

* do this ...

Configuration
=============

To configure this module, you need to:

* go to ...

Usage
=====

To use this module, you need to:

* go to ...

For further information, please visit:

* https://www.odoo.com/forum/help-1

Known issues / Roadmap
======================

* ...

Credits
=======

Contributors
------------

* Adrian Vasile <adrian.vasile@gmail.com>

Author
------

* Michael Telahun Makonnen <mmakonnen@gmail.com>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
#
#

from . import hr
from . import hr_employee
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
'hr_webcam_data.xml',
'hr_webcam_view.xml',
],
'test': [
],
'installable': False,
'installable': True,
'active': False,
}
22 changes: 22 additions & 0 deletions hr_webcam/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from openerp import models


class hr_employee(models.Model):
_inherit = 'hr.employee'

def action_take_picture(self, cr, uid, ids, context=None):

if context is None:
context = {}

res_model, res_id = self.pool.get(
'ir.model.data').get_object_reference(cr, uid,
'hr_webcam',
'action_take_photo')
dict_act_window = self.pool.get(
'ir.actions.client').read(cr, uid, res_id, [])
if not dict_act_window.get('params', False):
dict_act_window.update({'params': {}})
dict_act_window['params'].update(
{'employee_id': len(ids) and ids[0] or False})
return dict_act_window
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions hr_webcam/hr_webcam_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="hr_webcam assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/hr_webcam/static/src/css/hr_webcam.css"/>
<script type="text/javascript" src="/hr_webcam/static/src/js/jquery.webcam.js"></script>
<script type="text/javascript" src="/hr_webcam/static/src/js/hr_webcam.js"></script>
</xpath>
</template>

<record id="action_take_photo" model="ir.actions.client">
<field name="name">Take Picture</field>
<field name="tag">photo.action</field>
</record>

<record id="view_employee_form" model="ir.ui.view">
<field name="name">hr.employee.form.webcam</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_take_picture" class="oe_stat_button" icon="fa-camera" type="object" groups="base.group_hr_user" string="Take Picture"/>
</xpath>
</field>
</record>

</data>
</openerp>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}

#webcam, #canvas {
width: 320px;
width: 360px;
border:20px solid #333;
background:#eee;
-webkit-border-radius: 20px;
Expand Down