Skip to content

Commit

Permalink
Feature RM#84194:Expense: Re-add ‘Complete my...’ menu entries
Browse files Browse the repository at this point in the history
  • Loading branch information
vva-axelor committed Sep 16, 2024
1 parent 2f1909d commit 43e5d0f
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 9 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
"conf-expense-type";"Expense Manager"
"kilometric-allow-param-all";"Employee Manager"
"top-menu-hr-my-expense";"Expense Manager|Expense User|Expense Read"
"edit-expense";"Expense Manager|Expense User|Expense Read"
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@
"top-menu-hr-my-expense";"Admin"
"top-menu-hr-my-leave-request";"Admin"
"top-menu-hr-my-extra-hours";"Admin"
"edit-expense";"Admin"
2 changes: 2 additions & 0 deletions axelor-human-resource/src/main/resources/i18n/messages.csv
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"Company fixed phone",,,
"Company's credit card",,,
"Complete",,,
"Complete my expense",,,
"Completed",,,
"Compute amounts",,,
"Compute distance with web service",,,
Expand Down Expand Up @@ -187,6 +188,7 @@
"Country of birth",,,
"Create",,,
"Create Leave Request",,,
"Create Timesheet line",,,
"Create amendment",,,
"Create expense",,,
"Create lines for day leaves",,,
Expand Down
2 changes: 2 additions & 0 deletions axelor-human-resource/src/main/resources/i18n/messages_en.csv
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"Company fixed phone",,,
"Company's credit card",,,
"Complete",,,
"Complete my expense",,,
"Completed",,,
"Compute amounts",,,
"Compute distance with web service",,,
Expand Down Expand Up @@ -187,6 +188,7 @@
"Country of birth",,,
"Create",,,
"Create Leave Request",,,
"Create Timesheet line",,,
"Create amendment",,,
"Create expense",,,
"Create lines for day leaves",,,
Expand Down
2 changes: 2 additions & 0 deletions axelor-human-resource/src/main/resources/i18n/messages_fr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"Company fixed phone","N° de téléphone de la société",,
"Company's credit card","CB de la société",,
"Complete",,,
"Complete my expense","Compléter ma note de frais",,
"Completed",,,
"Compute amounts","Calculer les montants",,
"Compute distance with web service","Calculer la distance avec un service web",,
Expand Down Expand Up @@ -187,6 +188,7 @@
"Country of birth","Pays de naissance",,
"Create","Créer",,
"Create Leave Request","Demander un congé",,
"Create Timesheet line",,,
"Create amendment","Créer avenant",,
"Create expense","Créer la note de frais",,
"Create lines for day leaves","Générer des lignes pour les jours de congés",,
Expand Down
11 changes: 9 additions & 2 deletions axelor-human-resource/src/main/resources/views/Expense.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://axelor.com/xml/ns/object-views http://axelor.com/xml/ns/object-views/object-views_7.1.xsd">

<grid name="expense-grid" title="Expenses" model="com.axelor.apps.hr.db.Expense"
orderBy="-sentDateTime" groupBy="period">
orderBy="-sentDateTime" groupBy="period" canNew="false">
<hilite color="danger" if="statusSelect == 5"/>
<hilite color="success" if="statusSelect == 3 || statusSelect == 4"/>
<hilite color="warning" if="statusSelect == 2"/>
Expand Down Expand Up @@ -50,7 +50,8 @@

<form name="expense-form" title="Expense" model="com.axelor.apps.hr.db.Expense" width="large"
onNew="action-expense-group-form-onNew" onLoad="action-expense-group-form-onLoad"
onSave="action-expense-method-validate-and-compute" canDelete="ventilated == false">
onSave="action-expense-method-validate-and-compute" canDelete="ventilated == false"
canNew="false">
<menubar>
<menu name="expenseReportsMenu" title="Reports" icon="fa-files-o">
<item name="printAll" title="Print report and files"
Expand Down Expand Up @@ -270,6 +271,7 @@
<action name="action-expense-method-check-line-file"/>
<action name="action-expense-method-send"/>
<action name="action-expense-attrs-hide-button-readonly-field"/>
<action name="action-expense-view-open-empty-view"/>
</action-group>

<action-group name="action-expense-group-validate">
Expand Down Expand Up @@ -467,6 +469,11 @@
<call class="com.axelor.apps.hr.web.expense.ExpenseController" method="checkLineFile"/>
</action-method>

<action-view name="action-expense-view-open-empty-view"
model="com.axelor.apps.hr.db.Expense" title="Expense">
<view name="expense-form" type="form"/>
</action-view>

<search-filters name="expense-filters" model="com.axelor.apps.hr.db.Expense"
title="Expense filters">
<field name="company" hidden="true"
Expand Down
16 changes: 11 additions & 5 deletions axelor-human-resource/src/main/resources/views/Menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@
<context name="to_justify_leave_reason" expr="eval: false"/>
</action-view>

<menuitem name="all-expense" parent="my-hr-root" title="Expenses" action="expense.all"
order="300" if="__config__.app.isApp('expense')" icon="credit-card-fill"
icon-background="#84429f"/>
<menuitem name="my-hr-expense-root" parent="my-hr-root" title="Expenses"
if="__config__.app.isApp('expense')" icon="credit-card-fill" icon-background="#84429f"
order="300"/>

<menuitem name="edit-expense" parent="my-hr-expense-root" title="Complete my expense"
action="edit.expense" order="100"/>

<menuitem name="all-expense" parent="my-hr-expense-root" title="Expenses"
action="expense.all" order="200"/>

<action-view name="expense.all" model="com.axelor.apps.hr.db.Expense"
title="My Expenses">
Expand All @@ -48,7 +54,7 @@
<context name="_isExpenseDeclaration" expr="eval: false"/>
</action-view>

<menuitem name="my-hr-root-expense-declaration" parent="my-hr-root"
<menuitem name="my-hr-root-expense-declaration" parent="my-hr-expense-root"
title="Expenses declaration" action="my.hr.root.expense.declaration" order="310"
if="__config__.app.isApp('expense') &amp;&amp; __config__.app.getApp('expense')?.enableExpenseDeclaration"
icon="credit-card-fill" icon-background="#84429f"/>
Expand All @@ -66,7 +72,7 @@
<context name="_isExpenseDeclaration" expr="eval: true"/>
</action-view>

<menuitem name="line-expense" parent="my-hr-root" title="OrphanExpenseLine.title"
<menuitem name="line-expense" parent="my-hr-expense-root" title="OrphanExpenseLine.title"
action="expense.line" order="350"
if="__config__.app.isApp('expense') &amp;&amp; __config__.app.getApp('expense')?.getIsOrphanExpenseLineManaged()"
icon="fa-receipt" icon-background="#84429f"/>
Expand Down

0 comments on commit 43e5d0f

Please sign in to comment.