Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions hr_employee_vcard/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
=================
HR Employee vCard
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b63660b3424b25ac1bb8b5ec70c333108b807fedb98875c0d3de5a75a53b1012
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge_devstat| image:: https://img.shields.io/badge/maturity-beta-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Beta

.. |badge_license| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:alt: LGPL-3

|badge_devstat| |badge_license|

This module lets you design and print business cards (vCards) for your
employees.

A company-wide card design is configured once (layout, font, background
and which fields to show) and can be printed for any employee as a
two-sided PDF: the front holds the branding (logo, company name) and the
back the contact details (name, job position, email, phone, website).
Each card includes a QR code with the employee's contact information, so
it can be scanned straight into a phone's address book.

The card adapts to the data available: only the selected fields that
actually have a value are shown.

**Table of contents**

.. contents::
:local:

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

To configure the vCard design:

1. Go to *Employees > Configuration > Settings*.
2. In the *Employee vCard* section, click *Configure vCard Layout*.
3. Choose the layout (Modern, Minimal or Classic), the font, the
background (blank, company logo or a custom image) and the fields to
display on the card. A live preview is shown as you change the
options.
4. Click *Save*.

The design is stored per company, so each company can have its own card.

Use *Preview vCard* to download a sample PDF with the current design.

Usage
=====

To print an employee's vCard:

1. Open the employee form (*Employees > Employees*).
2. In the *Actions* menu, choose *Generate vCard*.

The QR code is (re)generated from the employee's contact details and a
two-sided card PDF is downloaded, ready to print.

Credits
=======

Authors
-------

* Vortex Dimensión Digital

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

- `Vortex Dimensión Digital <https://www.dimensionvortex.com/>`__:

- Jorge Rosado Julián <jorge.rosado@dimensionvortex.com>

Maintainers
-----------

This module is maintained by Vortex Dimensión Digital.

Contact the maintainer through their official support channels in case you find
any issues with this module.
3 changes: 3 additions & 0 deletions hr_employee_vcard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import wizards
from .hooks import post_init_hook
29 changes: 29 additions & 0 deletions hr_employee_vcard/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "HR Employee vCard",
"version": "18.0.1.0.0",
"summary": "Manage employee business cards.",
"author": "Vortex Dimensión Digital, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/hr",
"license": "LGPL-3",
"category": "Human Resources",
"depends": ["hr"],
"post_init_hook": "post_init_hook",
"data": [
"security/ir.model.access.csv",
"views/hr_employee_vcard_templates.xml",
"reports/hr_employee_vcard_reports.xml",
"data/hr_employee_vcard_layout_data.xml",
"data/hr_employee_vcard_field_data.xml",
"wizards/hr_employee_vcard_wizard.xml",
"views/hr_employee_views.xml",
"views/res_config_settings_views.xml",
],
"assets": {
"web.report_assets_common": [
"hr_employee_vcard/static/src/scss/*.scss",
],
},
"installable": True,
"auto_install": False,
"application": False,
}
50 changes: 50 additions & 0 deletions hr_employee_vcard/data/hr_employee_vcard_field_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="hr_employee_vcard_field_logo" model="hr.employee.vcard.field">
<field name="name">Logo</field>
<field name="sequence">10</field>
<field name="field_name">logo</field>
</record>

<record id="hr_employee_vcard_field_name" model="hr.employee.vcard.field">
<field name="name">Name</field>
<field name="sequence">15</field>
<field name="field_name">name</field>
</record>

<record id="hr_employee_vcard_field_job_title" model="hr.employee.vcard.field">
<field name="name">Job Title</field>
<field name="sequence">20</field>
<field name="field_name">job_title</field>
</record>

<record id="hr_employee_vcard_field_work_email" model="hr.employee.vcard.field">
<field name="name">Work Email</field>
<field name="sequence">25</field>
<field name="field_name">work_email</field>
</record>

<record id="hr_employee_vcard_field_work_phone" model="hr.employee.vcard.field">
<field name="name">Work Phone</field>
<field name="sequence">30</field>
<field name="field_name">work_phone</field>
</record>

<record id="hr_employee_vcard_field_company_name" model="hr.employee.vcard.field">
<field name="name">Company Name</field>
<field name="sequence">35</field>
<field name="field_name">company_name</field>
</record>

<record id="hr_employee_vcard_field_website" model="hr.employee.vcard.field">
<field name="name">Website</field>
<field name="sequence">40</field>
<field name="field_name">website</field>
</record>

<record id="hr_employee_vcard_field_qr" model="hr.employee.vcard.field">
<field name="name">QR</field>
<field name="sequence">45</field>
<field name="field_name">qr</field>
</record>
</odoo>
29 changes: 29 additions & 0 deletions hr_employee_vcard/data/hr_employee_vcard_layout_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="hr_employee_vcard_layout_modern" model="hr.employee.vcard.layout">
<field name="name">Modern</field>
<field name="sequence">5</field>
<field
name="view_id"
ref="hr_employee_vcard.hr_employee_vcard_template_modern"
/>
</record>

<record id="hr_employee_vcard_layout_minimal" model="hr.employee.vcard.layout">
<field name="name">Minimal</field>
<field name="sequence">10</field>
<field
name="view_id"
ref="hr_employee_vcard.hr_employee_vcard_template_minimal"
/>
</record>

<record id="hr_employee_vcard_layout_classic" model="hr.employee.vcard.layout">
<field name="name">Classic</field>
<field name="sequence">15</field>
<field
name="view_id"
ref="hr_employee_vcard.hr_employee_vcard_template_classic"
/>
</record>
</odoo>
19 changes: 19 additions & 0 deletions hr_employee_vcard/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def post_init_hook(env):
"""Apply the vCard defaults to companies that already existed on install.

Field defaults only run when a company is created, so companies present
before installing the module would otherwise have no layout nor fields.
"""
layout = env.ref(
"hr_employee_vcard.hr_employee_vcard_layout_modern", raise_if_not_found=False
)
for company in env["res.company"].search([]):
vals = {}
if not company.vcard_layout_id and layout:
vals["vcard_layout_id"] = layout.id
if not company.vcard_layout_field_ids:
vals["vcard_layout_field_ids"] = [
(6, 0, company._default_vcard_layout_field_ids().ids)
]
if vals:
company.write(vals)
Loading
Loading