Initial commit: Hr packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 62531cd146
2820 changed files with 1432848 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_journal_dashboard_kanban_view_inherit_hr_expense" model="ir.ui.view">
<field name="name">account.journal.dashboard.kanban</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
<field name="arch" type="xml">
<xpath expr="//t[@id='account.JournalBodySalePurchase']//div[hasclass('o_kanban_primary_right')]" position="inside">
<div class="row" t-if="dashboard.number_expenses_to_pay">
<div class="col overflow-hidden text-start">
<a type="object" t-if="journal_type == 'purchase'" name="open_expenses_action">
<t t-esc="dashboard.number_expenses_to_pay"/> Expenses to Process
</a>
</div>
<div class="col-auto text-end">
<span t-if="journal_type == 'purchase'"><t t-esc="dashboard.sum_expenses_to_pay"/></span>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_move_form_inherit_expense" model="ir.ui.view">
<field name="name">account.move.form.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<field name="expense_sheet_id" invisible="1"/>
<button name="action_open_expense_report"
class="oe_stat_button"
string="Expense Report"
icon="fa-file-text-o"
type="object"
attrs="{'invisible': [('expense_sheet_id', '=', [])]}"/>
</xpath>
</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_payment_form_inherit_expense" model="ir.ui.view">
<field name="name">account.payment.form.inherit</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<field name="expense_sheet_id" invisible="1"/>
<button name="action_open_expense_report"
class="oe_stat_button"
string="Expense Report"
icon="fa-file-text-o"
type="object"
attrs="{'invisible': [('expense_sheet_id', '=', [])]}"/>
</xpath>
</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,31 @@
<odoo>
<!--Hr Department Inherit Kanban view-->
<record id="hr_department_view_kanban" model="ir.ui.view">
<field name="name">hr.department.kanban.inherit</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.hr_department_view_kanban"/>
<field name="arch" type="xml">
<data>
<xpath expr="//templates" position="before">
<field name="expense_sheets_to_approve_count" groups="hr_expense.group_hr_expense_team_approver"/>
</xpath>
<xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside">
<div t-if="record.expense_sheets_to_approve_count.raw_value > 0" class="row ml16" groups="hr_expense.group_hr_expense_team_approver">
<div class="col">
<a name="%(action_hr_expense_sheet_department_to_approve)d" type="action">
<t t-esc="record.expense_sheets_to_approve_count.raw_value"/> Expense Reports
</a>
</div>
</div>
</xpath>
<xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside">
<a role="menuitem" class="dropdown-item" name="%(action_hr_expense_sheet_department_filtered)d" type="action" groups="hr_expense.group_hr_expense_team_approver">
Expenses
</a>
</xpath>
</data>
</field>
</record>
</odoo>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<odoo>
<!-- Activity types config -->
<record id="mail_activity_type_action_config_hr_expense" model="ir.actions.act_window">
<field name="name">Activity Types</field>
<field name="res_model">mail.activity.type</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('res_model', '=', False), ('res_model', '=', 'hr.expense.sheet')]</field>
<field name="context">{'default_res_model': 'hr.expense.sheet'}</field>
</record>
<menuitem id="hr_expense_menu_config_activity_type"
action="mail_activity_type_action_config_hr_expense"
parent="menu_hr_expense_configuration"
groups="base.group_no_one"/>
</odoo>

View file

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.hr.expense</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="85"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block" data-string="Expenses" string="Expenses" data-key="hr_expense" groups="hr_expense.group_hr_expense_manager">
<h2>Expenses</h2>
<div class="row mt16 o_settings_container" name="expenses_setting_container">
<div class="col-xs-12 col-md-6 o_setting_box"
id="create_expense_setting"
title="Send an email to this email alias with the receipt in attachment to create an expense in one click. If the first word of the mail subject contains the category's internal reference or the category name, the corresponding category will automatically be set. Type the expense amount in the mail subject to set it on the expense too.">
<div class="o_setting_left_pane">
<field name="use_mailgateway"/>
</div>
<div class="o_setting_right_pane">
<label string="Incoming Emails" for="use_mailgateway"/>
<div class="text-muted">
Create expenses from incoming emails
</div>
<div class="content-group" attrs="{'invisible': ['|', ('use_mailgateway', '=', False), ('alias_domain', 'in', ['localhost', '', False])]}">
<div class="mt16" dir="ltr">
<label for="expense_alias_prefix" string="Alias" class="o_light_label"/>
<field name="expense_alias_prefix" class="oe_inline ps-2"/>
<span>@</span>
<field name="alias_domain" class="oe_inline" readonly="1" force_save="1"/>
</div>
</div>
<div class="content-group" attrs="{'invisible': ['|', ('use_mailgateway', '=', False), ('alias_domain', 'not in', ['localhost', '', False])]}">
<div class="mt16">
<button type="action" name="base_setup.action_general_configuration" icon="fa-arrow-right" string="Setup your domain alias" class="btn-link"/>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-12 o_setting_box" id="hr_payroll_accountant">
<div class="o_setting_left_pane">
<field name="module_hr_payroll_expense" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_hr_payroll_expense" string="Reimburse in Payslip"/>
<div class="text-muted">
Reimburse expenses in payslips
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box" title="use OCR to fill data from a picture of the bill">
<div class="o_setting_left_pane">
<field name="module_hr_expense_extract" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane" id="expense_extract_settings">
<label string="Expense Digitalization (OCR)" for="module_hr_expense_extract"/>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific."/>
<div class="text-muted">
Digitalize your receipts with OCR and Artificial Intelligence
</div>
</div>
</div>
</div>
<h2>Default Journals</h2>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane"></div>
<div class="o_setting_right_pane">
<span class="o_form_label">Employee Expense Journal</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." role="img" aria-label="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Default accounting journal for expenses paid by employees.
</div>
<div class="row mt8">
<field name="expense_journal_id"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane"></div>
<div class="o_setting_right_pane">
<span class="o_form_label">Company Expense Journal</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." role="img" aria-label="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Default accounting journal for expenses paid by the company.
</div>
<div class="row mt8">
<field name="company_expense_journal_id"/>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
<record id="action_hr_expense_configuration" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'hr_expense', 'bin_size': False}</field>
</record>
<menuitem id="menu_hr_expense_global_settings" name="Settings"
parent="menu_hr_expense_configuration" sequence="0" action="action_hr_expense_configuration" groups="base.group_system"/>
</data>
</odoo>