diff --git a/odex25_accounting/hr_expense_custom/__init__.py b/odex25_accounting/hr_expense_custom/__init__.py new file mode 100644 index 000000000..9a7e03ede --- /dev/null +++ b/odex25_accounting/hr_expense_custom/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/odex25_accounting/hr_expense_custom/__manifest__.py b/odex25_accounting/hr_expense_custom/__manifest__.py new file mode 100644 index 000000000..42c43f513 --- /dev/null +++ b/odex25_accounting/hr_expense_custom/__manifest__.py @@ -0,0 +1,12 @@ +{ + 'name': 'HR Expense - Custom', + 'version': '14.0', + 'author': 'Expert Co.', + 'license': 'LGPL-3', + 'depends': ['hr_expense'], + 'data': [ + 'security/security.xml', + 'views/hr_expense_views.xml', + 'views/hr_emplyee_views.xml' + ] +} \ No newline at end of file diff --git a/odex25_accounting/hr_expense_custom/models/__init__.py b/odex25_accounting/hr_expense_custom/models/__init__.py new file mode 100644 index 000000000..d25661f9c --- /dev/null +++ b/odex25_accounting/hr_expense_custom/models/__init__.py @@ -0,0 +1 @@ +from . import hr_employee \ No newline at end of file diff --git a/odex25_accounting/hr_expense_custom/models/hr_employee.py b/odex25_accounting/hr_expense_custom/models/hr_employee.py new file mode 100644 index 000000000..c9c634d2e --- /dev/null +++ b/odex25_accounting/hr_expense_custom/models/hr_employee.py @@ -0,0 +1,18 @@ +from odoo import fields, models, api + + +class HrEmployee(models.Model): + _inherit = "hr.employee" + + # expense_manager_id = fields.Many2one( + # compute='', + # store=False, + # related='partner_id.user_id' + # ) + + + @api.depends('parent_id') + def _compute_expense_manager(self): + for employee in self: + manager = employee.parent_id.user_id + employee.expense_manager_id = manager diff --git a/odex25_accounting/hr_expense_custom/models/hr_expense_sheet.py b/odex25_accounting/hr_expense_custom/models/hr_expense_sheet.py new file mode 100644 index 000000000..e69de29bb diff --git a/odex25_accounting/hr_expense_custom/security/security.xml b/odex25_accounting/hr_expense_custom/security/security.xml new file mode 100644 index 000000000..d5cefb9ef --- /dev/null +++ b/odex25_accounting/hr_expense_custom/security/security.xml @@ -0,0 +1,9 @@ + + + + + Show Expenses Module + + + + diff --git a/odex25_accounting/hr_expense_custom/views/hr_emplyee_views.xml b/odex25_accounting/hr_expense_custom/views/hr_emplyee_views.xml new file mode 100644 index 000000000..29a7fb1b4 --- /dev/null +++ b/odex25_accounting/hr_expense_custom/views/hr_emplyee_views.xml @@ -0,0 +1,16 @@ + + + + + hr.extension.form.inherit + hr.employee + + + + + + + + + + diff --git a/odex25_accounting/hr_expense_custom/views/hr_expense_views.xml b/odex25_accounting/hr_expense_custom/views/hr_expense_views.xml new file mode 100644 index 000000000..98ac58035 --- /dev/null +++ b/odex25_accounting/hr_expense_custom/views/hr_expense_views.xml @@ -0,0 +1,19 @@ + + + + + hr.expense.view.form.inherit + hr.expense + + + + + + + + + + + + +