1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_employee_view_form_inherit_expense" model="ir.ui.view">
<field name="name">hr.employee.view.form.expense</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='managers']" position="inside">
<field name="expense_manager_id" context="{'default_company_id': company_id}"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
<record id="view_employee_tree_inherit_expense" model="ir.ui.view">
<field name="name">hr.employee.tree.expense</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='work_location']" position="after">
<field name="expense_manager_id" optional="hide" string="Expense Approver"/>
</xpath>
</field>
</record>
<record id="res_users_view_form_preferences" model="ir.ui.view">
<field name="name">hr.user.preferences.form.inherit.hr.expense</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="hr.res_users_view_form_profile" />
<field name="arch" type="xml">
<xpath expr="//group[@name='managers']" position="inside">
<field name="expense_manager_id" attrs="{'readonly': [('can_edit', '=', False)]}" context="{'default_company_id': company_id}"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
<record id="hr_expense_view_expenses_analysis_tree" model="ir.ui.view">
<field name="name">hr.expense.tree</field>
<field name="model">hr.expense</field>
<field name="arch" type="xml">
<tree string="Expenses" multi_edit="1" sample="1" js_class="hr_expense_tree_dashboard_upload">
<header>
<button name="action_submit_expenses" type="object" string="Create Report"/>
</header>
<field name="attachment_number" invisible="True"/>
<field name="date" optional="show"/>
<field name="accounting_date" optional="hide" groups="account.group_account_invoice,account.group_account_readonly"/>
<field name="name"/>
<field name="employee_id" widget="many2one_avatar_employee"/>
<field name="sheet_id" optional="show" invisible="not context.get('show_report', False)" readonly="1"/>
<field name="payment_mode" optional="show"/>
<field name="reference" optional="hide"/>
<field name="analytic_account_id" optional="show" groups="analytic.group_analytic_accounting"/>
<field name="analytic_tag_ids" optional="hide" widget="many2many_tags" groups="analytic.group_analytic_tags"/>
<field name="account_id" optional="hide"/>
<field name="company_id" optional="show" groups="base.group_multi_company" readonly="1"/>
<field name="unit_amount" optional="hide" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" optional="hide"/>
<field name="quantity" optional="hide"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="tax_ids" optional="show" widget="many2many_tags" groups="account.group_account_user"/>
<field name="total_amount" optional="show" sum="Total Amount" widget="monetary" options="{'currency_field': 'currency_id'}" decoration-bf="True"/>
<button name="action_get_attachment_view" string="Attachments" type="object" icon="fa-paperclip" attrs="{'invisible': [('attachment_number', '=', 0)]}"/>
<field name="message_unread" invisible="1"/>
<field name="state" optional="show" readonly="1" decoration-info="state == 'draft'" decoration-success="state in ['reported', 'approved', 'done']" decoration-danger="state in 'refused'" widget="badge"/>
</tree>
</field>
</record>
<record id="view_expenses_tree" model="ir.ui.view">
<field name="name">hr.expense.tree</field>
<field name="model">hr.expense</field>
<field name="inherit_id" ref="hr_expense_view_expenses_analysis_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<!-- Display the tree dashboard view with the header -->
<attribute name="js_class">hr_expense_tree_dashboard_upload_header</attribute>
</xpath>
</field>
</record>
<record id="view_my_expenses_tree" model="ir.ui.view">
<field name="name">hr.expense.tree</field>
<field name="model">hr.expense</field>
<field name="priority">20</field>
<field name="inherit_id" ref="hr_expense.view_expenses_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<!-- Display the tree dashboard view with the header -->
<attribute name="js_class">hr_expense_tree_dashboard_header</attribute>
<attribute name="class">hr_expense</attribute>
</xpath>
</field>
</record>
<record id="hr_expense_view_form" model="ir.ui.view">
<field name="name">hr.expense.view.form</field>
<field name="model">hr.expense</field>
<field name="arch" type="xml">
<form string="Expenses" class="o_expense_form">
<header>
<button name="action_submit_expenses" string="Create Report" type="object" class="oe_highlight o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '<=', 0), ('sheet_id', '!=', False)]}"/>
<widget name="attach_document" string="Attach Receipt" action="message_post" attrs="{'invisible': ['|', ('attachment_number', '<', 1), ('id','=',False)]}"/>
<widget name="attach_document" string="Attach Receipt" action="message_post" highlight="1" attrs="{'invisible': ['|',('attachment_number', '>=', 1), ('id','=',False)]}"/>
<button name="action_submit_expenses" string="Create Report" type="object" class="o_expense_submit" attrs="{'invisible': ['|', ('attachment_number', '>=', 1), ('sheet_id', '!=', False)]}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,reported,approved,done,refused"/>
<button name="action_view_sheet" type="object" string="View Report" class="oe_highlight" attrs="{'invisible': [('sheet_id', '=', False)]}"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_get_attachment_view"
class="oe_stat_button"
icon="fa-file-text-o"
type="object">
<field name="attachment_number" widget="statinfo" string="Receipts" options="{'reload_on_button': true}"/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="e.g. Lunch with Customer"/>
</h1>
</div>
<group>
<group>
<field name="is_editable" invisible="1"/>
<field name="is_ref_editable" invisible="1"/>
<field name="product_id" required="1" context="{'default_can_be_expensed': 1, 'tree_view_ref': 'hr_expense.product_product_expense_tree_view'}"
widget="many2one_barcode"
/>
<field name="unit_amount" required="1" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>
<field name="product_uom_category_id" invisible="1"/>
<label for="quantity"/>
<div class="o_row">
<field name="quantity" class="oe_inline"/>
<field name="product_uom_id" required="1" widget="selection" class="oe_inline" groups="uom.group_uom"/>
</div>
<field name="tax_ids" widget="many2many_tags" groups="account.group_account_readonly" attrs="{'readonly': [('is_editable', '=', False)]}" context="{'default_company_id': company_id}"/>
<field name="total_amount" widget='monetary' options="{'currency_field': 'currency_id'}"/>
<field name="amount_residual" widget='monetary' options="{'currency_field': 'currency_id'}"/>
</group><group>
<field name="reference" attrs="{'readonly': [('is_ref_editable', '=', False)]}"/>
<field name="date"/>
<field name="accounting_date" attrs="{'invisible': ['|', ('accounting_date', '=', False), ('state', 'not in', ['approved', 'done'])]}" />
<field name="account_id" options="{'no_create': True}" domain="[('internal_type', '=', 'other'), ('company_id', '=', company_id)]" groups="account.group_account_readonly" attrs="{'readonly': [('is_editable', '=', False)]}" context="{'default_company_id': company_id}"/>
<field name="employee_id" groups="hr_expense.group_hr_expense_team_approver" context="{'default_company_id': company_id}"/>
<field name="sheet_id" invisible="1"/>
<field name="currency_id" groups="base.group_multi_currency"/>
<field name="analytic_account_id" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]" groups="analytic.group_analytic_accounting" attrs="{'readonly': [('is_editable', '=', False)]}"/>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" attrs="{'readonly': [('is_editable', '=', False)]}"/>
<field name="company_id" groups="base.group_multi_company"/>
</group><group>
<label for="payment_mode"/>
<div>
<field name="payment_mode" widget="radio"/>
</div>
</group>
</group>
<div>
<field name="description" class="oe_inline" placeholder="Notes..."/>
</div>
</sheet>
<div class="o_attachment_preview"/>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="hr_expense_view_form_without_header" model="ir.ui.view">
<field name="name">hr.expense.view.form</field>
<field name="model">hr.expense</field>
<field name="inherit_id" ref="hr_expense.hr_expense_view_form"/>
<field eval="35" name="priority"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="/form/header" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="/form/sheet/div[hasclass('oe_button_box')]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<field name="employee_id" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<field name="company_id" position="attributes">
<attribute name="readonly">1</attribute>
</field>
</field>
</record>
<record id="hr_expense_view_expenses_analysis_kanban" model="ir.ui.view">
<field name="name">hr.expense.kanban</field>
<field name="model">hr.expense</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile hr_expense" sample="1" js_class="hr_expense_kanban">
<field name="name"/>
<field name="employee_id"/>
<field name="total_amount"/>
<field name="date"/>
<field name="state"/>
<field name="activity_state"/>
<field name="currency_id"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="row">
<div class="col-12">
<strong class="o_kanban_record_title"><span><t t-esc="record.name.value"/></span></strong>
<strong class="o_kanban_record_subtitle float-right"><span class="text-right"><field name="total_amount" widget="monetary"/></span></strong>
</div>
</div>
<div class="row mt8">
<div class="col-6 text-muted">
<span><t t-esc="record.employee_id.value"/> <t t-esc="record.date.value"/></span>
</div>
<div class="col-6">
<span class="float-right text-right">
<field name="state" widget="label_selection" options="{'classes': {'draft': 'default', 'reported': 'primary', 'refused': 'danger', 'done': 'warning',
'approved': 'success'}}"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Kanban view without header -->
<record id="hr_expense_kanban_view" model="ir.ui.view">
<field name="name">hr.expense.kanban</field>
<field name="model">hr.expense</field>
<field name="inherit_id" ref="hr_expense_view_expenses_analysis_kanban"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class">hr_expense_kanban</attribute>
</xpath>
</field>
</record>
<!-- Kanban view with header. Used in "All My Expenses -->
<record id="hr_expense_kanban_view_header" model="ir.ui.view">
<field name="name">hr.expense.kanban</field>
<field name="model">hr.expense</field>
<field name="inherit_id" ref="hr_expense_view_expenses_analysis_kanban"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class">hr_expense_kanban_header</attribute>
</xpath>
</field>
</record>
<record id="hr_expense_view_pivot" model="ir.ui.view">
<field name="name">hr.expense.pivot</field>
<field name="model">hr.expense</field>
<field name="arch" type="xml">
<pivot string="Expenses Analysis" sample="1">
<field name="employee_id" type="row"/>
<field name="date" interval="month" type="col"/>
<field name="total_amount" type="measure"/>
</pivot>
</field>
</record>
<record id="hr_expense_view_graph" model="ir.ui.view">
<field name="name">hr.expense.graph</field>
<field name="model">hr.expense</field>
<field name="arch" type="xml">
<graph string="Expenses Analysis" sample="1">
<field name="date" type="col"/>
<field name="employee_id" type="row"/>
<field name="total_amount" type="measure"/>
</graph>
</field>
</record>
<record id="hr_expense_view_search" model="ir.ui.view">
<field name="name">hr.expense.view.search</field>
<field name="model">hr.expense</field>
<field name="arch" type="xml">
<search string="Expense">
<field string="Expense" name="name" filter_domain="['|', '|', ('employee_id', 'ilike', self), ('name', 'ilike', self), ('product_id', 'ilike', self)]"/>
<field name="date"/>
<field name="employee_id"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<filter string="My Expenses" name="my_expenses" domain="[('employee_id.user_id', '=', uid)]"/>
<filter string="My Team" name="my_team_expenses" domain="[('employee_id.parent_id.user_id', '=', uid)]" groups="hr_expense.group_hr_expense_team_approver" help="Expenses of Your Team Member"/>
<separator />
<filter string="To Report" name="no_report" domain="[('sheet_id', '=', False)]"/>
<filter string="Refused" name="refused" domain="[('state', '=', 'refused')]" help="Refused Expenses"/>
<separator />
<filter string="Expense Date" name="date" date="date"/>
<separator />
<filter string="Former Employees" name="inactive" domain="[('employee_id.active', '=', False)]" groups="hr_expense.group_hr_expense_user,hr_expense.group_hr_expense_manager"/>
<separator/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '>', context_today().strftime('%Y-%m-%d'))]"/>
<group expand="0" string="Group By">
<filter string="Employee" name="employee" domain="[]" context="{'group_by': 'employee_id'}"/>
<filter string="Product" name="product" domain="[]" context="{'group_by': 'product_id'}"/>
<filter string="Analytic Account" name="analyticacc" domain="[]" context="{'group_by': 'analytic_account_id'}" groups="analytic.group_analytic_accounting"/>
<filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/>
<filter string="Expense Date" name="expensesmonth" domain="[]" context="{'group_by': 'date'}" help="Expense Date"/>
<filter string="Company" name="company" domain="[]" context="{'group_by': 'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
</record>
<record id="hr_expense_view_activity" model="ir.ui.view">
<field name="name">hr.expense.activity</field>
<field name="model">hr.expense</field>
<field name="arch" type="xml">
<activity string="Expenses">
<field name="employee_id"/>
<field name="currency_id"/>
<templates>
<div t-name="activity-box">
<img t-att-src="activity_image('hr.employee', 'image_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
<div>
<field name="name" display="full"/>
<field name="total_amount" widget="monetary" muted="1" display="full"/>
</div>
</div>
</templates>
</activity>
</field>
</record>
<record id="hr_expense_actions_all" model="ir.actions.act_window">
<field name="name">Expenses Analysis</field>
<field name="res_model">hr.expense</field>
<field name="view_mode">graph,pivot,tree,kanban,form</field>
<field name="search_view_id" ref="hr_expense_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No data yet!
</p><p>
Create new expenses to get statistics.
</p>
</field>
</record>
<record id="hr_expense_actions_all_graph" model="ir.actions.act_window.view">
<field name="view_mode">graph</field>
<field name="view_id" ref="hr_expense.hr_expense_view_graph"/>
<field name="act_window_id" ref="hr_expense_actions_all"/>
</record>
<record id="hr_expense_actions_all_pivot" model="ir.actions.act_window.view">
<field name="view_mode">pivot</field>
<field name="view_id" ref="hr_expense.hr_expense_view_pivot"/>
<field name="act_window_id" ref="hr_expense_actions_all"/>
</record>
<record id="hr_expense_actions_all_tree" model="ir.actions.act_window.view">
<field name="view_mode">tree</field>
<field name="view_id" ref="hr_expense_view_expenses_analysis_tree"/>
<field name="act_window_id" ref="hr_expense_actions_all"/>
</record>
<record id="hr_expense_actions_all_kanban" model="ir.actions.act_window.view">
<field name="view_mode">kanban</field>
<field name="view_id" ref="hr_expense_view_expenses_analysis_kanban"/>
<field name="act_window_id" ref="hr_expense_actions_all"/>
</record>
<record id="hr_expense_actions_my_unsubmitted" model="ir.actions.act_window">
<field name="name">My Expenses to Report</field>
<field name="res_model">hr.expense</field>
<field name="view_mode">tree,kanban,form,graph,pivot,activity</field>
<field name="search_view_id" ref="hr_expense_view_search"/>
<field name="context">{'search_default_my_expenses': 1, 'search_default_no_report': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_expense_receipt">
Did you try the mobile app?
</p>
<p>Snap pictures of your receipts and let Odoo<br/> automatically create expenses for you.</p>
<p>
<a href="https://apps.apple.com/be/app/odoo/id1272543640" target="_blank">
<img alt="Apple App Store" class="img img-fluid h-100 o_expense_apple_store" src="/hr_expense/static/img/app_store.png"/>
</a>
<a href="https://play.google.com/store/apps/details?id=com.odoo.mobile" target="_blank" class="o_expense_google_store">
<img alt="Google Play Store" class="img img-fluid h-100 o_expense_google_store" src="/hr_expense/static/img/play_store.png"/>
</a>
</p>
</field>
</record>
<!-- Tree & Kanban view for "My Expenses to Report" with the header -->
<record id="hr_expense_actions_my_unsubmitted_tree" model="ir.actions.act_window.view">
<field name="view_mode">tree</field>
<field name="view_id" ref="view_my_expenses_tree"/>
<field name="act_window_id" ref="hr_expense_actions_my_unsubmitted"/>
</record>
<record id="hr_expense_actions_my_unsubmitted_kanban" model="ir.actions.act_window.view">
<field name="view_mode">kanban</field>
<field name="view_id" ref="hr_expense_kanban_view_header"/>
<field name="act_window_id" ref="hr_expense_actions_my_unsubmitted"/>
</record>
<record id="hr_expense_actions_my_all" model="ir.actions.act_window">
<field name="name">All My Expenses</field>
<field name="res_model">hr.expense</field>
<field name="view_mode">tree,kanban,form,graph,pivot,activity</field>
<field name="search_view_id" ref="hr_expense_view_search"/>
<field name="context">{'search_default_my_expenses': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_expense_receipt">
Did you try the mobile app?
</p>
<p>Snap pictures of your receipts and let Odoo<br/> automatically create expenses for you.</p>
<p>
<a href="https://apps.apple.com/be/app/odoo/id1272543640" target="_blank">
<img alt="Apple App Store" class="img img-fluid h-100 o_expense_apple_store" src="/hr_expense/static/img/app_store.png"/>
</a>
<a href="https://play.google.com/store/apps/details?id=com.odoo.mobile" target="_blank" class="o_expense_google_store">
<img alt="Google Play Store" class="img img-fluid h-100 o_expense_google_store" src="/hr_expense/static/img/play_store.png"/>
</a>
</p>
</field>
</record>
<!-- Tree & Kanban view for "All My Expenses" with header -->
<record id="hr_expense_actions_my_all_tree" model="ir.actions.act_window.view">
<field name="view_mode">tree</field>
<field name="view_id" ref="view_my_expenses_tree"/>
<field name="act_window_id" ref="hr_expense_actions_my_all"/>
</record>
<record id="hr_expense_actions_my_all_kanban" model="ir.actions.act_window.view">
<field name="view_mode">kanban</field>
<field name="view_id" ref="hr_expense_kanban_view_header"/>
<field name="act_window_id" ref="hr_expense_actions_my_all"/>
</record>
<record id="view_product_hr_expense_form" model="ir.ui.view">
<field name="name">product.template.expense.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<div name="options" position="inside">
<div>
<field name="can_be_expensed"/>
<label for="can_be_expensed"/>
</div>
</div>
<xpath expr="//page[@name='general_information']//field[@name='taxes_id']" position="after">
<field name="supplier_taxes_id" widget="many2many_tags" attrs="{'invisible':['|',('can_be_expensed','=',False),('purchase_ok','=',True)]}" context="{'default_type_tax_use':'purchase', 'search_default_purchase': 1, 'search_default_service': type == 'service', 'search_default_goods': type == 'consu'}"/>
</xpath>
</field>
</record>
<record id="product_product_expense_form_view" model="ir.ui.view">
<field name="name">product.product.expense.form</field>
<field name="model">product.product</field>
<field name="arch" type="xml">
<form string="Expense Products">
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name='product_variant_count' invisible='1'/>
<field name="id" invisible="True"/>
<field name="image_1920" widget="image" class="oe_avatar" options="{'image_preview': 'image_128'}"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" placeholder="e.g. Lunch"/></h1>
<div name="options" groups="base.group_user" invisible="1">
<div>
<field name="can_be_expensed"/>
<label for="can_be_expensed"/>
</div>
</div>
</div>
<group name="product_details">
<group string="General Information">
<field name="active" invisible="1"/>
<field name="type" invisible="1"/>
<field name="list_price"/>
<field name="standard_price"/>
<field name="uom_id" groups="uom.group_uom" options="{'no_create': True}"/>
<field name="uom_po_id" invisible="1"/>
<label for="default_code"/>
<div>
<field name="default_code"/>
<i class="text-muted oe_edit_only">Use this reference as a subject prefix when submitting by email.</i>
</div>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group string="Accounting">
<field name="property_account_expense_id" groups="account.group_account_readonly"/>
<field name="supplier_taxes_id" widget="many2many_tags" context="{'default_type_tax_use':'purchase'}"/>
<field name="taxes_id" widget="many2many_tags" context="{'default_type_tax_use':'sale'}"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="product_product_expense_tree_view" model="ir.ui.view">
<field name="name">product.product.expense.tree</field>
<field name="model">product.product</field>
<field eval="50" name="priority"/>
<field name="arch" type="xml">
<tree string="Product Variants">
<field name="default_code"/>
<field name="name"/>
<field name="product_template_attribute_value_ids" widget="many2many_tags" groups="product.group_product_variant"/>
<field name="standard_price"/>
<field name="uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/>
<field name="barcode"/>
</tree>
</field>
</record>
<record id="hr_expense_product" model="ir.actions.act_window">
<field name="name">Expense Products</field>
<field name="res_model">product.product</field>
<field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="product.product_search_form_view"/>
<field name="context">{"default_can_be_expensed": 1, 'default_type': 'service'}</field>
<field name="domain">[('can_be_expensed', '=', True)]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No expense products found. Let's create one!
</p><p>
Expense products can be reinvoiced to your customers.
</p>
</field>
</record>
<record id="hr_expense_product_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="hr_expense_product"/>
</record>
<record id="hr_expense_product_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">kanban</field>
<field name="act_window_id" ref="hr_expense_product"/>
</record>
<record id="hr_expense_product_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="product_product_expense_form_view"/>
<field name="act_window_id" ref="hr_expense_product"/>
</record>
<record id="view_hr_expense_sheet_tree" model="ir.ui.view">
<field name="name">hr.expense.sheet.tree</field>
<field name="model">hr.expense.sheet</field>
<field name="arch" type="xml">
<tree string="Expense Reports" js_class="hr_expense_tree_dashboard_upload" sample="1">
<field name="employee_id" widget="many2one_avatar_employee"/>
<field name="accounting_date" optional="show" groups="account.group_account_manager"/>
<field name="create_date" optional="hide"/>
<field name="name" string="Expense Report"/>
<field name="user_id" optional="hide" widget="many2one_avatar_user"/>
<field name="company_id" optional="show" groups="base.group_multi_company"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="total_amount" optional="show" sum="Total Amount" decoration-bf="True"/>
<field name="currency_id" optional="hide"/>
<field name="journal_id" optional="hide"/>
<field name="state" optional="show" decoration-info="state == 'draft'" decoration-success="state in ['submit', 'approve', 'post', 'done']" decoration-danger="state == 'cancel'" widget="badge"/>
<field name="message_unread" invisible="1"/>
</tree>
</field>
</record>
<record id="view_hr_expense_sheet_dashboard_tree" model="ir.ui.view">
<field name="name">hr.expense.sheet.dashboard.tree</field>
<field name="model">hr.expense.sheet</field>
<field name="priority">20</field>
<field name="inherit_id" ref="hr_expense.view_hr_expense_sheet_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="js_class">hr_expense_tree_dashboard</attribute>
</xpath>
</field>
</record>
<!-- Tree view for "My Reports" with header -->
<record id="view_hr_expense_sheet_dashboard_tree_header" model="ir.ui.view">
<field name="name">hr.expense.sheet.dashboard.tree</field>
<field name="model">hr.expense.sheet</field>
<field name="priority">20</field>
<field name="inherit_id" ref="hr_expense.view_hr_expense_sheet_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="js_class">hr_expense_tree_dashboard_header</attribute>
</xpath>
</field>
</record>
<record id="view_hr_expense_sheet_form" model="ir.ui.view">
<field name="name">hr.expense.sheet.form</field>
<field name="model">hr.expense.sheet</field>
<field eval="25" name="priority"/>
<field name="arch" type="xml">
<form string="Expense Reports" class="o_expense_sheet">
<field name="can_reset" invisible="1"/>
<header>
<button name="action_submit_sheet" states="draft" string="Submit to Manager" type="object" class="oe_highlight o_expense_sheet_submit"/>
<button name="approve_expense_sheets" states="submit" string="Approve" type="object" groups="hr_expense.group_hr_expense_team_approver" class="oe_highlight o_expense_sheet_approve"/>
<button name="action_sheet_move_create"
string="Post Journal Entries"
type="object"
class="oe_highlight o_expense_sheet_post"
attrs="{'invisible': [('state', '!=', 'approve')]}"
groups="account.group_account_invoice"/>
<button name="action_register_payment"
type="object"
class="oe_highlight o_expense_sheet_pay"
attrs="{'invisible': [('state', '!=', 'post')]}"
context="{'dont_redirect_to_payments': True}"
string="Register Payment"
groups="account.group_account_invoice"/>
<button name="%(hr_expense.hr_expense_refuse_wizard_action)d" states="submit,approve" context="{'hr_expense_refuse_model':'hr.expense.sheet'}" string="Refuse" type="action" groups="hr_expense.group_hr_expense_team_approver" />
<button name="reset_expense_sheets" string="Reset to Draft" type="object" attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['submit', 'cancel'])]}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,submit,approve,post,done"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_get_attachment_view"
class="oe_stat_button"
icon="fa-file-text-o"
type="object">
<field name="attachment_number" widget="statinfo" string="Documents"/>
</button>
</div>
<widget name="web_ribbon" title="Paid" bg_color="bg-success" attrs="{'invisible': [('state', '!=', 'done')]}"/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="e.g. Trip to NY"/>
</h1>
</div>
<group>
<group name="employee_details">
<field name="employee_id" context="{'default_company_id': company_id}" widget="many2one_avatar_employee"/>
<field name="user_id" domain="[('share', '=', False)]" widget="many2one_avatar_user"/>
<field name="payment_mode"/>
<field name="address_id" invisible="1" context="{'default_company_id': company_id}"/>
<field name="department_id" invisible="1" context="{'default_company_id': company_id}"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<notebook>
<page name="expenses" string="Expense">
<field name="expense_line_ids" nolabel="1" widget="many2many" domain="[('state', '=', 'draft'), ('employee_id', '=', employee_id), ('company_id', '=', company_id)]" options="{'reload_on_button': True}" context="{'form_view_ref' : 'hr_expense.hr_expense_view_form_without_header', 'default_company_id': company_id, 'default_employee_id': employee_id}">
<tree decoration-danger="is_refused" editable="bottom">
<field name="date" optional="show"/>
<field name="name"/>
<field name="state" invisible="1"/>
<field name="reference" optional="hide"/>
<field name="analytic_account_id" optional="show" domain="['|', ('company_id', '=', parent.company_id), ('company_id', '=', False)]" groups="analytic.group_analytic_accounting"/>
<field name="analytic_tag_ids" optional="hide" widget="many2many_tags" groups="analytic.group_analytic_tags"/>
<field name="account_id" optional="hide"/>
<field name="message_unread" invisible="1"/>
<field name="attachment_number" string=" "/>
<button name="action_get_attachment_view" string="View Attachments" type="object" icon="fa-paperclip"/>
<field name="unit_amount" optional="hide" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" optional="hide"/>
<field name="quantity" optional="hide"/>
<field name="company_id" invisible="1"/>
<field name="tax_ids" optional="show" widget="many2many_tags" groups="account.group_account_readonly" context="{'default_company_id': company_id}"/>
<field name="total_amount" optional="show"/>
<field name="company_currency_id" invisible="1"/>
<field name="total_amount_company" optional="show" groups="base.group_multi_currency"/>
<field name="is_refused" invisible="True"/>
</tree>
</field>
<field name="currency_id" invisible="1"/>
<group class="oe_subtotal_footer oe_right" colspan="2" name="expense_total">
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="total_amount"/>
</div>
<field name="total_amount" nolabel="1" class="oe_subtotal_footer_separator"/>
<field name="amount_residual"
class="oe_subtotal_footer_separator"
attrs="{'invisible': [('state', 'not in', ('post', 'done'))]}"/>
</group>
</page>
<page name="other_info" string="Other Info">
<group>
<group>
<field name="journal_id" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('payment_mode', '!=', 'own_account')]}" context="{'default_company_id': company_id}"/>
<field name="bank_journal_id" groups="account.group_account_invoice,account.group_account_readonly" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('payment_mode', '!=', 'company_account')]}" context="{'default_company_id': company_id}"/>
<field name="accounting_date" groups="account.group_account_invoice,account.group_account_readonly" attrs="{'invisible': [('state', 'not in', ['approve', 'post', 'done'])]}"/>
</group>
<group>
<field name="account_move_id" groups="account.group_account_invoice,account.group_account_readonly" attrs="{'invisible': [('state', 'not in', ['post', 'done'])]}" readonly="1"/>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="view_hr_expense_sheet_kanban" model="ir.ui.view">
<field name="name">hr.expense.sheet.kanban</field>
<field name="model">hr.expense.sheet</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="name"/>
<field name="employee_id"/>
<field name="total_amount"/>
<field name="accounting_date"/>
<field name="state"/>
<field name="currency_id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="row">
<div class="col-12">
<strong class="o_kanban_record_title"><span><t t-esc="record.name.value"/></span></strong>
<strong class="o_kanban_record_subtitle float-right"><span class="text-right"><field name="total_amount" widget="monetary"/></span></strong>
</div>
</div>
<div class="row mt8">
<div class="col-6 text-muted">
<span><t t-esc="record.employee_id.value"/> <t t-esc="record.accounting_date.value"/></span>
</div>
<div class="col-6">
<span class="float-right text-right">
<field name="state" widget="label_selection" options="{'classes': {'draft': 'default', 'submit': 'default', 'cancel': 'danger', 'post': 'warning',
'done': 'success'}}"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Kanban view without header -->
<record id="view_hr_expense_sheet_kanban_no_header" model="ir.ui.view">
<field name="name">hr.expense.sheet.kanban</field>
<field name="model">hr.expense.sheet</field>
<field name="inherit_id" ref="view_hr_expense_sheet_kanban"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class">hr_expense_kanban</attribute>
</xpath>
</field>
</record>
<!-- Kanban view with header -->
<record id="view_hr_expense_sheet_kanban_header" model="ir.ui.view">
<field name="name">hr.expense.sheet.kanban</field>
<field name="model">hr.expense.sheet</field>
<field name="inherit_id" ref="view_hr_expense_sheet_kanban"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class">hr_expense_kanban_header</attribute>
</xpath>
</field>
</record>
<record id="view_hr_expense_sheet_pivot" model="ir.ui.view">
<field name="name">hr.expense.sheet.pivot</field>
<field name="model">hr.expense.sheet</field>
<field name="arch" type="xml">
<pivot string="Expenses Analysis" sample="1">
<field name="employee_id" type="row"/>
<field name="accounting_date" interval="month" type="col"/>
<field name="total_amount" type="measure"/>
</pivot>
</field>
</record>
<record id="view_hr_expense_sheet_graph" model="ir.ui.view">
<field name="name">hr.expense.sheet.graph</field>
<field name="model">hr.expense.sheet</field>
<field name="arch" type="xml">
<graph string="Expenses Analysis" sample="1">
<field name="employee_id" type="col"/>
<field name="accounting_date" interval="month" type="row"/>
<field name="total_amount" type="measure"/>
</graph>
</field>
</record>
<record id="hr_expense_sheet_view_search" model="ir.ui.view">
<field name="name">hr.expense.sheet.view.search</field>
<field name="model">hr.expense.sheet</field>
<field name="arch" type="xml">
<search string="Expense">
<field string="Expense Report" name="name"/>
<field name="accounting_date"/>
<separator />
<field name="employee_id"/>
<field string="Department" name="department_id" operator="child_of"/>
<field string="Journal" name="journal_id"/>
<filter string="My Reports" name="my_reports" domain="[('employee_id.user_id', '=', uid)]"/>
<filter string="My Team" name="my_team_reports" domain="[('employee_id.parent_id.user_id', '=', uid)]" groups="hr_expense.group_hr_expense_manager" help="Expenses of Your Team Member"/>
<separator />
<filter domain="[('state', '=', 'submit')]" string="To Approve" name="submitted" help="Confirmed Expenses"/>
<filter domain="[('state', '=', 'approve')]" string="To Post" name="to_post" help="Approved Expenses"/>
<filter domain="[('state', '=', 'post')]" string="To Pay" name="approved" help="Expenses to Invoice"/>
<filter domain="[('state', '=', 'cancel')]" string="Refused" name="canceled"/>
<separator/>
<filter string="Date" name="filter_accounting_date" date="accounting_date"/>
<separator/>
<filter domain="[('employee_id.active', '=', False)]" string="Former Employees" name="inactive" groups="hr_expense.group_hr_expense_user,hr_expense.group_hr_expense_manager"/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '<', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '>', context_today().strftime('%Y-%m-%d'))
]"/>
<group expand="0" string="Group By">
<filter string="Employee" name="employee" domain="[]" context="{'group_by': 'employee_id'}"/>
<filter string="Department" name="department" domain="[]" context="{'group_by': 'department_id'}"/>
<filter string="Company" name="company" domain="[]" context="{'group_by': 'company_id'}" groups="base.group_multi_company"/>
<filter string="Date" name="expenses_month" domain="[]" context="{'group_by': 'accounting_date'}" help="Expenses by Date"/>
<filter string="Status" domain="[]" context="{'group_by': 'state'}" name="state"/>
</group>
</search>
</field>
</record>
<record id="hr_expense_sheet_view_activity" model="ir.ui.view">
<field name="name">hr.expense.sheet.activity</field>
<field name="model">hr.expense.sheet</field>
<field name="arch" type="xml">
<activity string="Expenses">
<field name="employee_id"/>
<field name="currency_id"/>
<templates>
<div t-name="activity-box">
<img t-att-src="activity_image('hr.employee', 'image_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
<div>
<field name="name" display="full"/>
<field name="total_amount" widget="monetary" muted="1" display="full"/>
<field name="state" display="right"/>
</div>
</div>
</templates>
</activity>
</field>
</record>
<record id="action_hr_expense_sheet_my_all" model="ir.actions.act_window">
<field name="name">My Reports</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">tree,kanban,form,pivot,graph,activity</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="domain">[('state', '!=', 'cancel')]</field>
<field name="context">{'search_default_my_reports': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No expense report found. Let's create one!
</p><p>
Once you have created your expense, submit it to your manager who will validate it.
</p>
</field>
</record>
<!-- Tree & Kanban view for "My Reports" with header -->
<record id="action_hr_expense_sheet_my_all_tree" model="ir.actions.act_window.view">
<field name="view_mode">tree</field>
<field name="view_id" ref="view_hr_expense_sheet_dashboard_tree_header"/>
<field name="act_window_id" ref="action_hr_expense_sheet_my_all"/>
</record>
<record id="action_hr_expense_sheet_my_all_kanban" model="ir.actions.act_window.view">
<field name="view_mode">kanban</field>
<field name="view_id" ref="view_hr_expense_sheet_kanban_header"/>
<field name="act_window_id" ref="action_hr_expense_sheet_my_all"/>
</record>
<record id="action_hr_expense_sheet_all_to_approve" model="ir.actions.act_window">
<field name="name">Expense Reports to Approve</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">tree,kanban,form,pivot,graph,activity</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="domain">[]</field>
<field name="context">{'search_default_submitted': 1}</field>
<field name="view_id" ref="view_hr_expense_sheet_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No expense reports found
</p><p>
Approve the new expense reports submitted by the employees you manage.
</p>
</field>
</record>
<record id="action_hr_expense_sheet_all_to_post" model="ir.actions.act_window">
<field name="name">Expense Reports To Post</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">tree,kanban,form,pivot,graph</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="domain">[]</field>
<field name="context">{'search_default_to_post': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No expense reports found
</p><p>
Post the journal entries of the new expense reports approved by the employees' manager.
</p>
</field>
</record>
<record id="action_hr_expense_sheet_all_to_pay" model="ir.actions.act_window">
<field name="name">Expense Reports To Pay</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">tree,kanban,form,pivot,graph</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="domain">[]</field>
<field name="context">{'search_default_approved': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No expense reports found
</p><p>
Reimburse the employees who incurred these costs or simply register the corresponding payments.
</p>
</field>
</record>
<record id="action_hr_expense_sheet_all" model="ir.actions.act_window">
<field name="name">All Reports</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">tree,kanban,form,pivot,graph</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="domain">[]</field>
<field name="context">{}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No expense reports found. Let's create one!
</p><p>
Expense reports regroup all the expenses incurred during a specific event.
</p>
</field>
</record>
<record id="action_hr_expense_account" model="ir.actions.act_window">
<field name="name">Employee Expenses</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">tree,kanban,form,pivot,graph</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="view_id" ref="view_hr_expense_sheet_tree"/>
<field name="domain">[]</field>
<field name="context">{
'search_default_approved': 1,
'search_default_to_post': 1,
}
</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new expense report
</p><p>
Once you have created your expense, submit it to your manager who will validate it.
</p>
</field>
</record>
<record id="action_hr_expense_sheet_all_all" model="ir.actions.act_window">
<field name="name">All Expense Reports</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">graph,pivot,tree,kanban,form</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="domain">[]</field>
<field name="context">{}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new expense report
</p><p>
Once you have created your expense, submit it to your manager who will validate it.
</p>
</field>
</record>
<record id="action_hr_expense_sheet_department_to_approve" model="ir.actions.act_window">
<field name="name">Expense Reports to Approve</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">tree,kanban,form,pivot,graph</field>
<field name="search_view_id" ref="hr_expense_sheet_view_search"/>
<field name="context">{
'search_default_submitted': 1,
'search_default_department_id': [active_id],
'default_department_id': active_id
}
</field>
</record>
<record id="action_hr_expense_sheet_department_filtered" model="ir.actions.act_window">
<field name="name">Expense Reports Analysis</field>
<field name="res_model">hr.expense.sheet</field>
<field name="view_mode">graph,pivot</field>
<field name="context">{
'search_default_department_id': [active_id],
'default_department_id': active_id}
</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No data yet!
</p>
</field>
</record>
<record id="hr_expense_submit_action_server" model="ir.actions.server">
<field name="name">Create Report</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="model_hr_expense"/>
<field name="binding_model_id" ref="model_hr_expense"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_submit_expenses()
</field>
</record>
<record id="hr_expense_sheet_approve_action_server" model="ir.actions.server">
<field name="name">Approve Report</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="model_hr_expense_sheet"/>
<field name="binding_model_id" ref="model_hr_expense_sheet"/>
<field name="binding_view_types">list</field>
<field name="groups_id" eval="[(4,ref('hr_expense.group_hr_expense_team_approver'))]"/>
<field name="state">code</field>
<field name="code">
if records:
action = records.approve_expense_sheets()
</field>
</record>
<record id="hr_expense_sheet_post_action_server" model="ir.actions.server">
<field name="name">Post Entries</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="model_hr_expense_sheet"/>
<field name="binding_model_id" ref="model_hr_expense_sheet"/>
<field name="binding_view_types">list</field>
<field name="groups_id" eval="[(4,ref('hr_expense.group_hr_expense_team_approver'))]"/>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_sheet_move_create()
</field>
</record>
<record id="action_expense_sheet_register_payment" model="ir.actions.server">
<field name="name">Register Payment</field>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
<field name="model_id" ref="hr_expense.model_hr_expense_sheet"/>
<field name="binding_model_id" ref="hr_expense.model_hr_expense_sheet"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_register_payment()
</field>
</record>
<menuitem id="menu_hr_expense_root" name="Expenses" sequence="100" web_icon="hr_expense,static/description/icon.png"/>
<menuitem id="menu_hr_expense_my_expenses" name="My Expenses" sequence="1" parent="menu_hr_expense_root" groups="base.group_user"/>
<menuitem id="menu_hr_expense_my_expenses_to_submit" sequence="1" parent="menu_hr_expense_my_expenses" action="hr_expense_actions_my_unsubmitted" name="My Expenses to Report"/>
<menuitem id="menu_hr_expense_my_expenses_all" sequence="2" parent="menu_hr_expense_my_expenses" action="hr_expense_actions_my_all" name="All My Expenses"/>
<menuitem id="menu_hr_expense_sheet_my_reports" sequence="3" parent="menu_hr_expense_my_expenses" action="action_hr_expense_sheet_my_all" name="My Reports"/>
<menuitem id="menu_hr_expense_report" name="Expense Reports" sequence="2" parent="menu_hr_expense_root"/>
<menuitem id="menu_hr_expense_sheet_all_to_approve"
name="Reports to Approve" sequence="1" parent="menu_hr_expense_report"
action="action_hr_expense_sheet_all_to_approve"
groups="hr_expense.group_hr_expense_team_approver"/>
<menuitem id="menu_hr_expense_sheet_all_to_post"
name="Reports to Post" sequence="2" parent="menu_hr_expense_report"
action="action_hr_expense_sheet_all_to_post"
groups="account.group_account_invoice,hr_expense.group_hr_expense_manager"/>
<menuitem id="menu_hr_expense_sheet_all_to_pay"
name="Reports to Pay" sequence="3" parent="menu_hr_expense_report"
action="action_hr_expense_sheet_all_to_pay"
groups="account.group_account_invoice,hr_expense.group_hr_expense_manager"/>
<menuitem id="menu_hr_expense_sheet_all"
name="All Reports" sequence="4" parent="menu_hr_expense_report"
action="action_hr_expense_sheet_all"
groups="account.group_account_invoice,hr_expense.group_hr_expense_manager"/>
<menuitem id="menu_hr_expense_reports" name="Reporting" sequence="4" parent="menu_hr_expense_root" groups="hr_expense.group_hr_expense_manager"/>
<menuitem id="menu_hr_expense_all_expenses" name="Expenses Analysis" sequence="0" parent="menu_hr_expense_reports" action="hr_expense_actions_all"/>
<menuitem id="menu_hr_expense_configuration" name="Configuration" parent="menu_hr_expense_root"
sequence="100"/>
<menuitem id="menu_hr_product" name="Expense Products" parent="menu_hr_expense_configuration"
action="hr_expense_product" groups="hr_expense.group_hr_expense_manager" sequence="10"/>
<menuitem id="menu_hr_expense_account_employee_expenses" name="Employee Expenses" sequence="22" parent="account.menu_finance_payables" groups="hr_expense.group_hr_expense_user" action="action_hr_expense_account"/>
</odoo>
|