Skip to content

Commit

Permalink
[8.0.1.0.0] hr_employee_training_analytic
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Jan 14, 2018
1 parent 9a93b4d commit f7b1fb3
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 0 deletions.
39 changes: 39 additions & 0 deletions hr_employee_training_analytic/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

============================
Employee Training - Analytic
============================


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

To install this module, you need to:

1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-hr
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list
4. Go to menu *Setting -> Modules -> Local Modules*
5. Search For *Employee Training - Analytic*
6. Install the module

Credits
=======

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

* Michael Viriyananda <viriyananda.michael@gmail.com>
* Andhitia Rama <andhitia.r@gmail.com>
* Nurazmi <azmimr67@gmail.com>

Maintainer
----------

.. image:: https://opensynergy-indonesia.com/logo.png
:alt: OpenSynergy Indonesia
:target: https://opensynergy-indonesia.com

This module is maintained by the OpenSynergy Indonesia.
5 changes: 5 additions & 0 deletions hr_employee_training_analytic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions hr_employee_training_analytic/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Employee Training - Analytic",
"version": "8.0.1.0.0",
"category": "Human Resource",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"hr_employee_training",
"account_accountant",
],
"data": [
"views/hr_training_views.xml",
],
}
5 changes: 5 additions & 0 deletions hr_employee_training_analytic/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_training
34 changes: 34 additions & 0 deletions hr_employee_training_analytic/models/hr_training.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, fields, api


class HrTraining(models.Model):
_inherit = "hr.training"

@api.multi
@api.depends(
"analytic_account_id",
)
def _compute_analytic_line(self):
for rec in self:
obj_line = self.env["account.analytic.line"]
criteria = [
("account_id", "child_of", rec.analytic_account_id.id),
]
rec.analytic_line_ids = obj_line.search(criteria).ids

analytic_account_id = fields.Many2one(
string="Parent Analytic Account",
comodel_name="account.analytic.account",
domain=[
("type", "=", "view"),
],
)
analytic_line_ids = fields.Many2many(
string="Cost and Revenue",
comodel_name="account.analytic.line",
compute="_compute_analytic_line",
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions hr_employee_training_analytic/views/hr_training_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<record id="hr_training_view_form" model="ir.ui.view">
<field name="name">hr.training form</field>
<field name="model">hr.training</field>
<field name="inherit_id" ref="hr_employee_training.hr_training_view_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//notebook" position="inside">
<page name="page_cost_revenue" string="Cost &amp; Revenue">
<group name="group_analytic" colspan="4" col="2">
<field name="analytic_account_id"/>
</group>
<field name="analytic_line_ids" nolabel="1" colspan="4" readonly="1"/>
</page>
</xpath>
</data>
</field>
</record>


</data>
</openerp>

0 comments on commit f7b1fb3

Please sign in to comment.