466223cf7375e2c5ebf7f1c7f139a856ed05ba84
[xtuple] / enyo-client / database / orm / models / sales_order.json
1 [
2   {
3     "context": "xtuple",
4     "nameSpace": "XM",
5     "type": "SalesOrder",
6     "table": "xt.coheadinfo",
7     "isRest": true,
8     "lockable": true,
9     "lockTable": "cohead",
10     "idSequenceName": "cohead_cohead_id_seq",
11     "orderSequence": "SoNumber",
12     "comment": "Sales Order Map",
13     "privileges": {
14       "all": {
15         "create": "MaintainSalesOrders",
16         "read": "ViewSalesOrders",
17         "update": "MaintainSalesOrders",
18         "delete": "MaintainSalesOrders"
19       },
20       "attribute": {
21         "margin": {
22           "view": "ShowMarginsOnSalesOrder"
23         },
24         "orderDate": {
25           "create": "OverrideSODate",
26           "update": "OverrideSODate"
27         },
28         "packDate": {
29           "create": "AlterPackDate",
30           "update": "AlterPackDate"
31         }
32       },
33       "personal": {
34         "create": false,
35         "read": "ViewPersonalCRMAccounts",
36         "update": false,
37         "delete": false,
38         "properties": [
39           "crmaccountUsers"
40         ]
41       }
42     },
43     "properties": [
44       {
45         "name": "id",
46         "attr": {
47           "type": "Number",
48           "column": "cohead_id",
49           "isPrimaryKey": true
50         }
51       },
52       {
53         "name": "number",
54         "attr": {
55           "type": "String",
56           "column": "cohead_number",
57           "isNaturalKey":true,
58           "required": true
59         }
60       },
61       {
62         "name": "uuid",
63         "attr": {
64           "type": "String",
65           "column": "obj_uuid"
66         }
67       },
68       {
69         "name": "customer",
70         "toOne": {
71           "isNested": true,
72           "type": "SalesCustomer",
73           "column": "cohead_cust_id",
74           "required": true
75         }
76       },
77       {
78         "name": "customerPurchaseOrderNumber",
79         "attr": {
80           "type": "String",
81           "column": "cohead_custponumber"
82          }
83       },
84       {
85         "name": "orderDate",
86         "attr": {
87           "type": "Date",
88           "column": "cohead_orderdate",
89           "required": true
90         }
91       },
92       {
93         "name": "packDate",
94         "attr": {
95           "type": "Date",
96           "column": "cohead_packdate"
97         }
98       },
99       {
100         "name": "scheduleDate",
101         "attr": {
102           "type": "DueDate",
103           "column": "schedule_date"
104         }
105       },
106       {
107         "name": "terms",
108         "toOne": {
109           "type": "Terms",
110           "column": "cohead_terms_id",
111           "required": true
112         }
113       },
114       {
115         "name": "salesRep",
116         "toOne": {
117           "type": "SalesRep",
118           "column": "cohead_salesrep_id",
119           "required": true
120         }
121       },
122       {
123         "name": "commission",
124         "attr": {
125           "type": "Percent",
126           "column": "cohead_commission"
127         }
128       },
129       {
130         "name": "taxZone",
131         "toOne": {
132           "type": "TaxZone",
133           "column": "cohead_taxzone_id"
134         }
135       },
136       {
137         "name": "site",
138         "toOne": {
139           "type": "Site",
140           "column": "cohead_warehous_id"
141         }
142       },
143       {
144         "name": "saleType",
145         "toOne": {
146           "type": "SaleType",
147           "column": "cohead_saletype_id"
148         }
149       },
150       {
151         "name": "status",
152         "attr": {
153           "type": "String",
154           "column": "cohead_status"
155         }
156       },
157       {
158         "name": "billtoName",
159         "attr": {
160           "type": "String",
161           "column": "cohead_billtoname"
162         }
163       },
164       {
165         "name": "billtoAddress1",
166         "attr": {
167           "type": "String",
168           "column": "cohead_billtoaddress1"
169         }
170       },
171       {
172         "name": "billtoAddress2",
173         "attr": {
174           "type": "String",
175           "column": "cohead_billtoaddress2"
176         }
177       },
178       {
179         "name": "billtoAddress3",
180         "attr": {
181           "type": "String",
182           "column": "cohead_billtoaddress3"
183         }
184       },
185       {
186         "name": "billtoCity",
187         "attr": {
188           "type": "String",
189           "column": "cohead_billtocity"
190         }
191       },
192       {
193         "name": "billtoState",
194         "attr": {
195           "type": "String",
196           "column": "cohead_billtostate"
197         }
198       },
199       {
200         "name": "billtoCountry",
201         "attr": {
202           "type": "String",
203           "column": "cohead_billtocountry"
204         }
205       },
206       {
207         "name": "billtoPostalCode",
208         "attr": {
209           "type": "String",
210           "column": "cohead_billtozipcode"
211         }
212       },
213       {
214         "name": "billtoContact",
215         "toOne": {
216           "isNested": true,
217           "type": "ContactRelation",
218           "column": "cohead_billto_cntct_id"
219         }
220       },
221       {
222         "name": "billtoContactHonorific",
223         "attr": {
224           "type": "String",
225           "column": "cohead_billto_cntct_honorific"
226         }
227       },
228       {
229         "name": "billtoContactFirstName",
230         "attr": {
231           "type": "String",
232           "column": "cohead_billto_cntct_first_name"
233         }
234       },
235       {
236         "name": "billtoContactMiddleName",
237         "attr": {
238           "type": "String",
239           "column": "cohead_billto_cntct_middle"
240         }
241       },
242       {
243         "name": "billtoContactLastName",
244         "attr": {
245           "type": "String",
246           "column": "cohead_billto_cntct_last_name"
247         }
248       },
249       {
250         "name": "billtoContactSuffix",
251         "attr": {
252           "type": "String",
253           "column": "cohead_billto_cntct_suffix"
254         }
255       },
256       {
257         "name": "billtoContactPhone",
258         "attr": {
259           "type": "String",
260           "column": "cohead_billto_cntct_phone"
261         }
262       },
263       {
264         "name": "billtoContactTitle",
265         "attr": {
266           "type": "String",
267           "column": "cohead_billto_cntct_title"
268         }
269       },
270       {
271         "name": "billtoContactFax",
272         "attr": {
273           "type": "String",
274           "column": "cohead_billto_cntct_fax"
275         }
276       },
277       {
278         "name": "billtoContactEmail",
279         "attr": {
280           "type": "String",
281           "column": "cohead_billto_cntct_email"
282         }
283       },
284       {
285         "name": "shipto",
286         "toOne": {
287           "isNested": true,
288           "type": "CustomerShiptoRelation",
289           "column": "cohead_shipto_id"
290         }
291       },
292       {
293         "name": "shiptoName",
294         "attr": {
295           "type": "String",
296           "column": "cohead_shiptoname"
297         }
298       },
299       {
300         "name": "shiptoAddress1",
301         "attr": {
302           "type": "String",
303           "column": "cohead_shiptoaddress1"
304         }
305       },
306       {
307         "name": "shiptoAddress2",
308         "attr": {
309           "type": "String",
310           "column": "cohead_shiptoaddress2"
311         }
312       },
313       {
314         "name": "shiptoAddress3",
315         "attr": {
316           "type": "String",
317           "column": "cohead_shiptoaddress3"
318         }
319       },
320       {
321         "name": "shiptoCity",
322         "attr": {
323           "type": "String",
324           "column": "cohead_shiptocity"
325         }
326       },
327       {
328         "name": "shiptoState",
329         "attr": {
330           "type": "String",
331           "column": "cohead_shiptostate"
332         }
333       },
334       {
335         "name": "shiptoCountry",
336         "attr": {
337           "type": "String",
338           "column": "cohead_shiptocountry"
339         }
340       },
341       {
342         "name": "shiptoPostalCode",
343         "attr": {
344           "type": "String",
345           "column": "cohead_shiptozipcode"
346         }
347       },
348       {
349         "name": "shiptoContact",
350         "toOne": {
351           "isNested": true,
352           "type": "ContactRelation",
353           "column": "cohead_shipto_cntct_id"
354         }
355       },
356       {
357         "name": "shiptoContactHonorific",
358         "attr": {
359           "type": "String",
360           "column": "cohead_shipto_cntct_honorific"
361         }
362       },
363       {
364         "name": "shiptoContactFirstName",
365         "attr": {
366           "type": "String",
367           "column": "cohead_shipto_cntct_first_name"
368         }
369       },
370       {
371         "name": "shiptoContactMiddleName",
372         "attr": {
373           "type": "String",
374           "column": "cohead_shipto_cntct_middle"
375         }
376       },
377       {
378         "name": "shiptoContactLastName",
379         "attr": {
380           "type": "String",
381           "column": "cohead_shipto_cntct_last_name"
382         }
383       },
384       {
385         "name": "shiptoContactSuffix",
386         "attr": {
387           "type": "String",
388           "column": "cohead_shipto_cntct_suffix"
389         }
390       },
391       {
392         "name": "shiptoContactPhone",
393         "attr": {
394           "type": "String",
395           "column": "cohead_shipto_cntct_phone"
396         }
397       },
398       {
399         "name": "shiptoContactTitle",
400         "attr": {
401           "type": "String",
402           "column": "cohead_shipto_cntct_title"
403         }
404       },
405       {
406         "name": "shiptoContactFax",
407         "attr": {
408           "type": "String",
409           "column": "cohead_shipto_cntct_fax"
410         }
411       },
412       {
413         "name": "shiptoContactEmail",
414         "attr": {
415           "type": "String",
416           "column": "cohead_shipto_cntct_email"
417         }
418       },
419       {
420         "name": "orderNotes",
421         "attr": {
422           "type": "String",
423           "column": "cohead_ordercomments"
424         }
425       },
426       {
427         "name": "shipNotes",
428         "attr": {
429           "type": "String",
430           "column": "cohead_shipcomments"
431         }
432       },
433       {
434         "name": "fob",
435         "attr": {
436           "type": "String",
437           "column": "cohead_fob"
438         }
439       },
440       {
441         "name": "shipVia",
442         "attr": {
443           "type": "String",
444           "column": "cohead_shipvia"
445         }
446       },
447       {
448         "name": "currency",
449         "toOne": {
450           "type": "Currency",
451           "column": "cohead_curr_id",
452           "required": true,
453           "isNested": true
454         }
455       },
456       {
457         "name": "calculateFreight",
458         "attr": {
459           "type": "Boolean",
460           "column": "cohead_calcfreight",
461           "required": true
462         }
463       },
464       {
465         "name": "shipZone",
466         "toOne": {
467           "type": "ShipZone",
468           "column": "cohead_shipzone_id"
469         }
470       },
471       {
472         "name": "shipCharge",
473         "toOne": {
474           "type": "ShipCharge",
475           "column": "cohead_shipchrg_id"
476         }
477       },
478       {
479         "name": "holdType",
480         "attr": {
481           "type": "String",
482           "column": "cohead_holdtype"
483         }
484       },
485       {
486         "name": "wasQuote",
487         "attr": {
488           "type": "Boolean",
489           "column": "cohead_wasquote",
490           "required": true
491         }
492       },
493       {
494         "name": "shipComplete",
495         "attr": {
496           "type": "Boolean",
497           "column": "cohead_shipcomplete"
498         }
499       },
500       {
501         "name": "quoteNumber",
502         "attr": {
503           "type": "String",
504           "column": "cohead_quote_number"
505         }
506       },
507       {
508         "name": "allocatedCredit",
509         "attr": {
510           "type": "Number",
511           "column": "allocated_credit"
512         }
513       },
514       {
515         "name": "authorizedCredit",
516         "attr": {
517           "type": "Number",
518           "column": "authorized_credit"
519         }
520       },
521       {
522         "name": "outstandingCredit",
523         "attr": {
524           "type": "Number",
525           "column": "outstanding_credit"
526         }
527       },
528       {
529         "name": "balance",
530         "attr": {
531           "type": "Number",
532           "column": "balance"
533         }
534       },
535       {
536         "name": "margin",
537         "attr": {
538           "type": "Percent",
539           "column": "margin"
540         }
541       },
542       {
543         "name": "freightWeight",
544         "attr": {
545           "type": "Number",
546           "column": "freight_weight"
547         }
548       },
549       {
550         "name": "subtotal",
551         "attr": {
552           "type": "Number",
553           "column": "subtotal"
554         }
555       },
556       {
557         "name": "taxTotal",
558         "attr": {
559           "type": "Number",
560           "column": "tax_total"
561         }
562       },
563       {
564         "name": "miscCharge",
565         "attr": {
566           "type": "Number",
567           "column": "cohead_misc"
568         }
569       },
570       {
571         "name": "freight",
572         "attr": {
573           "type": "Number",
574           "column": "cohead_freight"
575         }
576       },
577       {
578         "name": "total",
579         "attr": {
580           "type": "Number",
581           "column": "total"
582         }
583       },
584       {
585         "name": "lineItems",
586         "toMany": {
587           "isNested": true,
588           "type": "SalesOrderLine",
589           "column": "cohead_id",
590           "inverse": "salesOrder"
591         }
592       },
593       {
594         "name": "comments",
595         "toMany": {
596           "isNested": true,
597           "type": "SalesOrderComment",
598           "column": "cohead_id",
599           "inverse": "source"
600         }
601       },
602       {
603         "name": "files",
604         "toMany": {
605           "isNested": true,
606           "type": "SalesOrderFile",
607           "column": "cohead_id",
608           "inverse": "source"
609         }
610       },
611       {
612         "name": "accounts",
613         "toMany": {
614           "isNested": true,
615           "type": "SalesOrderAccount",
616           "column": "cohead_id",
617           "inverse": "source"
618         }
619       },
620       {
621         "name": "contacts",
622         "toMany": {
623           "isNested": true,
624           "type": "SalesOrderContact",
625           "column": "cohead_id",
626           "inverse": "source"
627         }
628       },
629       {
630         "name": "urls",
631         "toMany": {
632           "isNested": true,
633           "type": "SalesOrderUrl",
634           "column": "cohead_id",
635           "inverse": "source"
636         }
637       },
638       {
639         "name": "items",
640         "toMany": {
641           "isNested": true,
642           "type": "SalesOrderItem",
643           "column": "cohead_id",
644           "inverse": "source"
645         }
646       },
647       {
648         "name": "workflow",
649         "toMany": {
650           "isNested": true,
651           "type": "SalesOrderWorkflow",
652           "column": "obj_uuid",
653           "inverse": "parent"
654         }
655       },
656       {
657         "name": "characteristics",
658         "toMany": {
659           "type": "SalesOrderCharacteristic",
660           "column": "cohead_id",
661           "inverse": "salesOrder",
662           "isNested": true
663         }
664       },
665       {
666         "name": "crmaccountUsers",
667         "toMany": {
668           "type": "ShareUsers",
669           "column": "obj_uuid",
670           "inverse": "uuid"
671         }
672       }
673     ],
674     "isSystem": true
675   },
676   {
677     "context": "xtuple",
678     "nameSpace": "XM",
679     "type": "SalesOrderWorkflow",
680     "table": "xt.coheadwf",
681     "comment": "Sales Order Workflow Map",
682     "properties": [
683       {
684         "name": "id",
685         "attr": {
686           "type": "Number",
687           "column": "wf_id",
688           "isPrimaryKey": true
689         }
690       },
691       {
692         "name": "uuid",
693         "attr": {
694           "type": "String",
695           "column": "obj_uuid",
696           "isNaturalKey": true
697         }
698       },
699       {
700         "name": "parent",
701         "attr": {
702           "type": "String",
703           "column": "wf_parent_uuid"
704         }
705       },
706       {
707         "name": "name",
708         "attr": {
709           "type": "String",
710           "column": "wf_name",
711           "required": true
712         }
713       },
714       {
715         "name": "description",
716         "attr": {
717           "type": "String",
718           "column": "wf_description"
719         }
720       },
721       {
722         "name": "workflowType",
723         "attr": {
724           "type": "String",
725           "column": "wf_type"
726         }
727       },
728       {
729         "name": "status",
730         "attr": {
731           "type": "String",
732           "column": "wf_status"
733         }
734       },
735       {
736         "name": "startDate",
737         "attr": {
738           "type": "Date",
739           "column": "wf_start_date"
740         }
741       },
742       {
743         "name": "dueDate",
744         "attr": {
745           "type": "DueDate",
746           "column": "wf_due_date"
747         }
748       },
749       {
750         "name": "assignDate",
751         "attr": {
752           "type": "Date",
753           "column": "wf_assigned_date"
754         }
755       },
756       {
757         "name": "completeDate",
758         "attr": {
759           "type": "Date",
760           "column": "wf_completed_date"
761         }
762       },
763       {
764         "name": "notes",
765         "attr": {
766           "type": "String",
767           "column": "wf_notes"
768         }
769       },
770       {
771         "name": "priority",
772         "toOne": {
773           "type": "Priority",
774           "column": "wf_priority_id",
775           "required": true
776         }
777       },
778       {
779         "name": "sequence",
780         "attr": {
781           "type": "Number",
782           "column": "wf_sequence"
783         }
784       },
785       {
786         "name": "owner",
787         "toOne": {
788           "isNested": true,
789           "type": "UserAccountRelation",
790           "column": "wf_owner_username",
791           "inverse": "username"
792         }
793       },
794       {
795         "name": "assignedTo",
796         "toOne": {
797           "isNested": true,
798           "type": "UserAccountRelation",
799           "column": "wf_assigned_username",
800           "inverse": "username"
801         }
802       },
803       {
804         "name": "completedParentStatus",
805         "attr": {
806           "type": "String",
807           "column": "wf_completed_parent_status"
808         }
809       },
810       {
811         "name": "deferredParentStatus",
812         "attr": {
813           "type": "String",
814           "column": "wf_deferred_parent_status"
815         }
816       },
817       {
818         "name": "completedSuccessors",
819         "attr": {
820           "type": "String",
821           "column": "wf_completed_successors"
822         }
823       },
824       {
825         "name": "deferredSuccessors",
826         "attr": {
827           "type": "String",
828           "column": "wf_deferred_successors"
829         }
830       }
831     ],
832     "isNestedOnly": true,
833     "isSystem": true
834   },
835   {
836     "context": "xtuple",
837     "nameSpace": "XM",
838     "type": "SalesOrderAccount",
839     "table": "xt.doc",
840     "idSequenceName": "docass_docass_id_seq",
841     "comment": "Sales Order Account Map",
842     "privileges": {
843       "all": {
844         "create": true,
845         "read": true,
846         "update": false,
847         "delete": true
848       }
849     },
850     "properties": [
851       {
852         "name": "id",
853         "attr": {
854           "type": "Number",
855           "column": "id",
856           "isPrimaryKey": true
857         }
858       },
859       {
860         "name": "uuid",
861         "attr": {
862           "type": "String",
863           "column": "obj_uuid",
864           "isNaturalKey": true
865         }
866       },
867       {
868         "name": "sourceType",
869         "attr": {
870           "type": "String",
871           "column": "source_type",
872           "value": "S"
873         }
874       },
875       {
876         "name": "source",
877         "attr": {
878           "type": "Number",
879           "column": "source_id"
880         }
881       },
882       {
883         "name": "targetType",
884         "attr": {
885           "type": "String",
886           "column": "target_type",
887           "value": "CRMA"
888         }
889       },
890       {
891         "name": "account",
892         "toOne": {
893           "isNested": true,
894           "type": "AccountRelation",
895           "column": "target_id"
896         }
897       },
898       {
899         "name": "purpose",
900         "attr": {
901           "type": "String",
902           "column": "purpose"
903         }
904       }
905     ],
906     "isNestedOnly": true,
907     "isSystem": true
908   },
909   {
910     "context": "xtuple",
911     "nameSpace": "XM",
912     "type": "SalesOrderComment",
913     "table": "comment",
914     "idSequenceName": "comment_comment_id_seq",
915     "comment": "Sales Order Comment Map",
916     "privileges": {
917       "all": {
918         "create": true,
919         "read": true,
920         "update": "EditOthersComments",
921         "delete": false
922       },
923       "personal": {
924         "update": "EditOwnComments",
925         "properties": [
926           "createdBy"
927         ]
928       }
929     },
930     "properties": [
931       {
932         "name": "id",
933         "attr": {
934           "type": "Number",
935           "column": "comment_id",
936           "isPrimaryKey": true
937         }
938       },
939       {
940         "name": "uuid",
941         "attr": {
942           "type": "String",
943           "column": "obj_uuid",
944           "isNaturalKey": true
945         }
946       },
947       {
948         "name": "sourceType",
949         "attr": {
950           "type": "String",
951           "column": "comment_source",
952           "value": "S"
953         }
954       },
955       {
956         "name": "source",
957         "attr": {
958           "type": "Number",
959           "column": "comment_source_id"
960         }
961       },
962       {
963         "name": "commentType",
964         "toOne": {
965           "type": "CommentType",
966           "column": "comment_cmnttype_id",
967           "required": true
968         }
969       },
970       {
971         "name": "text",
972         "attr": {
973           "type": "String",
974           "column": "comment_text"
975         }
976       },
977       {
978         "name": "isPublic",
979         "attr": {
980           "type": "Boolean",
981           "column": "comment_public",
982           "value": true
983         }
984       },
985       {
986         "name": "created",
987         "attr": {
988           "type": "Date",
989           "column": "comment_date"
990         }
991       },
992       {
993         "name": "createdBy",
994         "attr": {
995           "type": "String",
996           "column": "comment_user"
997         }
998       }
999     ],
1000     "isNestedOnly": true,
1001     "isSystem": true
1002   },
1003   {
1004     "context": "xtuple",
1005     "nameSpace": "XM",
1006     "type": "SalesOrderContact",
1007     "table": "xt.doc",
1008     "idSequenceName": "docass_docass_id_seq",
1009     "comment": "Sales Order Contact Map",
1010     "privileges": {
1011       "all": {
1012         "create": true,
1013         "read": true,
1014         "update": false,
1015         "delete": true
1016       }
1017     },
1018     "properties": [
1019       {
1020         "name": "id",
1021         "attr": {
1022           "type": "Number",
1023           "column": "id",
1024           "isPrimaryKey": true
1025         }
1026       },
1027       {
1028         "name": "uuid",
1029         "attr": {
1030           "type": "String",
1031           "column": "obj_uuid",
1032           "isNaturalKey": true
1033         }
1034       },
1035       {
1036         "name": "sourceType",
1037         "attr": {
1038           "type": "String",
1039           "column": "source_type",
1040           "value": "S"
1041         }
1042       },
1043       {
1044         "name": "source",
1045         "attr": {
1046           "type": "Number",
1047           "column": "source_id"
1048         }
1049       },
1050       {
1051         "name": "targetType",
1052         "attr": {
1053           "type": "String",
1054           "column": "target_type",
1055           "value": "T"
1056         }
1057       },
1058       {
1059         "name": "contact",
1060         "toOne": {
1061           "isNested": true,
1062           "type": "ContactRelation",
1063           "column": "target_id"
1064         }
1065       },
1066       {
1067         "name": "purpose",
1068         "attr": {
1069           "type": "String",
1070           "column": "purpose"
1071         }
1072       }
1073     ],
1074     "isNestedOnly": true,
1075     "isSystem": true
1076   },
1077   {
1078     "context": "xtuple",
1079     "nameSpace": "XM",
1080     "type": "SalesOrderFile",
1081     "table": "xt.doc",
1082     "idSequenceName": "docass_docass_id_seq",
1083     "comment": "Sales Order File Map",
1084     "privileges": {
1085       "all": {
1086         "create": true,
1087         "read": true,
1088         "update": false,
1089         "delete": true
1090       }
1091     },
1092     "properties": [
1093       {
1094         "name": "id",
1095         "attr": {
1096           "type": "Number",
1097           "column": "id",
1098           "isPrimaryKey": true
1099         }
1100       },
1101       {
1102         "name": "uuid",
1103         "attr": {
1104           "type": "String",
1105           "column": "obj_uuid",
1106           "isNaturalKey": true
1107         }
1108       },
1109       {
1110         "name": "sourceType",
1111         "attr": {
1112           "type": "String",
1113           "column": "source_type",
1114           "value": "S"
1115         }
1116       },
1117       {
1118         "name": "source",
1119         "attr": {
1120           "type": "Number",
1121           "column": "source_id"
1122         }
1123       },
1124       {
1125         "name": "targetType",
1126         "attr": {
1127           "type": "String",
1128           "column": "target_type",
1129           "value": "FILE"
1130         }
1131       },
1132       {
1133         "name": "file",
1134         "toOne": {
1135           "isNested": true,
1136           "type": "FileRelation",
1137           "column": "target_id"
1138         }
1139       },
1140       {
1141         "name": "purpose",
1142         "attr": {
1143           "type": "String",
1144           "column": "purpose"
1145         }
1146       }
1147     ],
1148     "isNestedOnly": true,
1149     "isSystem": true
1150   },
1151   {
1152     "context": "xtuple",
1153     "nameSpace": "XM",
1154     "type": "SalesOrderItem",
1155     "table": "xt.doc",
1156     "idSequenceName": "docass_docass_id_seq",
1157     "comment": "Sales Order Item Map",
1158     "privileges": {
1159       "all": {
1160         "create": true,
1161         "read": true,
1162         "update": false,
1163         "delete": true
1164       }
1165     },
1166     "properties": [
1167       {
1168         "name": "id",
1169         "attr": {
1170           "type": "Number",
1171           "column": "id",
1172           "isPrimaryKey": true
1173         }
1174       },
1175       {
1176         "name": "uuid",
1177         "attr": {
1178           "type": "String",
1179           "column": "obj_uuid",
1180           "isNaturalKey": true
1181         }
1182       },
1183       {
1184         "name": "sourceType",
1185         "attr": {
1186           "type": "String",
1187           "column": "source_type",
1188           "value": "S"
1189         }
1190       },
1191       {
1192         "name": "source",
1193         "attr": {
1194           "type": "Number",
1195           "column": "source_id"
1196         }
1197       },
1198       {
1199         "name": "targetType",
1200         "attr": {
1201           "type": "String",
1202           "column": "target_type",
1203           "value": "I"
1204         }
1205       },
1206       {
1207         "name": "item",
1208         "toOne": {
1209           "isNested": true,
1210           "type": "ItemRelation",
1211           "column": "target_id"
1212         }
1213       },
1214       {
1215         "name": "purpose",
1216         "attr": {
1217           "type": "String",
1218           "column": "purpose"
1219         }
1220       }
1221     ],
1222     "isNestedOnly": true,
1223     "isSystem": true
1224   },
1225   {
1226     "context": "xtuple",
1227     "nameSpace": "XM",
1228     "type": "SalesOrderLine",
1229     "table": "xt.coiteminfo",
1230     "idSequenceName": "coitem_coitem_id_seq",
1231     "comment": "Sales Order Line Item Map",
1232     "privileges": {
1233       "all": {
1234         "create": "MaintainSalesOrders",
1235         "read": "ViewSalesOrders",
1236         "update": "MaintainSalesOrders",
1237         "delete": "MaintainSalesOrders"
1238       },
1239       "attribute": {
1240         "firm": {
1241           "create": "FirmSalesOrder",
1242           "update": "FirmSalesOrder"
1243         },
1244         "margin": {
1245           "view": "ShowMarginsOnSalesOrder"
1246         },
1247         "unitCost": {
1248           "view": "ViewCosts"
1249         },
1250         "taxType": {
1251           "create": "OverrideTax",
1252           "update": "OverrideTax"
1253         },
1254         "markup": {
1255           "view": "ViewCosts"
1256         }
1257       }
1258     },
1259     "properties": [
1260       {
1261         "name": "id",
1262         "attr": {
1263           "type": "Number",
1264           "column": "coitem_id",
1265           "isPrimaryKey": true
1266         }
1267       },
1268       {
1269         "name": "uuid",
1270         "attr": {
1271           "type": "String",
1272           "column": "obj_uuid",
1273           "isNaturalKey": true
1274         }
1275       },
1276       {
1277         "name": "salesOrder",
1278         "attr": {
1279           "type": "Number",
1280           "column": "coitem_cohead_id",
1281           "required": true
1282         }
1283       },
1284       {
1285         "name": "lineNumber",
1286         "attr": {
1287           "type": "Number",
1288           "column": "coitem_linenumber",
1289           "required": true
1290         }
1291       },
1292       {
1293         "name": "subNumber",
1294         "attr": {
1295           "type": "Number",
1296           "column": "coitem_subnumber",
1297           "required": true
1298         }
1299       },
1300       {
1301         "name": "item",
1302         "toOne": {
1303           "required": true,
1304           "isNested": true,
1305           "type": "ItemRelation",
1306           "column": "coitem_item_id"
1307         }
1308       },
1309       {
1310         "name": "site",
1311         "toOne": {
1312           "isNested": true,
1313           "type": "SiteRelation",
1314           "column": "coitem_warehous_id",
1315           "required": true
1316         }
1317       },
1318       {
1319         "name": "unitCost",
1320         "attr": {
1321           "type": "Cost",
1322           "column": "coitem_unitcost"
1323         }
1324       },
1325       {
1326         "name": "quantity",
1327         "attr": {
1328           "type": "Quantity",
1329           "column": "coitem_qtyord",
1330           "required": true
1331         }
1332       },
1333       {
1334         "name": "quantityUnit",
1335         "toOne": {
1336           "type": "Unit",
1337           "column": "coitem_qty_uom_id",
1338           "required": true
1339         }
1340       },
1341       {
1342         "name": "quantityUnitRatio",
1343         "attr": {
1344           "type": "UnitRatio",
1345           "column": "coitem_qty_invuomratio",
1346           "required": true
1347         }
1348       },
1349       {
1350         "name": "basePrice",
1351         "attr": {
1352           "type": "SalesPrice",
1353           "column": "base_price"
1354         }
1355       },
1356       {
1357         "name": "customerPrice",
1358         "attr": {
1359           "type": "SalesPrice",
1360           "column": "coitem_custprice",
1361           "required": true
1362         }
1363       },
1364       {
1365         "name": "discount",
1366         "attr": {
1367           "type": "Percent",
1368           "column": "cust_discount"
1369         }
1370       },
1371       {
1372         "name": "price",
1373         "attr": {
1374           "type": "SalesPrice",
1375           "column": "coitem_price",
1376           "required": true
1377         }
1378       },
1379       {
1380         "name": "scheduleDate",
1381         "attr": {
1382           "type": "DueDate",
1383           "column": "coitem_scheddate",
1384           "required": true
1385         }
1386       },
1387       {
1388         "name": "promiseDate",
1389         "attr": {
1390           "type": "Date",
1391           "column": "coitem_promdate"
1392         }
1393       },
1394       {
1395         "name": "markup",
1396         "attr": {
1397           "type": "Percent",
1398           "column": "markup"
1399         }
1400       },
1401       {
1402         "name": "listPrice",
1403         "attr": {
1404           "type": "Money",
1405           "column": "list_price"
1406         }
1407       },
1408       {
1409         "name": "listPriceDiscount",
1410         "attr": {
1411           "type": "Percent",
1412           "column": "list_price_discount"
1413         }
1414       },
1415       {
1416         "name": "customerPartNumber",
1417         "attr": {
1418           "type": "String",
1419           "column": "coitem_custpn"
1420         }
1421       },
1422       {
1423         "name": "priceUnit",
1424         "toOne": {
1425           "type": "Unit",
1426           "column": "coitem_price_uom_id",
1427           "required": true
1428         }
1429       },
1430       {
1431         "name": "priceUnitRatio",
1432         "attr": {
1433           "type": "UnitRatio",
1434           "column": "coitem_price_invuomratio",
1435           "required": true
1436         }
1437       },
1438       {
1439         "name": "extendedPrice",
1440         "attr": {
1441           "type": "ExtendedPrice",
1442           "column": "ext_price"
1443         }
1444       },
1445       {
1446         "name": "margin",
1447         "attr": {
1448           "type": "Percent",
1449           "column": "margin"
1450         }
1451       },
1452       {
1453         "name": "taxType",
1454         "toOne": {
1455           "type": "TaxType",
1456           "column": "coitem_taxtype_id"
1457         }
1458       },
1459       {
1460         "name": "tax",
1461         "attr": {
1462           "type": "Number",
1463           "column": "tax"
1464         }
1465       },
1466       {
1467         "name": "status",
1468         "attr": {
1469           "type": "String",
1470           "column": "coitem_status"
1471         }
1472       },
1473       {
1474         "name": "substituteItem",
1475         "toOne": {
1476           "type": "Item",
1477           "column": "coitem_substitute_item_id"
1478         }
1479       },
1480       {
1481         "name": "firm",
1482         "attr": {
1483           "type": "Boolean",
1484           "column": "coitem_firm",
1485           "required": true
1486         }
1487       },
1488       {
1489         "name": "notes",
1490         "attr": {
1491           "type": "String",
1492           "column": "coitem_memo"
1493         }
1494       },
1495       {
1496         "name": "comments",
1497         "toMany": {
1498           "type": "SalesOrderLineComment",
1499           "column": "coitem_id",
1500           "inverse": "salesOrderLine",
1501           "isNested": true
1502         }
1503       },
1504       {
1505         "name": "characteristics",
1506         "toMany": {
1507           "type": "SalesOrderLineCharacteristic",
1508           "column": "coitem_id",
1509           "inverse": "salesOrderLine",
1510           "isNested": true
1511         }
1512       }
1513     ],
1514     "isSystem": true,
1515     "isNestedOnly": true
1516   },
1517   {
1518     "context": "xtuple",
1519     "nameSpace": "XM",
1520     "type": "SalesOrderCharacteristic",
1521     "table": "charass",
1522     "idSequenceName": "charass_charass_id_seq",
1523     "comment": "Sales Order Characteristic Map",
1524     "privileges": {
1525       "all": {
1526         "create": true,
1527         "read": true,
1528         "update": true,
1529         "delete": true
1530       }
1531     },
1532     "properties": [
1533       {
1534         "name": "id",
1535         "attr": {
1536           "type": "Number",
1537           "column": "charass_id",
1538           "isPrimaryKey": true
1539         }
1540       },
1541       {
1542         "name": "uuid",
1543         "attr": {
1544           "type": "String",
1545           "column": "obj_uuid",
1546           "isNaturalKey": true
1547         }
1548       },
1549       {
1550         "name": "targetType",
1551         "attr": {
1552           "type": "String",
1553           "column": "charass_target_type",
1554           "value": "S"
1555         }
1556       },
1557       {
1558         "name": "salesOrder",
1559         "attr": {
1560           "type": "Number",
1561           "column": "charass_target_id"
1562         }
1563       },
1564       {
1565         "name": "characteristic",
1566         "toOne": {
1567           "type": "Characteristic",
1568           "column": "charass_char_id",
1569           "required": true
1570         }
1571       },
1572       {
1573         "name": "value",
1574         "attr": {
1575           "type": "String",
1576           "column": "charass_value"
1577         }
1578       }
1579     ],
1580     "isNestedOnly": true,
1581     "isSystem": true
1582   },
1583   {
1584     "context": "xtuple",
1585     "nameSpace": "XM",
1586     "type": "SalesOrderLineCharacteristic",
1587     "table": "charass",
1588     "idSequenceName": "charass_charass_id_seq",
1589     "comment": "Sales Order Line Characteristic Map",
1590     "privileges": {
1591       "all": {
1592         "create": true,
1593         "read": true,
1594         "update": true,
1595         "delete": true
1596       }
1597     },
1598     "properties": [
1599       {
1600         "name": "id",
1601         "attr": {
1602           "type": "Number",
1603           "column": "charass_id",
1604           "isPrimaryKey": true
1605         }
1606       },
1607       {
1608         "name": "uuid",
1609         "attr": {
1610           "type": "String",
1611           "column": "obj_uuid",
1612           "isNaturalKey": true
1613         }
1614       },
1615       {
1616         "name": "targetType",
1617         "attr": {
1618           "type": "String",
1619           "column": "charass_target_type",
1620           "value": "SI"
1621         }
1622       },
1623       {
1624         "name": "salesOrderLine",
1625         "attr": {
1626           "type": "Number",
1627           "column": "charass_target_id"
1628         }
1629       },
1630       {
1631         "name": "characteristic",
1632         "toOne": {
1633           "type": "Characteristic",
1634           "column": "charass_char_id",
1635           "required": true
1636         }
1637       },
1638       {
1639         "name": "value",
1640         "attr": {
1641           "type": "String",
1642           "column": "charass_value"
1643         }
1644       },
1645       {
1646         "name": "price",
1647         "attr": {
1648           "type": "Money",
1649           "column": "charass_price"
1650         }
1651       }
1652     ],
1653     "isNestedOnly": true,
1654     "isSystem": true
1655   },
1656   {
1657     "context": "xtuple",
1658     "nameSpace": "XM",
1659     "type": "SalesOrderLineComment",
1660     "table": "comment",
1661     "idSequenceName": "comment_comment_id_seq",
1662     "comment": "Sales Order Line Comment Map",
1663     "privileges": {
1664       "all": {
1665         "create": true,
1666         "read": true,
1667         "update": "EditOthersComments",
1668         "delete": false
1669       },
1670       "personal": {
1671         "update": "EditOwnComments",
1672         "properties": [
1673           "createdBy"
1674         ]
1675       }
1676     },
1677     "properties": [
1678       {
1679         "name": "id",
1680         "attr": {
1681           "type": "Number",
1682           "column": "comment_id",
1683           "isPrimaryKey": true
1684         }
1685       },
1686       {
1687         "name": "uuid",
1688         "attr": {
1689           "type": "String",
1690           "column": "obj_uuid",
1691           "isNaturalKey": true
1692         }
1693       },
1694       {
1695         "name": "sourceType",
1696         "attr": {
1697           "type": "String",
1698           "column": "comment_source",
1699           "value": "SI"
1700         }
1701       },
1702       {
1703         "name": "salesOrderLine",
1704         "attr": {
1705           "type": "Number",
1706           "column": "comment_source_id"
1707         }
1708       },
1709       {
1710         "name": "commentType",
1711         "toOne": {
1712           "type": "CommentType",
1713           "column": "comment_cmnttype_id",
1714           "required": true
1715         }
1716       },
1717       {
1718         "name": "text",
1719         "attr": {
1720           "type": "String",
1721           "column": "comment_text"
1722         }
1723       },
1724       {
1725         "name": "isPublic",
1726         "attr": {
1727           "type": "Boolean",
1728           "column": "comment_public",
1729           "value": true
1730         }
1731       },
1732       {
1733         "name": "created",
1734         "attr": {
1735           "type": "Date",
1736           "column": "comment_date"
1737         }
1738       },
1739       {
1740         "name": "createdBy",
1741         "attr": {
1742           "type": "String",
1743           "column": "comment_user"
1744         }
1745       }
1746     ],
1747     "isNestedOnly": true,
1748     "isSystem": true
1749   },
1750   {
1751     "context": "xtuple",
1752     "nameSpace": "XM",
1753     "type": "SalesOrderListItem",
1754     "table": "xt.coheadinfo",
1755     "isRest": true,
1756     "comment": "Sales Order List Item Map",
1757     "privileges": {
1758       "all": {
1759         "create": false,
1760         "read": "ViewSalesOrders MaintainSalesOrders IssueStockToShipping",
1761         "update": false,
1762         "delete": false
1763       },
1764       "attribute": {
1765         "total": {
1766           "view": "MaintainSalesOrders ViewSalesOrders"
1767         }
1768       }
1769     },
1770     "properties": [
1771       {
1772         "name": "id",
1773         "attr": {
1774           "type": "Number",
1775           "column": "cohead_id",
1776           "isPrimaryKey": true
1777         }
1778       },
1779       {
1780         "name": "number",
1781         "attr": {
1782           "type": "String",
1783           "column": "cohead_number",
1784           "isNaturalKey":true
1785         }
1786       },
1787       {
1788         "name": "uuid",
1789         "attr": {
1790           "type": "String",
1791           "column": "obj_uuid"
1792         }
1793       },
1794       {
1795         "name": "customer",
1796         "toOne": {
1797           "isNested": true,
1798           "type": "CustomerRelation",
1799           "column": "cohead_cust_id"
1800         }
1801       },
1802       {
1803         "name": "customerPurchaseOrderNumber",
1804         "attr": {
1805           "type": "String",
1806           "column": "cohead_custponumber"
1807          }
1808       },
1809       {
1810         "name": "status",
1811         "attr": {
1812           "type": "String",
1813           "column": "cohead_status"
1814          }
1815       },
1816       {
1817         "name": "scheduleDate",
1818         "attr": {
1819           "type": "DueDate",
1820           "column": "schedule_date"
1821         }
1822       },
1823       {
1824         "name": "orderDate",
1825         "attr": {
1826           "type": "Date",
1827           "column": "cohead_orderdate"
1828          }
1829       },
1830       {
1831         "name": "orderNotes",
1832         "attr": {
1833           "type": "String",
1834           "column": "cohead_ordercomments"
1835          }
1836       },
1837       {
1838         "name": "currency",
1839         "toOne": {
1840           "type": "Currency",
1841           "column": "cohead_curr_id"
1842          }
1843       },
1844       {
1845         "name": "total",
1846         "attr": {
1847           "type": "Number",
1848           "column": "total"
1849          }
1850       },
1851       {
1852         "name": "salesRep",
1853         "toOne": {
1854           "type": "SalesRep",
1855           "column": "cohead_salesrep_id",
1856           "isNested": true
1857          }
1858       },
1859       {
1860         "name": "billtoName",
1861         "attr": {
1862           "type": "String",
1863           "column": "cohead_billtoname"
1864         }
1865       },
1866       {
1867         "name": "billtoCity",
1868         "attr": {
1869           "type": "String",
1870           "column": "cohead_billtocity"
1871         }
1872       },
1873       {
1874         "name": "billtoState",
1875         "attr": {
1876           "type": "String",
1877           "column": "cohead_billtostate"
1878         }
1879       },
1880       {
1881         "name": "billtoCountry",
1882         "attr": {
1883           "type": "String",
1884           "column": "cohead_billtocountry"
1885         }
1886       },
1887       {
1888         "name": "shiptoName",
1889         "attr": {
1890           "type": "String",
1891           "column": "cohead_shiptoname"
1892         }
1893       },
1894       {
1895         "name": "shiptoCity",
1896         "attr": {
1897           "type": "String",
1898           "column": "cohead_shiptocity"
1899         }
1900       },
1901       {
1902         "name": "shiptoState",
1903         "attr": {
1904           "type": "String",
1905           "column": "cohead_shiptostate"
1906         }
1907       },
1908       {
1909         "name": "shiptoCountry",
1910         "attr": {
1911           "type": "String",
1912           "column": "cohead_shiptocountry"
1913         }
1914       }
1915     ],
1916     "isSystem": true
1917   },
1918   {
1919     "context": "xtuple",
1920     "nameSpace": "XM",
1921     "type": "SalesOrderRelation",
1922     "table": "xt.coheadinfo",
1923     "isRest": true,
1924     "comment": "Sales Order Relation Map",
1925     "privileges": {
1926       "all": {
1927         "create": "MaintainSalesOrders",
1928         "read": "ViewSalesOrders",
1929         "update": "MaintainSalesOrders",
1930         "delete": "MaintainSalesOrders"
1931       }
1932     },
1933     "properties": [
1934       {
1935         "name": "id",
1936         "attr": {
1937           "type": "Number",
1938           "column": "cohead_id",
1939           "isPrimaryKey": true
1940         }
1941       },
1942       {
1943         "name": "number",
1944         "attr": {
1945           "type": "String",
1946           "column": "cohead_number",
1947           "isNaturalKey":true
1948         }
1949       },
1950       {
1951         "name": "customer",
1952         "attr": {
1953           "type": "String",
1954           "column": "cust_number"
1955         }
1956       },
1957       {
1958         "name": "orderDate",
1959         "attr": {
1960           "type": "Date",
1961           "column": "cohead_orderdate"
1962         }
1963       },
1964       {
1965         "name": "status",
1966         "attr": {
1967           "type": "String",
1968           "column": "cohead_status"
1969         }
1970       },
1971       {
1972         "name": "shipVia",
1973         "attr": {
1974           "type": "String",
1975           "column": "cohead_shipvia"
1976         }
1977       },
1978       {
1979         "name": "total",
1980         "attr": {
1981           "type": "Money",
1982           "column": "total"
1983         }
1984       },
1985       {
1986         "name": "opportunity",
1987         "attr": {
1988           "type": "String",
1989           "column": "ophead_number"
1990         }
1991       }
1992     ],
1993     "isSystem": true
1994   },
1995   {
1996     "context": "xtuple",
1997     "nameSpace": "SYS",
1998     "type": "SalesOrderRelation",
1999     "table": "xt.coheadinfo",
2000     "comment": "Sales Order Relation Map",
2001     "privileges": {
2002       "all": {
2003         "create": "MaintainSalesOrders",
2004         "read": "ViewSalesOrders",
2005         "update": "MaintainSalesOrders",
2006         "delete": "MaintainSalesOrders"
2007       }
2008     },
2009     "properties": [
2010       {
2011         "name": "id",
2012         "attr": {
2013           "type": "Number",
2014           "column": "cohead_id",
2015           "isPrimaryKey": true
2016         }
2017       },
2018       {
2019         "name": "number",
2020         "attr": {
2021           "type": "String",
2022           "column": "cohead_number",
2023           "isNaturalKey":true
2024         }
2025       }
2026     ],
2027     "isSystem": true
2028   },
2029   {
2030     "context": "xtuple",
2031     "nameSpace": "XM",
2032     "type": "SalesOrderUrl",
2033     "table": "xt.doc",
2034     "idSequenceName": "docass_docass_id_seq",
2035     "comment": "Sales Order Url Map",
2036     "privileges": {
2037       "all": {
2038         "create": true,
2039         "read": true,
2040         "update": false,
2041         "delete": true
2042       }
2043     },
2044     "properties": [
2045       {
2046         "name": "id",
2047         "attr": {
2048           "type": "Number",
2049           "column": "id",
2050           "isPrimaryKey": true
2051         }
2052       },
2053       {
2054         "name": "uuid",
2055         "attr": {
2056           "type": "String",
2057           "column": "obj_uuid",
2058           "isNaturalKey": true
2059         }
2060       },
2061       {
2062         "name": "sourceType",
2063         "attr": {
2064           "type": "String",
2065           "column": "source_type",
2066           "value": "S"
2067         }
2068       },
2069       {
2070         "name": "source",
2071         "attr": {
2072           "type": "Number",
2073           "column": "source_id"
2074         }
2075       },
2076       {
2077         "name": "targetType",
2078         "attr": {
2079           "type": "String",
2080           "column": "target_type",
2081           "value": "URL"
2082         }
2083       },
2084       {
2085         "name": "url",
2086         "toOne": {
2087           "isNested": true,
2088           "type": "Url",
2089           "column": "target_id"
2090         }
2091       },
2092       {
2093         "name": "purpose",
2094         "attr": {
2095           "type": "String",
2096           "column": "purpose"
2097         }
2098       }
2099     ],
2100     "isNestedOnly": true,
2101     "isSystem": true
2102   }
2103 ]