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
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Top menu item -->
<menuitem id="sale_menu_root"
name="Sales"
web_icon="sale_management,static/description/icon.png"
active="False"
sequence="7"/>
<menuitem id="sale_order_menu"
name="Orders"
parent="sale_menu_root"
sequence="2"/>
<menuitem id="report_sales_team"
name="Sales Teams"
parent="sale_order_menu"
groups="sales_team.group_sale_manager"
action="sales_team.crm_team_salesteams_act"
sequence="3"/>
<menuitem id="res_partner_menu"
parent="sale_order_menu"
action="account.res_partner_action_customer"
sequence="4" groups="sales_team.group_sale_salesman"/>
<menuitem id="menu_sale_report"
name="Reporting"
parent="sale_menu_root"
sequence="5"
groups="sales_team.group_sale_manager"/>
<menuitem id="menu_report_product_all"
name="Sales"
action="action_order_report_all"
parent="menu_sale_report"
sequence="1"/>
<menuitem id="menu_sale_config"
name="Configuration"
parent="sale_menu_root"
sequence="6"
groups="sales_team.group_sale_manager"/>
<menuitem id="sales_team_config"
name="Sales Teams"
parent="sale.menu_sale_config"
action="sales_team.sales_team_config_action"
sequence="2"/>
<menuitem id="menu_sales_config"
parent="menu_sale_config"
sequence="4"
name="Sales Orders"/>
<menuitem
id="menu_tag_config"
name="Tags"
parent="sale.menu_sales_config"
action="sales_team.sales_team_crm_tag_action"
sequence="2"/>
<record id="product_template_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="view_id" ref="product.product_template_kanban_view"/>
<field name="search_view_id" ref="product.product_template_search_view"/>
<field name="context">{"search_default_filter_to_sell":1, "sale_multi_pricelist_product_template": 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product
</p><p>
You must define a product for everything you sell or purchase,
whether it's a storable product, a consumable or a service.
</p>
</field>
</record>
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">product.template.product.website.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
<menuitem id="product_menu_catalog" name="Products" parent="sale_menu_root" sequence="4" groups="sales_team.group_sale_salesman"/>
<menuitem id="menu_product" name="Product Variants" parent="product_menu_catalog" sequence="2" groups="base.group_no_one" active="False"/>
<menuitem action="product_template_action" id="menu_product_template_action" parent="product_menu_catalog" sequence="1" active="False"/>
<menuitem id="prod_config_main" name="Products" parent="menu_sale_config" sequence="5"/>
<menuitem id="menu_products" action="product.product_normal_action_sell" parent="product_menu_catalog" groups="product.group_product_variant" sequence="2" active="False"/>
<menuitem id="next_id_16" name="Units of Measure" parent="sale.prod_config_main" sequence="6" groups="uom.group_uom" active="False"/>
<menuitem action="uom.product_uom_form_action" id="menu_product_uom_form_action" parent="sale.prod_config_main" sequence="7" groups="uom.group_uom" active="False"/>
<menuitem action="uom.product_uom_categ_form_action" id="menu_product_uom_categ_form_action" parent="sale.prod_config_main" sequence="8" groups="uom.group_uom" active="False"/>
<menuitem id="menu_product_pricelist_main" name="Pricelists" parent="product_menu_catalog" action="product.product_pricelist_action2" groups="product.group_product_pricelist" sequence="3" active="False"/>
<record id="sale_order_view_activity" model="ir.ui.view">
<field name="name">sale.order.activity</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<activity string="Sales Orders">
<templates>
<div t-name="activity-box">
<div>
<field name="name" display="full"/>
<field name="partner_id" muted="1" display="full"/>
</div>
</div>
</templates>
</activity>
</field>
</record>
<record id="view_sale_order_calendar" model="ir.ui.view">
<field name="name">sale.order.calendar</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<calendar string="Sales Orders" date_start="date_order" color="state" hide_time="true" event_limit="5">
<field name="currency_id" invisible="1"/>
<field name="partner_id" avatar_field="image_128"/>
<field name="amount_total" widget="monetary"/>
<field name="payment_term_id"/>
<field name="state" filters="1" invisible="1"/>
</calendar>
</field>
</record>
<record model="ir.ui.view" id="view_sale_order_graph">
<field name="name">sale.order.graph</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<graph string="Sales Orders" sample="1">
<field name="partner_id"/>
<field name="amount_total" type="measure"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_sale_order_pivot">
<field name="name">sale.order.pivot</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<pivot string="Sales Orders" sample="1">
<field name="date_order" type="row"/>
<field name="amount_total" type="measure"/>
</pivot>
</field>
</record>
<!-- Sales Orders Kanban View -->
<record model="ir.ui.view" id="view_sale_order_kanban">
<field name="name">sale.order.kanban</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="name"/>
<field name="partner_id"/>
<field name="amount_total"/>
<field name="date_order"/>
<field name="state"/>
<field name="currency_id"/>
<field name="activity_state"/>
<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="o_kanban_record_top mb16">
<div class="o_kanban_record_headings mt4">
<strong class="o_kanban_record_title"><span><t t-esc="record.partner_id.value"/></span></strong>
</div>
<strong><field name="amount_total" widget="monetary"/></strong>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left text-muted">
<span><t t-esc="record.name.value"/> <t t-esc="record.date_order.value"/></span>
<field name="activity_ids" widget="kanban_activity"/>
</div>
<div class="oe_kanban_bottom_right">
<field name="state" widget="label_selection" options="{'classes': {'draft': 'default', 'cancel': 'default', 'done': 'success'}}"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_order_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="priority">2</field>
<field name="arch" type="xml">
<tree string="Sales Orders" multi_edit="1" sample="1">
<field name="message_needaction" invisible="1"/>
<field name="name" string="Number" readonly="1" decoration-bf="1"/>
<field name="date_order" string="Order Date" widget="date" optional="show"/>
<field name="commitment_date" optional="hide"/>
<field name="expected_date" optional="hide"/>
<field name="partner_id" readonly="1"/>
<field name="user_id" optional="show" widget="many2one_avatar_user"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="team_id" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
<field name="amount_untaxed" sum="Total Tax Excluded" widget="monetary" optional="hide"/>
<field name="amount_tax" sum="Tax Total" widget="monetary" optional="hide"/>
<field name="amount_total" sum="Total Tax Included" widget="monetary" decoration-bf="1" optional="show"/>
<field name="currency_id" invisible="1"/>
<field name="invoice_status" decoration-success="invoice_status == 'invoiced'" decoration-info="invoice_status == 'to invoice'" decoration-warning="invoice_status == 'upselling'" widget="badge" optional="show"/>
<field name="tag_ids" optional="hide" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
<record id="view_quotation_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="priority">4</field>
<field name="arch" type="xml">
<tree string="Quotation" class="o_sale_order" multi_edit="1" sample="1">
<field name="name" string="Number" readonly="1" decoration-bf="1"/>
<field name="create_date" string="Creation Date" widget="date" optional="show"/>
<field name="commitment_date" widget="date" optional="hide"/>
<field name="expected_date" widget="date" optional="hide"/>
<field name="partner_id" readonly="1"/>
<field name="user_id" widget="many2one_avatar_user" optional="show"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="team_id" optional="hide"/>
<field name="tag_ids" optional="hide" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
<field name="amount_untaxed" sum="Total Tax Excluded" widget="monetary" optional="hide"/>
<field name="amount_tax" sum="Tax Total" widget="monetary" optional="hide"/>
<field name="amount_total" sum="Total Tax Included" widget="monetary" decoration-bf="1" optional="show"/>
<field name="state" decoration-success="state == 'sale' or state == 'done'" decoration-info="state == 'draft' or state == 'sent'" widget="badge" optional="show"/>
<field name="invoice_status" optional="hide"/>
<field name="message_needaction" invisible="1"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="view_quotation_tree_with_onboarding" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="view_quotation_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="banner_route">/sales/sale_quotation_onboarding_panel</attribute>
</xpath>
</field>
</record>
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<form string="Sales Order" class="o_sale_order" js_class="sale_discount_form">
<header>
<field name="authorized_transaction_ids" invisible="1"/>
<button name="payment_action_capture" type="object"
string="Capture Transaction" class="oe_highlight"
attrs="{'invisible': [('authorized_transaction_ids', '=', [])]}"/>
<button name="payment_action_void" type="object"
string="Void Transaction"
confirm="Are you sure you want to void the authorized transaction? This action can't be undone."
attrs="{'invisible': [('authorized_transaction_ids', '=', [])]}"/>
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" class="btn-primary"
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"/>
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" context="{'default_advance_payment_method': 'percentage'}"
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice"
groups="sale.group_proforma_sales" class="btn-primary"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('invoice_count','>=',1)]}" context="{'proforma': True}"/>
<button name="action_confirm" id="action_confirm"
string="Confirm" class="btn-primary" type="object"
attrs="{'invisible': [('state', 'not in', ['sent'])]}"/>
<button name="action_confirm"
string="Confirm" type="object"
attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('invoice_count','>=',1)]}" context="{'proforma': True}"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
<button name="action_cancel" type="object" string="Cancel" attrs="{'invisible': ['|', ('state', 'not in', ['draft', 'sent','sale']), ('id', '=', False)]}"/>
<button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="preview_sale_order"
type="object"
class="oe_stat_button"
icon="fa-globe icon">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Customer</span>
<span class="o_stat_text">Preview</span>
</div>
</button>
<button name="action_view_invoice"
type="object"
class="oe_stat_button"
icon="fa-pencil-square-o"
attrs="{'invisible': [('invoice_count', '=', 0)]}">
<field name="invoice_count" widget="statinfo" string="Invoices"/>
</button>
</div>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group name="sale_header">
<group name="partner_details">
<field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'customer', 'show_address': 1, 'show_vat': True}" options='{"always_reload": True}'/>
<field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}" options='{"always_reload": True}'/>
<field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}" options='{"always_reload": True}'/>
</group>
<group name="order_details">
<field name="validity_date" attrs="{'invisible': [('state', 'in', ['sale', 'done'])]}"/>
<div class="o_td_label" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}">
<label for="date_order" string="Quotation Date"/>
</div>
<field name="date_order" nolabel="1" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
<div class="o_td_label" attrs="{'invisible': [('state', 'in', ['draft', 'sent'])]}">
<label for="date_order" string="Order Date"/>
</div>
<field name="date_order" attrs="{'required': [('state', 'in', ['sale', 'done'])], 'invisible': [('state', 'in', ['draft', 'sent'])]}" nolabel="1"/>
<field name="show_update_pricelist" invisible="1"/>
<label for="pricelist_id" groups="product.group_product_pricelist"/>
<div groups="product.group_product_pricelist" class="o_row">
<field name="pricelist_id" options="{'no_open':True,'no_create': True}"/>
<button name="update_prices" type="object"
string=" Update Prices"
help="Recompute all prices based on this pricelist"
class="btn-link mb-1 px-0" icon="fa-refresh"
confirm="This will update all unit prices based on the currently set pricelist."
attrs="{'invisible': ['|', ('show_update_pricelist', '=', False), ('state', 'in', ['sale', 'done','cancel'])]}"/>
</div>
<field name="currency_id" invisible="1"/>
<field name="payment_term_id" options="{'no_open':True,'no_create': True}"/>
</group>
</group>
<notebook>
<page string="Order Lines" name="order_lines">
<field
name="order_line"
widget="section_and_note_one2many"
mode="tree,kanban"
attrs="{'readonly': [('state', 'in', ('done','cancel'))]}"
>
<form>
<field name="display_type" invisible="1"/>
<!--
We need the sequence field to be here for new lines to be added at the correct position.
TODO: at some point we want to fix this in the framework so that an invisible field is not required.
-->
<field name="sequence" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<group>
<group attrs="{'invisible': [('display_type', '!=', False)]}">
<field name="product_updatable" invisible="1"/>
<field name="product_id"
domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id}"
attrs="{
'readonly': [('product_updatable', '=', False)],
'required': [('display_type', '=', False)],
}"
force_save="1"
widget="many2one_barcode"
/>
<field name="invoice_status" invisible="1"/>
<field name="qty_to_invoice" invisible="1"/>
<field name="qty_delivered_manual" invisible="1"/>
<field name="qty_delivered_method" invisible="1"/>
<field name="price_total" invisible="1"/>
<field name="price_tax" invisible="1"/>
<field name="price_subtotal" invisible="1"/>
<field name="product_uom_readonly" invisible="1"/>
<label for="product_uom_qty"/>
<div class="o_row" name="ordered_qty">
<field
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'uom_qty_change':True, 'company_id': parent.company_id}"
name="product_uom_qty"/>
<field
name="product_uom"
force_save="1"
groups="uom.group_uom"
class="oe_no_button"
attrs="{
'readonly': [('product_uom_readonly', '=', True)],
'required': [('display_type', '=', False)],
}"
/>
</div>
<label for="qty_delivered" string="Delivered" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<div name="delivered_qty" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
<field name="qty_delivered" attrs="{'readonly': [('qty_delivered_method', '!=', 'manual')]}"/>
</div>
<label for="qty_invoiced" string="Invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<div name="invoiced_qty" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
<field name="qty_invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
</div>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" options="{'no_create': True}" context="{'search_view_ref': 'account.account_tax_view_search'}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '>', 0)]}"/>
<label for="discount" groups="product.group_discount_per_so_line"/>
<div name="discount" groups="product.group_discount_per_so_line">
<field name="discount" class="oe_inline"/> %%
</div>
<!--
We need the sequence field to be here
because we want to be able to overwrite the default sequence value in the JS
in order for new lines to be added at the correct position.
NOTE: at some point we want to fix this in the framework so that an invisible field is not required.
-->
<field name="sequence" invisible="1"/>
</group>
<group attrs="{'invisible': [('display_type', '!=', False)]}">
<label for="customer_lead"/>
<div name="lead">
<field name="customer_lead" class="oe_inline"/> days
</div>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" options="{'color_field': 'color'}" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/>
</group>
</group>
<label for="name" string="Description" attrs="{'invisible': [('display_type', '!=', False)]}"/>
<label for="name" string="Section Name (eg. Products, Services)" attrs="{'invisible': [('display_type', '!=', 'line_section')]}"/>
<label for="name" string="Note" attrs="{'invisible': [('display_type', '!=', 'line_note')]}"/>
<field name="name"/>
<div name="invoice_lines" groups="base.group_no_one" attrs="{'invisible': [('display_type', '!=', False)]}">
<label for="invoice_lines"/>
<field name="invoice_lines"/>
</div>
<field name="state" invisible="1"/>
<field name="company_id" invisible="1"/>
</form>
<tree
string="Sales Order Lines"
editable="bottom"
>
<control>
<create name="add_product_control" string="Add a product"/>
<create name="add_section_control" string="Add a section" context="{'default_display_type': 'line_section'}"/>
<create name="add_note_control" string="Add a note" context="{'default_display_type': 'line_note'}"/>
</control>
<field name="sequence" widget="handle" />
<!-- We do not display the type because we don't want the user to be bothered with that information if he has no section or note. -->
<field name="display_type" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="product_updatable" invisible="1"/>
<field
name="product_id"
attrs="{
'readonly': [('product_updatable', '=', False)],
'required': [('display_type', '=', False)],
}"
options="{'no_open': True}"
force_save="1"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_lst_price': price_unit,
'default_description_sale': name
}"
domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
widget="product_configurator"
/>
<field name="product_template_id"
string="Product"
invisible="1"
attrs="{
'readonly': [('product_updatable', '=', False)],
'required': [('display_type', '=', False)],
}"
options="{'no_open': True}"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_list_price': price_unit,
'default_description_sale': name
}"
domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
widget="product_configurator"/>
<field name="name" widget="section_and_note_text" optional="show"/>
<field
name="analytic_tag_ids"
optional="hide"
groups="analytic.group_analytic_tags"
widget="many2many_tags"
options="{'color_field': 'color'}"
domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
/>
<field
name="product_uom_qty"
decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom': product_uom,
'company_id': parent.company_id
}"
/>
<field
name="qty_delivered"
decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
string="Delivered"
attrs="{
'column_invisible': [('parent.state', 'not in', ['sale', 'done'])],
'readonly': [('qty_delivered_method', '!=', 'manual')]
}"
optional="show"
/>
<field name="qty_delivered_manual" invisible="1"/>
<field name="qty_delivered_method" invisible="1"/>
<field
name="qty_invoiced"
decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
string="Invoiced"
attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
optional="show"
/>
<field name="qty_to_invoice" invisible="1"/>
<field name="product_uom_readonly" invisible="1"/>
<field
name="product_uom"
force_save="1"
string="UoM"
attrs="{
'readonly': [('product_uom_readonly', '=', True)],
'required': [('display_type', '=', False)],
}"
context="{'company_id': parent.company_id}"
groups="uom.group_uom"
options='{"no_open": True}'
optional="show"
/>
<field
name="customer_lead"
optional="hide"
attrs="{'readonly': [('parent.state', 'not in', ['draft', 'sent', 'sale'])]}"
/>
<field
name="price_unit"
attrs="{'readonly': [('qty_invoiced', '>', 0)]}"
/>
<field
name="tax_id"
widget="many2many_tags"
options="{'no_create': True}"
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '>', 0)]}"
optional="show"
/>
<field name="discount" string="Disc.%" groups="product.group_discount_per_so_line" optional="show" widget="product_discount"/>
<field name="price_subtotal" widget="monetary" groups="account.group_show_line_subtotals_tax_excluded"/>
<field name="price_total" widget="monetary" groups="account.group_show_line_subtotals_tax_included"/>
<field name="state" invisible="1"/>
<field name="invoice_status" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="price_tax" invisible="1"/>
<field name="company_id" invisible="1"/>
</tree>
<kanban class="o_kanban_mobile">
<field name="name"/>
<field name="product_id"/>
<field name="product_uom_qty"/>
<field name="product_uom" groups="uom.group_uom"/>
<field name="price_subtotal"/>
<field name="price_total"/>
<field name="price_tax" invisible="1"/>
<field name="price_total" invisible="1"/>
<field name="price_unit"/>
<field name="display_type"/>
<field name="tax_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click {{ record.display_type.raw_value ? 'o_is_' + record.display_type.raw_value : '' }}">
<t t-if="!record.display_type.raw_value">
<div class="row">
<div class="col-8">
<strong>
<span>
<t t-esc="record.product_id.value"/>
</span>
</strong>
</div>
<div class="col-4">
<strong>
<span class="float-right text-right">
<t t-set="line_price" t-value="record.price_subtotal.value" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="line_price" t-value="record.price_total.value" groups="account.group_show_line_subtotals_tax_included"/>
<t t-esc="line_price"/>
</span>
</strong>
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
<span>
Quantity:
<t t-esc="record.product_uom_qty.value"/>
<t t-esc="record.product_uom.value"/>
</span>
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
<span>
Unit Price:
<t t-esc="record.price_unit.value"/>
</span>
</div>
</div>
</t>
<t t-if="record.display_type.raw_value === 'line_section' || record.display_type.raw_value === 'line_note'">
<div class="row">
<div class="col-12">
<span>
<t t-esc="record.name.value"/>
</span>
</div>
</div>
</t>
</div>
</t>
</templates>
</kanban>
</field>
<group name="note_group" col="6" class="mt-2 mt-md-0">
<group colspan="4">
<field name="note" nolabel="1" placeholder="Terms and conditions..."/>
</group>
<group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
<field name="amount_untaxed" widget='monetary' options="{'currency_field': 'currency_id'}"/>
<field name="amount_tax" widget='monetary' options="{'currency_field': 'currency_id'}"/>
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="amount_total" />
</div>
<field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
</group>
<div class="oe_clear"/>
</group>
</page>
<page string="Other Info" name="other_information">
<group>
<group name="sales_person" string="Sales">
<field name="user_id" domain="[('share', '=', False)]" widget="many2one_avatar_user"/>
<field name="team_id" kanban_view_ref="%(sales_team.crm_team_view_kanban)s" options="{'no_create': True}"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="require_signature"/>
<field name="require_payment"/>
<field name="reference" readonly="1" attrs="{'invisible': [('reference', '=', False)]}"/>
<field name="client_order_ref"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
</group>
<group name="sale_info" string="Invoicing">
<field name="fiscal_position_id" options="{'no_create': True}"/>
<field name="analytic_account_id" context="{'default_partner_id':partner_invoice_id, 'default_name':name}" attrs="{'readonly': [('invoice_count','!=',0),('state','=','sale')]}" groups="analytic.group_analytic_accounting" force_save="1"/>
<field name="invoice_status" states="sale,done" groups="base.group_no_one"/>
</group>
</group>
<group>
<group name="sale_shipping">
<label for="commitment_date" string="Delivery Date"/>
<div name="commitment_date_div" class="o_row">
<field name="commitment_date"/>
<span name="expected_date_span" class="text-muted">Expected: <field name="expected_date" widget="date"/></span>
</div>
</group>
<group string="Reporting" name="sale_reporting" groups="base.group_no_one">
<group name="technical" colspan="2" class="mb-0">
<field name="origin"/>
</group>
<group name="utm_link" colspan="2" class="mt-0">
<field name="campaign_id"/>
<field name="medium_id"/>
<field name="source_id"/>
</group>
</group>
</group>
</page>
<page groups="base.group_no_one" string="Customer Signature" name="customer_signature" attrs="{'invisible': [('require_signature', '=', False), ('signed_by', '=', False), ('signature', '=', False), ('signed_on', '=', False)]}">
<group>
<field name="signed_by"/>
<field name="signed_on"/>
<field name="signature" widget="image"/>
</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_sales_order_auto_done_setting" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="groups_id" eval="[(4, ref('sale.group_auto_done_setting'))]"/>
<field name="arch" type="xml">
<xpath expr="//form//header//button[@name='action_draft']" position="after">
<button name="action_done" type="object" string="Lock" states="sale"
help="If the sale is locked, you can not modify it anymore. However, you will still be able to invoice or deliver." groups="sales_team.group_sale_manager"/>
<button name="action_unlock" type="object" string="Unlock" states="done" groups="sales_team.group_sale_manager"/>
</xpath>
</field>
</record>
<record id="view_sales_order_filter" model="ir.ui.view">
<field name="name">sale.order.list.select</field>
<field name="model">sale.order</field>
<field name="priority" eval="15"/>
<field name="arch" type="xml">
<search string="Search Sales Order">
<field name="name" string="Order" filter_domain="['|', '|', ('name', 'ilike', self), ('client_order_ref', 'ilike', self), ('partner_id', 'child_of', self)]"/>
<field name="partner_id" operator="child_of"/>
<field name="user_id"/>
<field name="team_id" string="Sales Team"/>
<field name="order_line" string="Product" filter_domain="[('order_line.product_id', 'ilike', self)]"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<!-- We only allow to search on the following sale order line fields (product, name) because the other fields, such as price, quantity, ...
will not be searched as often, and if they need to be searched it's usually in the context of products
and then they can be searched from the page listing the sale order lines related to a product (from the product itself).
-->
<filter string="My Orders" domain="[('user_id', '=', uid)]" name="my_sale_orders_filter"/>
<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="Salesperson" name="salesperson" domain="[]" context="{'group_by': 'user_id'}"/>
<filter name="customer" string="Customer" domain="[]" context="{'group_by': 'partner_id'}"/>
<filter string="Order Date" name="order_month" domain="[]" context="{'group_by': 'date_order'}"/>
</group>
</search>
</field>
</record>
<record id="sale_order_view_search_inherit_quotation" model="ir.ui.view">
<field name="name">sale.order.search.inherit.quotation</field>
<field name="model">sale.order</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='my_sale_orders_filter']" position="replace">
<field name="campaign_id"/>
<separator/>
<filter string="My Quotations" name="my_quotation" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter string="Quotations" name="draft" domain="[('state','in',('draft', 'sent'))]"/>
<filter string="Sales Orders" name="sales" domain="[('state','in',('sale','done'))]"/>
<separator/>
<filter string="Create Date" name="filter_create_date" date="create_date"/>
</xpath>
</field>
</record>
<record id="sale_order_view_search_inherit_sale" model="ir.ui.view">
<field name="name">sale.order.search.inherit.sale</field>
<field name="model">sale.order</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='my_sale_orders_filter']" position="after">
<separator/>
<filter string="To Invoice" name="to_invoice" domain="[('invoice_status','=','to invoice')]" />
<filter string="To Upsell" name="upselling" domain="[('invoice_status','=','upselling')]" />
<separator/>
<filter string="Order Date" name="order_date" date="date_order"/>
</xpath>
</field>
</record>
<record id="action_orders" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_sale"/>
<field name="context">{}</field>
<field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="sale_order_action_view_order_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="sale.view_order_tree"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">kanban</field>
<field name="view_id" ref="sale.view_sale_order_kanban"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="sale.view_order_form"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_calendar" model="ir.actions.act_window.view">
<field name="sequence" eval="4"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="sale.view_sale_order_calendar"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_pivot" model="ir.actions.act_window.view">
<field name="sequence" eval="5"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="sale.view_sale_order_pivot"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_graph" model="ir.actions.act_window.view">
<field name="sequence" eval="6"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="sale.view_sale_order_graph"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<menuitem id="menu_sale_order"
name="Orders"
action="action_orders"
parent="sale_order_menu"
sequence="2" groups="sales_team.group_sale_salesman"/>
<record id="action_orders_to_invoice" model="ir.actions.act_window">
<field name="name">Orders to Invoice</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,pivot,kanban,activity</field>
<field name="context">{'create': False}</field>
<field name="domain">[('invoice_status','=','to invoice')]</field>
<field name="search_view_id" ref="view_sales_order_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No orders to invoice found
</p><p>
You can select all orders and invoice them in batch,<br/>
or check every order and invoice them one by one.
</p>
</field>
</record>
<record id="model_sale_order_action_quotation_sent" model="ir.actions.server">
<field name="name">Mark Quotation as Sent</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="binding_model_id" ref="sale.model_sale_order"/>
<field name="binding_view_types">form,list</field>
<field name="state">code</field>
<field name="code">action = records.action_quotation_sent()</field>
</record>
<menuitem id="menu_sale_invoicing"
name="To Invoice"
parent="sale_menu_root"
sequence="3" groups="sales_team.group_sale_salesman"/>
<menuitem id="menu_sale_order_invoice"
action="action_orders_to_invoice"
parent="sale.menu_sale_invoicing"
sequence="2" active="False"/>
<record id="action_orders_upselling" model="ir.actions.act_window">
<field name="name">Orders to Upsell</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,pivot,kanban,activity</field>
<field name="domain">[('invoice_status','=','upselling')]</field>
<field name="context">{'create': False}</field>
<field name="search_view_id" ref="view_sales_order_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No orders to upsell found.
</p><p>
An order is to upsell when delivered quantities are above initially
ordered quantities, and the invoicing policy is based on ordered quantities.
</p><p>
As an example, if you sell pre-paid hours of services, Odoo recommends you
to sell extra hours when all ordered hours have been consumed.
</p>
</field>
</record>
<menuitem action="action_orders_upselling"
id="menu_sale_order_upselling" parent="sale.menu_sale_invoicing"
sequence="5" active="False"/>
<record id="action_quotations_with_onboarding" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_id" ref="view_quotation_tree_with_onboarding"/>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
<field name="context">{'search_default_my_quotation': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="action_quotations" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
<field name="context">{'search_default_my_quotation': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="sale_order_action_view_quotation_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="sale.view_quotation_tree"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">kanban</field>
<field name="view_id" ref="sale.view_sale_order_kanban"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="sale.view_order_form"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_calendar" model="ir.actions.act_window.view">
<field name="sequence" eval="4"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="sale.view_sale_order_calendar"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_pivot" model="ir.actions.act_window.view">
<field name="sequence" eval="5"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="sale.view_sale_order_pivot"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_graph" model="ir.actions.act_window.view">
<field name="sequence" eval="6"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="sale.view_sale_order_graph"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<menuitem id="menu_sale_quotations"
action="action_quotations_with_onboarding"
parent="sale_order_menu"
sequence="1" groups="sales_team.group_sale_salesman"/>
<record id="view_order_line_tree" model="ir.ui.view">
<field name="name">sale.order.line.tree</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<tree string="Sales Order Lines" create="false">
<field name="order_id"/>
<field name="order_partner_id"/>
<field name="name"/>
<field name="salesman_id"/>
<field name="product_uom_qty" string="Qty"/>
<field name="qty_delivered"/>
<field name="qty_invoiced"/>
<field name="qty_to_invoice"/>
<field name="product_uom" string="Unit of Measure" groups="uom.group_uom"/>
<field name="price_subtotal" sum="Total" widget="monetary"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="sale_order_line_view_form_readonly" model="ir.ui.view">
<field name="name">sale.order.line.form.readonly</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<form string="Sales Order Item">
<sheet>
<div class="oe_title">
<h1>
<field name="display_name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="order_id" readonly="1"/>
<field name="product_id" readonly="1"/>
<field name="name" readonly="1"/>
<field name="product_uom_qty" readonly="1"/>
<field name="qty_delivered" readonly="1"/>
<field name="qty_invoiced"/>
<field name="product_uom" readonly="1"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="order_partner_id" invisible="1"/>
<field name="display_type" invisible="1"/>
<field name="product_updatable" invisible="1"/>
</group>
<group>
<field name="price_unit" readonly="1"/>
<field name="discount" groups="product.group_discount_per_so_line" readonly="1"/>
<field name="price_subtotal" widget="monetary"/>
<field name="tax_id" widget="many2many_tags" readonly="1"/>
<field name="price_tax" widget="monetary"/>
<field name="price_total" widget="monetary"/>
<field name="currency_id" invisible="1"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_sales_order_line_filter" model="ir.ui.view">
<field name="name">sale.order.line.select</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<search string="Search Sales Order">
<filter string="To Invoice" name="to_invoice" domain="[('qty_to_invoice','!=', 0)]" help="Sales Order Lines ready to be invoiced"/>
<separator/>
<filter string="My Sales Order Lines" name="my_sales_order_lines" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/>
<field name="order_id"/>
<field name="order_partner_id" operator="child_of"/>
<field name="product_id"/>
<field name="salesman_id"/>
<group expand="0" string="Group By">
<filter string="Product" name="product" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Order" name="order" domain="[]" context="{'group_by':'order_id'}"/>
<filter string="Salesperson" name="salesperson" domain="[]" context="{'group_by':'salesman_id'}"/>
</group>
</search>
</field>
</record>
<record id="sale_order_line_view_kanban" model="ir.ui.view">
<field name="name">sale.order.line.kanban</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-12">
<field name="display_name"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record model="ir.ui.view" id="product_form_view_sale_order_button">
<field name="name">product.product.sale.order</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_sales"
type="object" icon="fa-signal" groups="sales_team.group_sale_salesman" help="Sold in the last 365 days" attrs="{'invisible': [('sale_ok', '=', False)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="sales_count" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Sold</span>
</div>
</button>
</div>
<group name="description" position="after">
<group string="Warning when Selling this Product" groups="sale.group_warning_sale">
<field name="sale_line_warn" nolabel="1"/>
<field name="sale_line_warn_msg" colspan="3" nolabel="1"
attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')]}"/>
</group>
</group>
</field>
</record>
<record model="ir.ui.view" id="product_template_form_view_sale_order_button">
<field name="name">product.template.sale.order.button</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_sales"
type="object" icon="fa-signal" groups="sales_team.group_sale_salesman" help="Sold in the last 365 days" attrs="{'invisible': [('sale_ok', '=', False)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="sales_count" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Sold</span>
</div>
</button>
</div>
<group name="description" position="after">
<group string="Warning when Selling this Product" groups="sale.group_warning_sale">
<field name="sale_line_warn" nolabel="1"/>
<field name="sale_line_warn_msg" colspan="3" nolabel="1"
attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')], 'invisible':[('sale_line_warn','=','no-message')]}"/>
</group>
</group>
</field>
</record>
<record model="ir.ui.view" id="product_template_form_view_invoice_policy">
<field name="name">product.template.invoice.policy</field>
<field name="model">product.template</field>
<field name="priority">15</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales']//group[@name='sale']" position="inside">
<group string="Invoicing" name="invoicing" invisible="1">
<field name="invoice_policy" widget="radio"/>
<field name="service_type" widget="radio" invisible="True"/>
<field name="visible_expense_policy" invisible="1"/>
<field name="expense_policy" widget="radio" attrs="{'invisible': [('visible_expense_policy', '=', False)]}"/>
</group>
</xpath>
</field>
</record>
<!-- Update account invoice search view!-->
<record id="account_invoice_groupby_inherit" model="ir.ui.view">
<field name="name">account.move.groupby</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_user_id']" position="after">
<field name="team_id"/>
</xpath>
<xpath expr="//group/filter[@name='status']" position="after">
<filter string="Sales Team" name="sales_channel" domain="[]" context="{'group_by':'team_id'}"/>
</xpath>
</field>
</record>
<record id="account_invoice_view_tree" model="ir.ui.view">
<field name="name">account.move.tree.inherit.sale</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_invoice_tree"/>
<field name="arch" type="xml">
<field name="invoice_user_id" position="after">
<field name="team_id" invisible="context.get('default_move_type') not in ('out_invoice', 'out_refund','out_receipt')" optional="hide"/>
</field>
</field>
</record>
<!-- Update account invoice !-->
<record model="ir.ui.view" id="account_invoice_form">
<field name="name">Account Invoice</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='partner_id']" position="after">
<field name="partner_shipping_id"
groups="sale.group_delivery_invoice_address"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund'))]}"/>
</xpath>
<xpath expr="//field[@name='invoice_line_ids']//field[@name='discount']" position="attributes">
<attribute name="groups">product.group_discount_per_so_line</attribute>
</xpath>
<xpath expr="//group[@name='sale_info_group']/field[@name='invoice_user_id']" position="after">
<field name="team_id" kanban_view_ref="%(sales_team.crm_team_view_kanban)s"/>
</xpath>
<xpath expr="//group[@id='other_tab_group']" position="inside">
<group string="Marketing"
name="utm_link"
groups="base.group_no_one"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}">
<field name="campaign_id"/>
<field name="medium_id"/>
<field name="source_id"/>
</group>
</xpath>
</data>
</field>
</record>
<!-- search by Salesteams -->
<record id="action_orders_salesteams" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
<field name="domain">[('state','not in',('draft','sent','cancel'))]</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
}
</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="action_orders_to_invoice_salesteams" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
<field name="domain">[('invoice_status','=','to invoice')]</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
}
</field>
</record>
<record id="action_quotations_salesteams" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_id" ref="sale.view_quotation_tree"/>
<field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
'show_address': 1,
}
</field>
<field name="domain">[]</field>
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_quotation"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="action_invoice_salesteams" model="ir.actions.act_window">
<field name="name">Invoices</field>
<field name="res_model">account.move</field>
<field name="view_mode">tree,form,kanban</field>
<field name="view_id" ref="account.view_move_tree"/>
<field name="domain">[
('state', '=', 'posted'),
('move_type', 'in', ['out_invoice', 'out_refund'])]</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
'default_move_type':'out_invoice',
'move_type':'out_invoice',
'journal_type': 'sale',
}
</field>
<field name="search_view_id" ref="account.view_account_invoice_filter"/>
</record>
<record id="action_invoice_salesteams_view_tree" model="ir.actions.act_window.view">
<field name="sequence">1</field>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="sale.action_invoice_salesteams"/>
</record>
<record id="action_invoice_salesteams_view_form" model="ir.actions.act_window.view">
<field name="sequence">2</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account.view_move_form"/>
<field name="act_window_id" ref="sale.action_invoice_salesteams"/>
</record>
<record id="action_order_report_quotation_salesteam" model="ir.actions.act_window">
<field name="name">Quotations Analysis</field>
<field name="res_model">sale.report</field>
<field name="view_mode">graph</field>
<field name="domain">[('state','=','draft'),('team_id', '=', active_id)]</field>
<field name="context">{'search_default_order_month':1}</field>
<field name="help">This report performs analysis on your quotations. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
</record>
<record id="action_order_report_so_salesteam" model="ir.actions.act_window">
<field name="name">Sales Analysis</field>
<field name="res_model">sale.report</field>
<field name="view_mode">graph</field>
<field name="domain">[('state','not in',('draft','cancel'))]</field>
<field name="context">{
'search_default_Sales': 1,
'search_default_filter_date': 1,
'search_default_team_id': [active_id]}</field>
<field name="help">This report performs analysis on your sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
</record>
<record id="action_account_invoice_report_salesteam" model="ir.actions.act_window">
<field name="name">Invoices Analysis</field>
<field name="res_model">account.invoice.report</field>
<field name="view_mode">graph</field>
<field name="domain">[('state', 'not in', ['draft', 'cancel'])]</field>
<field name="context">{'search_default_month':1, 'search_default_team_id': [active_id]}</field>
<field name="help">From this report, you can have an overview of the amount invoiced to your customer. The search tool can also be used to personalise your Invoices reports and so, match this analysis to your needs.</field>
</record>
</odoo>
|