shutro-erp 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account_portal/.kosh/bindings.js +1 -1
- package/dist/account_portal/.kosh/schema.d.ts +54 -3
- package/dist/account_portal/module.d.ts +359 -6
- package/dist/accounting/.kosh/bindings.js +1 -1
- package/dist/accounting/.kosh/schema.d.ts +54 -3
- package/dist/accounting/index.js +214 -2
- package/dist/accounting/module.d.ts +217 -5
- package/dist/accounting/module.js +23 -2
- package/dist/calendar/.kosh/bindings.d.ts +22 -0
- package/dist/calendar/.kosh/bindings.js +15 -0
- package/dist/calendar/.kosh/schema.d.ts +795 -0
- package/dist/calendar/demo.d.ts +6 -0
- package/dist/calendar/demo.js +24 -0
- package/dist/calendar/index.d.ts +3 -0
- package/dist/calendar/index.js +291 -0
- package/dist/calendar/module.d.ts +1705 -0
- package/dist/calendar/module.js +180 -0
- package/dist/cli/init.js +48 -0
- package/dist/cli/templates.d.ts +1 -1
- package/dist/cli/templates.js +137 -0
- package/dist/contacts/.kosh/bindings.js +1 -1
- package/dist/contacts/.kosh/schema.d.ts +78 -3
- package/dist/contacts/demo.js +30 -1
- package/dist/contacts/index.d.ts +1 -1
- package/dist/contacts/index.js +155 -9
- package/dist/contacts/module.d.ts +338 -2
- package/dist/contacts/module.js +82 -5
- package/dist/crm/.kosh/bindings.d.ts +22 -0
- package/dist/crm/.kosh/bindings.js +15 -0
- package/dist/crm/.kosh/schema.d.ts +799 -0
- package/dist/crm/demo.d.ts +6 -0
- package/dist/crm/demo.js +45 -0
- package/dist/crm/index.d.ts +3 -0
- package/dist/crm/index.js +361 -0
- package/dist/crm/module.d.ts +1843 -0
- package/dist/crm/module.js +207 -0
- package/dist/event/.kosh/bindings.d.ts +22 -0
- package/dist/event/.kosh/bindings.js +15 -0
- package/dist/event/.kosh/schema.d.ts +843 -0
- package/dist/event/demo.d.ts +6 -0
- package/dist/event/demo.js +65 -0
- package/dist/event/index.d.ts +14 -0
- package/dist/event/index.js +333 -0
- package/dist/event/mails.d.ts +15 -0
- package/dist/event/mails.js +112 -0
- package/dist/event/module.d.ts +2800 -0
- package/dist/event/module.js +323 -0
- package/dist/event/web/CheckInBox.d.ts +9 -0
- package/dist/event/web/CheckInBox.js +87 -0
- package/dist/event/web/index.d.ts +11 -0
- package/dist/event/web/index.js +16 -0
- package/dist/event/web/messages.d.ts +2 -0
- package/dist/event/web/messages.js +23 -0
- package/dist/event_account/.kosh/bindings.d.ts +22 -0
- package/dist/event_account/.kosh/bindings.js +15 -0
- package/dist/event_account/.kosh/schema.d.ts +1639 -0
- package/dist/event_account/index.d.ts +3 -0
- package/dist/event_account/index.js +28 -0
- package/dist/event_account/module.d.ts +6968 -0
- package/dist/event_account/module.js +90 -0
- package/dist/hr/.kosh/bindings.d.ts +22 -0
- package/dist/hr/.kosh/bindings.js +15 -0
- package/dist/hr/.kosh/schema.d.ts +878 -0
- package/dist/hr/demo.d.ts +6 -0
- package/dist/hr/demo.js +60 -0
- package/dist/hr/index.d.ts +3 -0
- package/dist/hr/index.js +483 -0
- package/dist/hr/module.d.ts +2611 -0
- package/dist/hr/module.js +350 -0
- package/dist/l10n_bd/.kosh/bindings.js +1 -1
- package/dist/l10n_bd/.kosh/schema.d.ts +54 -3
- package/dist/l10n_bd/module.d.ts +359 -6
- package/dist/l10n_in/.kosh/bindings.js +1 -1
- package/dist/l10n_in/.kosh/schema.d.ts +54 -3
- package/dist/l10n_in/module.d.ts +380 -7
- package/dist/maintenance/.kosh/bindings.d.ts +22 -0
- package/dist/maintenance/.kosh/bindings.js +15 -0
- package/dist/maintenance/.kosh/schema.d.ts +911 -0
- package/dist/maintenance/demo.d.ts +6 -0
- package/dist/maintenance/demo.js +60 -0
- package/dist/maintenance/index.d.ts +3 -0
- package/dist/maintenance/index.js +422 -0
- package/dist/maintenance/module.d.ts +3545 -0
- package/dist/maintenance/module.js +446 -0
- package/dist/maintenance_stock/.kosh/bindings.d.ts +22 -0
- package/dist/maintenance_stock/.kosh/bindings.js +15 -0
- package/dist/maintenance_stock/.kosh/schema.d.ts +1371 -0
- package/dist/maintenance_stock/index.d.ts +9 -0
- package/dist/maintenance_stock/index.js +52 -0
- package/dist/maintenance_stock/module.d.ts +6953 -0
- package/dist/maintenance_stock/module.js +192 -0
- package/dist/modules-sdk/index.d.ts +1 -1
- package/dist/modules-sdk/manifest.d.ts +70 -0
- package/dist/modules-sdk/manifest.js +35 -1
- package/dist/mrp/.kosh/bindings.d.ts +22 -0
- package/dist/mrp/.kosh/bindings.js +15 -0
- package/dist/mrp/.kosh/schema.d.ts +1378 -0
- package/dist/mrp/demo.d.ts +7 -0
- package/dist/mrp/demo.js +42 -0
- package/dist/mrp/index.d.ts +3 -0
- package/dist/mrp/index.js +392 -0
- package/dist/mrp/module.d.ts +8608 -0
- package/dist/mrp/module.js +695 -0
- package/dist/mrp_account/.kosh/bindings.d.ts +22 -0
- package/dist/mrp_account/.kosh/bindings.js +15 -0
- package/dist/mrp_account/.kosh/schema.d.ts +2106 -0
- package/dist/mrp_account/index.d.ts +3 -0
- package/dist/mrp_account/index.js +22 -0
- package/dist/mrp_account/module.d.ts +20840 -0
- package/dist/mrp_account/module.js +123 -0
- package/dist/payment/.kosh/bindings.js +1 -1
- package/dist/payment/.kosh/schema.d.ts +54 -3
- package/dist/payment/module.d.ts +359 -6
- package/dist/portal/.kosh/bindings.js +1 -1
- package/dist/portal/.kosh/schema.d.ts +78 -3
- package/dist/portal/module.d.ts +166 -2
- package/dist/pos/.kosh/bindings.d.ts +22 -0
- package/dist/pos/.kosh/bindings.js +15 -0
- package/dist/pos/.kosh/schema.d.ts +1690 -0
- package/dist/pos/accounting.d.ts +10 -0
- package/dist/pos/accounting.js +149 -0
- package/dist/pos/demo.d.ts +6 -0
- package/dist/pos/demo.js +90 -0
- package/dist/pos/index.d.ts +9 -0
- package/dist/pos/index.js +349 -0
- package/dist/pos/module.d.ts +9636 -0
- package/dist/pos/module.js +423 -0
- package/dist/pos/routes.d.ts +39 -0
- package/dist/pos/routes.js +368 -0
- package/dist/pos/web/Register.d.ts +9 -0
- package/dist/pos/web/Register.js +252 -0
- package/dist/pos/web/index.d.ts +11 -0
- package/dist/pos/web/index.js +16 -0
- package/dist/pos/web/messages.d.ts +2 -0
- package/dist/pos/web/messages.js +87 -0
- package/dist/pos_stock/.kosh/bindings.d.ts +22 -0
- package/dist/pos_stock/.kosh/bindings.js +15 -0
- package/dist/pos_stock/.kosh/schema.d.ts +2015 -0
- package/dist/pos_stock/index.d.ts +9 -0
- package/dist/pos_stock/index.js +35 -0
- package/dist/pos_stock/module.d.ts +11935 -0
- package/dist/pos_stock/module.js +115 -0
- package/dist/product/.kosh/bindings.js +1 -1
- package/dist/product/.kosh/schema.d.ts +51 -1
- package/dist/product/index.js +81 -4
- package/dist/product/module.d.ts +43 -1
- package/dist/product/module.js +9 -2
- package/dist/project/.kosh/bindings.js +1 -1
- package/dist/project/.kosh/schema.d.ts +54 -3
- package/dist/project/index.js +147 -7
- package/dist/project/module.d.ts +210 -2
- package/dist/project/module.js +52 -5
- package/dist/project_portal/.kosh/bindings.js +1 -1
- package/dist/project_portal/.kosh/schema.d.ts +54 -3
- package/dist/project_portal/module.d.ts +353 -4
- package/dist/purchase/.kosh/bindings.js +1 -1
- package/dist/purchase/.kosh/schema.d.ts +54 -3
- package/dist/purchase/index.js +163 -3
- package/dist/purchase/module.d.ts +215 -3
- package/dist/purchase/module.js +21 -3
- package/dist/purchase_account/.kosh/bindings.js +1 -1
- package/dist/purchase_account/.kosh/schema.d.ts +55 -3
- package/dist/purchase_account/index.js +26 -1
- package/dist/purchase_account/module.d.ts +393 -7
- package/dist/purchase_portal/.kosh/bindings.js +1 -1
- package/dist/purchase_portal/.kosh/schema.d.ts +54 -3
- package/dist/purchase_portal/module.d.ts +366 -5
- package/dist/purchase_stock/.kosh/bindings.d.ts +22 -0
- package/dist/purchase_stock/.kosh/bindings.js +15 -0
- package/dist/purchase_stock/.kosh/schema.d.ts +1310 -0
- package/dist/purchase_stock/index.d.ts +7 -0
- package/dist/purchase_stock/index.js +91 -0
- package/dist/purchase_stock/module.d.ts +6763 -0
- package/dist/purchase_stock/module.js +144 -0
- package/dist/purchase_stock_account/.kosh/bindings.d.ts +22 -0
- package/dist/purchase_stock_account/.kosh/bindings.js +15 -0
- package/dist/purchase_stock_account/.kosh/schema.d.ts +1959 -0
- package/dist/purchase_stock_account/index.d.ts +3 -0
- package/dist/purchase_stock_account/index.js +24 -0
- package/dist/purchase_stock_account/module.d.ts +35366 -0
- package/dist/purchase_stock_account/module.js +162 -0
- package/dist/recruitment/.kosh/bindings.d.ts +22 -0
- package/dist/recruitment/.kosh/bindings.js +15 -0
- package/dist/recruitment/.kosh/schema.d.ts +990 -0
- package/dist/recruitment/demo.d.ts +6 -0
- package/dist/recruitment/demo.js +45 -0
- package/dist/recruitment/index.d.ts +3 -0
- package/dist/recruitment/index.js +385 -0
- package/dist/recruitment/module.d.ts +3247 -0
- package/dist/recruitment/module.js +193 -0
- package/dist/recruitment/web/HireButton.d.ts +9 -0
- package/dist/recruitment/web/HireButton.js +32 -0
- package/dist/recruitment/web/index.d.ts +11 -0
- package/dist/recruitment/web/index.js +16 -0
- package/dist/recruitment/web/messages.d.ts +2 -0
- package/dist/recruitment/web/messages.js +19 -0
- package/dist/reporting/documents.d.ts +5 -0
- package/dist/reporting/documents.js +28 -1
- package/dist/reporting/index.d.ts +1 -1
- package/dist/reporting/index.js +4 -2
- package/dist/reporting/models.js +9 -0
- package/dist/reporting/overviews.d.ts +16 -0
- package/dist/reporting/overviews.js +56 -0
- package/dist/reporting/routes-documents.js +1 -1
- package/dist/reporting/routes.js +138 -80
- package/dist/reporting/web/DashboardView.d.ts +11 -0
- package/dist/reporting/web/DashboardView.js +2 -2
- package/dist/reporting/web/DesignerView.js +5 -0
- package/dist/reporting/web/Overview.d.ts +9 -0
- package/dist/reporting/web/Overview.js +53 -0
- package/dist/reporting/web/index.d.ts +1 -0
- package/dist/reporting/web/index.js +4 -1
- package/dist/reporting/web/messages.js +9 -0
- package/dist/sale_account/.kosh/bindings.js +1 -1
- package/dist/sale_account/.kosh/schema.d.ts +59 -3
- package/dist/sale_account/index.js +22 -1
- package/dist/sale_account/module.d.ts +461 -7
- package/dist/sale_portal/.kosh/bindings.js +1 -1
- package/dist/sale_portal/.kosh/schema.d.ts +58 -3
- package/dist/sale_portal/module.d.ts +434 -5
- package/dist/sale_project/.kosh/bindings.js +1 -1
- package/dist/sale_project/.kosh/schema.d.ts +60 -3
- package/dist/sale_project/module.d.ts +476 -6
- package/dist/sale_stock/.kosh/bindings.d.ts +22 -0
- package/dist/sale_stock/.kosh/bindings.js +15 -0
- package/dist/sale_stock/.kosh/schema.d.ts +1228 -0
- package/dist/sale_stock/index.d.ts +7 -0
- package/dist/sale_stock/index.js +84 -0
- package/dist/sale_stock/module.d.ts +6791 -0
- package/dist/sale_stock/module.js +146 -0
- package/dist/sales/.kosh/bindings.js +1 -1
- package/dist/sales/.kosh/schema.d.ts +58 -3
- package/dist/sales/index.js +191 -4
- package/dist/sales/module.d.ts +355 -3
- package/dist/sales/module.js +78 -3
- package/dist/server/api/metadata.d.ts +5 -0
- package/dist/server/api/metadata.js +5 -0
- package/dist/server/api/rest.js +64 -1
- package/dist/server/api/views.js +1 -0
- package/dist/server/app-settings.d.ts +7 -0
- package/dist/server/app-settings.js +10 -0
- package/dist/server/auth/base.js +9 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/settings/app-settings.d.ts +2 -0
- package/dist/settings/app-settings.js +518 -0
- package/dist/settings/index.d.ts +1 -0
- package/dist/settings/index.js +15 -0
- package/dist/settings/people.js +29 -5
- package/dist/settings/web/AppSettingsPage.d.ts +11 -0
- package/dist/settings/web/AppSettingsPage.js +210 -0
- package/dist/settings/web/OverviewPage.js +16 -3
- package/dist/settings/web/PeoplePage.js +20 -6
- package/dist/settings/web/index.d.ts +1 -0
- package/dist/settings/web/index.js +3 -0
- package/dist/settings/web/messages.js +118 -2
- package/dist/stock/.kosh/bindings.d.ts +22 -0
- package/dist/stock/.kosh/bindings.js +15 -0
- package/dist/stock/.kosh/schema.d.ts +1147 -0
- package/dist/stock/demo.d.ts +7 -0
- package/dist/stock/demo.js +55 -0
- package/dist/stock/index.d.ts +3 -0
- package/dist/stock/index.js +674 -0
- package/dist/stock/module.d.ts +6330 -0
- package/dist/stock/module.js +1325 -0
- package/dist/stock/web/ScanBox.d.ts +8 -0
- package/dist/stock/web/ScanBox.js +90 -0
- package/dist/stock/web/index.d.ts +11 -0
- package/dist/stock/web/index.js +16 -0
- package/dist/stock/web/messages.d.ts +2 -0
- package/dist/stock/web/messages.js +25 -0
- package/dist/stock_account/.kosh/bindings.d.ts +22 -0
- package/dist/stock_account/.kosh/bindings.js +15 -0
- package/dist/stock_account/.kosh/schema.d.ts +1875 -0
- package/dist/stock_account/index.d.ts +3 -0
- package/dist/stock_account/index.js +130 -0
- package/dist/stock_account/module.d.ts +10655 -0
- package/dist/stock_account/module.js +339 -0
- package/dist/storage/attachments.d.ts +5 -0
- package/dist/storage/attachments.js +12 -1
- package/dist/storage/models.js +3 -0
- package/dist/storage/routes.js +13 -2
- package/dist/todo/.kosh/bindings.d.ts +22 -0
- package/dist/todo/.kosh/bindings.js +15 -0
- package/dist/todo/.kosh/schema.d.ts +732 -0
- package/dist/todo/demo.d.ts +6 -0
- package/dist/todo/demo.js +35 -0
- package/dist/todo/index.d.ts +3 -0
- package/dist/todo/index.js +187 -0
- package/dist/todo/module.d.ts +1180 -0
- package/dist/todo/module.js +130 -0
- package/dist/trade_finance/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance/.kosh/bindings.js +15 -0
- package/dist/trade_finance/.kosh/schema.d.ts +884 -0
- package/dist/trade_finance/demo.d.ts +6 -0
- package/dist/trade_finance/demo.js +63 -0
- package/dist/trade_finance/index.d.ts +3 -0
- package/dist/trade_finance/index.js +413 -0
- package/dist/trade_finance/module.d.ts +3779 -0
- package/dist/trade_finance/module.js +505 -0
- package/dist/trade_finance_account/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance_account/.kosh/bindings.js +15 -0
- package/dist/trade_finance_account/.kosh/schema.d.ts +1711 -0
- package/dist/trade_finance_account/index.d.ts +3 -0
- package/dist/trade_finance_account/index.js +92 -0
- package/dist/trade_finance_account/module.d.ts +7928 -0
- package/dist/trade_finance_account/module.js +244 -0
- package/dist/trade_finance_purchase/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance_purchase/.kosh/bindings.js +15 -0
- package/dist/trade_finance_purchase/.kosh/schema.d.ts +1153 -0
- package/dist/trade_finance_purchase/index.d.ts +8 -0
- package/dist/trade_finance_purchase/index.js +50 -0
- package/dist/trade_finance_purchase/module.d.ts +4252 -0
- package/dist/trade_finance_purchase/module.js +44 -0
- package/dist/trade_finance_sale/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance_sale/.kosh/bindings.js +15 -0
- package/dist/trade_finance_sale/.kosh/schema.d.ts +1071 -0
- package/dist/trade_finance_sale/index.d.ts +8 -0
- package/dist/trade_finance_sale/index.js +50 -0
- package/dist/trade_finance_sale/module.d.ts +4280 -0
- package/dist/trade_finance_sale/module.js +44 -0
- package/dist/ui/api.d.ts +2 -1
- package/dist/ui/api.js +2 -1
- package/dist/ui/app.js +2 -1
- package/dist/ui/components/AppIcon.js +23 -1
- package/dist/ui/components/primitives.d.ts +2 -0
- package/dist/ui/components/primitives.js +7 -1
- package/dist/ui/i18n/messages.d.ts +23 -0
- package/dist/ui/i18n/messages.js +38 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/offline/queue.d.ts +5 -1
- package/dist/ui/offline/queue.js +2 -0
- package/dist/ui/registry.d.ts +5 -0
- package/dist/ui/shell/Home.js +55 -4
- package/dist/ui/views/FormView.js +98 -17
- package/dist/ui/views/KanbanView.d.ts +2 -0
- package/dist/ui/views/KanbanView.js +32 -3
- package/dist/ui/views/ListView.js +108 -11
- package/dist/ui/views/StatsRow.d.ts +14 -0
- package/dist/ui/views/StatsRow.js +88 -0
- package/dist/ui/views/widgets.d.ts +2 -1
- package/dist/ui/views/widgets.js +194 -1
- package/dist/views/builders.d.ts +19 -2
- package/dist/views/builders.js +21 -1
- package/dist/views/condition.d.ts +6 -0
- package/dist/views/condition.js +20 -0
- package/dist/views/documents.d.ts +8 -0
- package/dist/views/extend.d.ts +2 -2
- package/dist/views/extend.js +11 -1
- package/dist/views/index.d.ts +2 -2
- package/dist/views/index.js +2 -2
- package/dist/views/types.d.ts +52 -5
- package/dist/views/validate.js +39 -1
- package/dist/website/.kosh/bindings.d.ts +22 -0
- package/dist/website/.kosh/bindings.js +15 -0
- package/dist/website/.kosh/schema.d.ts +881 -0
- package/dist/website/demo.d.ts +6 -0
- package/dist/website/demo.js +115 -0
- package/dist/website/index.d.ts +9 -0
- package/dist/website/index.js +250 -0
- package/dist/website/module.d.ts +2987 -0
- package/dist/website/module.js +281 -0
- package/dist/website/render.d.ts +45 -0
- package/dist/website/render.js +102 -0
- package/dist/website/routes.d.ts +12 -0
- package/dist/website/routes.js +246 -0
- package/dist/website/web/PagePreview.d.ts +7 -0
- package/dist/website/web/PagePreview.js +33 -0
- package/dist/website/web/index.d.ts +11 -0
- package/dist/website/web/index.js +16 -0
- package/dist/website/web/messages.d.ts +2 -0
- package/dist/website/web/messages.js +15 -0
- package/dist/website_crm/.kosh/bindings.d.ts +22 -0
- package/dist/website_crm/.kosh/bindings.js +15 -0
- package/dist/website_crm/.kosh/schema.d.ts +966 -0
- package/dist/website_crm/index.d.ts +3 -0
- package/dist/website_crm/index.js +39 -0
- package/dist/website_crm/module.d.ts +2955 -0
- package/dist/website_crm/module.js +44 -0
- package/package.json +118 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data layer of Agenda (RFC 0021): events with their attendees — people of the company or contacts from outside,
|
|
3
|
+
* each with their answer — rooms that are never double-booked, and privacy: public events are seen by every Agenda
|
|
4
|
+
* user, private ones by their organizer and attendees only. Only the organizer (and Agenda managers) change an event;
|
|
5
|
+
* an attendee changes their own answer.
|
|
6
|
+
*/
|
|
7
|
+
import { contactsShutro } from '../contacts/index.js';
|
|
8
|
+
import { messagingShutro } from '../messaging/index.js';
|
|
9
|
+
import { installationSetting } from '../server/index.js';
|
|
10
|
+
import { orm } from '../server/orm.js';
|
|
11
|
+
import { check, defineModel, defineModule, f, onchange } from './.kosh/bindings.js';
|
|
12
|
+
const ALL = ['read', 'write', 'create', 'unlink'];
|
|
13
|
+
const me = { $env: 'uid' };
|
|
14
|
+
/** A meeting room (or any bookable place): booked with its events, never twice at once. */
|
|
15
|
+
export const CalendarRoom = defineModel('calendar.room', {
|
|
16
|
+
label: 'Room',
|
|
17
|
+
recName: 'name',
|
|
18
|
+
order: ['name asc'],
|
|
19
|
+
archivable: true,
|
|
20
|
+
access: { 'calendar.user': ['read'], 'calendar.manager': ALL },
|
|
21
|
+
fields: {
|
|
22
|
+
name: f.char({ required: true }),
|
|
23
|
+
capacity: f.integer({ label: 'Seats' }),
|
|
24
|
+
location: f.char(),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export const CalendarEvent = defineModel('calendar.event', {
|
|
28
|
+
label: 'Event',
|
|
29
|
+
recName: 'name',
|
|
30
|
+
order: ['start desc', 'id desc'],
|
|
31
|
+
tracking: ['start', 'stop', 'room', 'state'],
|
|
32
|
+
access: { 'calendar.user': ALL, 'calendar.manager': ALL },
|
|
33
|
+
rules: {
|
|
34
|
+
// Public events for everyone; private ones for their organizer and attendees.
|
|
35
|
+
see: {
|
|
36
|
+
groups: ['calendar.user'],
|
|
37
|
+
perms: ['read'],
|
|
38
|
+
domain: {
|
|
39
|
+
or: [{ privacy: 'public' }, { organizer: me }, { attendees: { any: { user: me } } }],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
organize: {
|
|
43
|
+
groups: ['calendar.user'],
|
|
44
|
+
perms: ['write', 'create', 'unlink'],
|
|
45
|
+
domain: { organizer: me },
|
|
46
|
+
},
|
|
47
|
+
all: { groups: ['calendar.manager'], perms: [...ALL], domain: {} },
|
|
48
|
+
},
|
|
49
|
+
fields: {
|
|
50
|
+
name: f.char({ required: true, label: 'Title' }),
|
|
51
|
+
start: f.datetime({ required: true }),
|
|
52
|
+
stop: f.datetime({ required: true, label: 'End' }),
|
|
53
|
+
allDay: f.boolean({ default: false, label: 'All day' }),
|
|
54
|
+
organizer: f.many2one('res.users', { required: true, default: (env) => env.userId }),
|
|
55
|
+
attendees: f.one2many('calendar.attendee', 'event'),
|
|
56
|
+
room: f.many2one('calendar.room', { ondelete: 'restrict' }),
|
|
57
|
+
location: f.char(),
|
|
58
|
+
videoUrl: f.char({ label: 'Video call link' }),
|
|
59
|
+
privacy: f.selection({ public: 'Public', private: 'Private (busy for others)' }, { required: true, default: 'public' }),
|
|
60
|
+
state: f.state({
|
|
61
|
+
states: { confirmed: 'Confirmed', cancelled: 'Cancelled' },
|
|
62
|
+
initial: 'confirmed',
|
|
63
|
+
transitions: {
|
|
64
|
+
cancel: { from: ['confirmed'], to: 'cancelled' },
|
|
65
|
+
restore: { from: ['cancelled'], to: 'confirmed' },
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
description: f.text(),
|
|
69
|
+
/** The record of another app it is about (`sale.order`, 42), if any. */
|
|
70
|
+
resModel: f.char({ label: 'About (model)' }),
|
|
71
|
+
resId: f.integer({ label: 'About (id)' }),
|
|
72
|
+
},
|
|
73
|
+
sqlConstraints: {
|
|
74
|
+
endsAfterStart: { check: orm.sql `stop > start`, message: 'An event ends after it starts.' },
|
|
75
|
+
},
|
|
76
|
+
constraints: {
|
|
77
|
+
// Across everyone's events, private ones too: the check reads as the system, not as the user.
|
|
78
|
+
roomFree: {
|
|
79
|
+
...check('calendar.event', ['room', 'start', 'stop', 'state'], async (events) => events.env.asSuperuser({ reason: 'room bookings' }, async (su) => {
|
|
80
|
+
const failing = [];
|
|
81
|
+
for (const e of events) {
|
|
82
|
+
if (e.room === null || e.state === 'cancelled')
|
|
83
|
+
continue;
|
|
84
|
+
const clash = await su.model('calendar.event').search({
|
|
85
|
+
where: {
|
|
86
|
+
room: e.room.id,
|
|
87
|
+
state: 'confirmed',
|
|
88
|
+
id: { ne: e.id },
|
|
89
|
+
start: { lt: e.stop },
|
|
90
|
+
stop: { gt: e.start },
|
|
91
|
+
},
|
|
92
|
+
limit: 1,
|
|
93
|
+
});
|
|
94
|
+
if (clash.length > 0)
|
|
95
|
+
failing.push(e.id);
|
|
96
|
+
}
|
|
97
|
+
return failing;
|
|
98
|
+
})),
|
|
99
|
+
message: 'The room is already booked at that time.',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
onchange: {
|
|
103
|
+
// The end follows the start by the default length (Settings › App settings › Agenda).
|
|
104
|
+
start: onchange('calendar.event', async (d, env) => {
|
|
105
|
+
const start = d.get('start');
|
|
106
|
+
const at = start instanceof Date ? start.getTime() : Date.parse(String(start ?? ''));
|
|
107
|
+
if (Number.isNaN(at))
|
|
108
|
+
return;
|
|
109
|
+
const minutes = await installationSetting(env, 'calendar.defaultMinutes', 60);
|
|
110
|
+
d.set('stop', new Date(at + Number(minutes) * 60_000));
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
/** An attendee: a person of the company (`user`) or a contact from outside (`partner`), with their answer. */
|
|
115
|
+
export const CalendarAttendee = defineModel('calendar.attendee', {
|
|
116
|
+
label: 'Attendee',
|
|
117
|
+
order: ['id asc'],
|
|
118
|
+
access: { 'calendar.user': ALL, 'calendar.manager': ALL },
|
|
119
|
+
rules: {
|
|
120
|
+
see: {
|
|
121
|
+
groups: ['calendar.user'],
|
|
122
|
+
perms: ['read'],
|
|
123
|
+
domain: {
|
|
124
|
+
or: [
|
|
125
|
+
{ 'event.privacy': 'public' },
|
|
126
|
+
{ 'event.organizer': me },
|
|
127
|
+
{ user: me },
|
|
128
|
+
{ 'event.attendees': { any: { user: me } } },
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
// The organizer manages the list; each attendee answers for themself.
|
|
133
|
+
answer: {
|
|
134
|
+
groups: ['calendar.user'],
|
|
135
|
+
perms: ['write'],
|
|
136
|
+
domain: { or: [{ 'event.organizer': me }, { user: me }] },
|
|
137
|
+
},
|
|
138
|
+
organize: {
|
|
139
|
+
groups: ['calendar.user'],
|
|
140
|
+
perms: ['create', 'unlink'],
|
|
141
|
+
domain: { 'event.organizer': me },
|
|
142
|
+
},
|
|
143
|
+
all: { groups: ['calendar.manager'], perms: [...ALL], domain: {} },
|
|
144
|
+
},
|
|
145
|
+
fields: {
|
|
146
|
+
event: f.many2one('calendar.event', { required: true, ondelete: 'cascade' }),
|
|
147
|
+
user: f.many2one('res.users', { label: 'Person' }),
|
|
148
|
+
partner: f.many2one('res.partner', { label: 'Contact' }),
|
|
149
|
+
response: f.selection({
|
|
150
|
+
needs_action: 'Not answered',
|
|
151
|
+
accepted: 'Accepted',
|
|
152
|
+
tentative: 'Maybe',
|
|
153
|
+
declined: 'Declined',
|
|
154
|
+
}, { required: true, default: 'needs_action', label: 'Answer' }),
|
|
155
|
+
},
|
|
156
|
+
sqlConstraints: {
|
|
157
|
+
someone: {
|
|
158
|
+
check: orm.sql `user_id IS NOT NULL OR partner_id IS NOT NULL`,
|
|
159
|
+
message: 'An attendee is a person or a contact.',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
export const calendarShutro = defineModule({
|
|
164
|
+
name: 'calendar',
|
|
165
|
+
version: '0.1.0',
|
|
166
|
+
depends: [contactsShutro, messagingShutro],
|
|
167
|
+
groups: [
|
|
168
|
+
orm.defineGroup({
|
|
169
|
+
code: 'calendar.user',
|
|
170
|
+
label: 'Agenda user',
|
|
171
|
+
implies: ['contacts.user', 'messaging.user'],
|
|
172
|
+
}),
|
|
173
|
+
orm.defineGroup({
|
|
174
|
+
code: 'calendar.manager',
|
|
175
|
+
label: 'Agenda manager',
|
|
176
|
+
implies: ['calendar.user'],
|
|
177
|
+
}),
|
|
178
|
+
],
|
|
179
|
+
models: [CalendarRoom, CalendarEvent, CalendarAttendee],
|
|
180
|
+
});
|
package/dist/cli/init.js
CHANGED
|
@@ -531,8 +531,56 @@ async function modulesFor(apps) {
|
|
|
531
531
|
modules.push((await import('../purchase_account/index.js')).purchaseAccount);
|
|
532
532
|
if (app === 'project')
|
|
533
533
|
modules.push((await import('../project/index.js')).project);
|
|
534
|
+
if (app === 'todo')
|
|
535
|
+
modules.push((await import('../todo/index.js')).todo);
|
|
536
|
+
if (app === 'calendar')
|
|
537
|
+
modules.push((await import('../calendar/index.js')).calendarApp);
|
|
538
|
+
if (app === 'crm')
|
|
539
|
+
modules.push((await import('../crm/index.js')).crm);
|
|
540
|
+
if (app === 'hr')
|
|
541
|
+
modules.push((await import('../hr/index.js')).hr);
|
|
542
|
+
if (app === 'stock')
|
|
543
|
+
modules.push((await import('../stock/index.js')).stock);
|
|
544
|
+
if (app === 'mrp')
|
|
545
|
+
modules.push((await import('../mrp/index.js')).mrp);
|
|
546
|
+
if (app === 'maintenance')
|
|
547
|
+
modules.push((await import('../maintenance/index.js')).maintenance);
|
|
548
|
+
if (app === 'event')
|
|
549
|
+
modules.push((await import('../event/index.js')).event);
|
|
550
|
+
if (app === 'website')
|
|
551
|
+
modules.push((await import('../website/index.js')).website);
|
|
552
|
+
if (app === 'pos')
|
|
553
|
+
modules.push((await import('../pos/index.js')).pos);
|
|
554
|
+
if (app === 'trade_finance')
|
|
555
|
+
modules.push((await import('../trade_finance/index.js')).tradeFinance);
|
|
556
|
+
if (app === 'recruitment')
|
|
557
|
+
modules.push((await import('../recruitment/index.js')).recruitment);
|
|
534
558
|
if (app === 'sale_project')
|
|
535
559
|
modules.push((await import('../sale_project/index.js')).saleProject);
|
|
560
|
+
if (app === 'sale_stock')
|
|
561
|
+
modules.push((await import('../sale_stock/index.js')).saleStock);
|
|
562
|
+
if (app === 'purchase_stock')
|
|
563
|
+
modules.push((await import('../purchase_stock/index.js')).purchaseStock);
|
|
564
|
+
if (app === 'stock_account')
|
|
565
|
+
modules.push((await import('../stock_account/index.js')).stockAccount);
|
|
566
|
+
if (app === 'purchase_stock_account')
|
|
567
|
+
modules.push((await import('../purchase_stock_account/index.js')).purchaseStockAccount);
|
|
568
|
+
if (app === 'mrp_account')
|
|
569
|
+
modules.push((await import('../mrp_account/index.js')).mrpAccount);
|
|
570
|
+
if (app === 'maintenance_stock')
|
|
571
|
+
modules.push((await import('../maintenance_stock/index.js')).maintenanceStock);
|
|
572
|
+
if (app === 'trade_finance_account')
|
|
573
|
+
modules.push((await import('../trade_finance_account/index.js')).tradeFinanceAccount);
|
|
574
|
+
if (app === 'trade_finance_purchase')
|
|
575
|
+
modules.push((await import('../trade_finance_purchase/index.js')).tradeFinancePurchase);
|
|
576
|
+
if (app === 'trade_finance_sale')
|
|
577
|
+
modules.push((await import('../trade_finance_sale/index.js')).tradeFinanceSale);
|
|
578
|
+
if (app === 'event_account')
|
|
579
|
+
modules.push((await import('../event_account/index.js')).eventAccount);
|
|
580
|
+
if (app === 'website_crm')
|
|
581
|
+
modules.push((await import('../website_crm/index.js')).websiteCrm);
|
|
582
|
+
if (app === 'pos_stock')
|
|
583
|
+
modules.push((await import('../pos_stock/index.js')).posStock);
|
|
536
584
|
if (app === 'l10n_bd')
|
|
537
585
|
modules.push((await import('../l10n_bd/index.js')).l10nBd);
|
|
538
586
|
if (app === 'l10n_in')
|
package/dist/cli/templates.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The starter project `shutro-erp init` writes: an API server and the back-office app, both importing `shutro-erp`.
|
|
3
3
|
* Server files run on Node.js directly (type stripping); the back-office is a Vite app proxying `/api` to the server.
|
|
4
4
|
*/
|
|
5
|
-
export type AppName = 'permissions' | 'reporting' | 'messaging' | 'contacts' | 'product' | 'sales' | 'purchase' | 'accounting' | 'sale_account' | 'purchase_account' | 'project' | 'sale_project' | 'l10n_bd' | 'l10n_in';
|
|
5
|
+
export type AppName = 'permissions' | 'reporting' | 'messaging' | 'contacts' | 'product' | 'sales' | 'purchase' | 'accounting' | 'sale_account' | 'purchase_account' | 'project' | 'todo' | 'calendar' | 'crm' | 'hr' | 'recruitment' | 'stock' | 'mrp' | 'maintenance' | 'trade_finance' | 'event' | 'website' | 'pos' | 'sale_project' | 'sale_stock' | 'purchase_stock' | 'stock_account' | 'purchase_stock_account' | 'mrp_account' | 'maintenance_stock' | 'trade_finance_account' | 'trade_finance_purchase' | 'trade_finance_sale' | 'event_account' | 'website_crm' | 'pos_stock' | 'l10n_bd' | 'l10n_in';
|
|
6
6
|
export interface AppSpec {
|
|
7
7
|
readonly label: string;
|
|
8
8
|
/** Shown next to the app in the installer (where the terminal shows pictographs). */
|
package/dist/cli/templates.js
CHANGED
|
@@ -61,12 +61,149 @@ export const APPS = {
|
|
|
61
61
|
server: 'purchaseAccount',
|
|
62
62
|
bridge: ['purchase', 'accounting'],
|
|
63
63
|
},
|
|
64
|
+
todo: {
|
|
65
|
+
label: 'Focus: your to-dos and shared lists, with checklists and due dates',
|
|
66
|
+
icon: '✅',
|
|
67
|
+
server: 'todo',
|
|
68
|
+
},
|
|
69
|
+
calendar: {
|
|
70
|
+
label: 'Agenda: meetings, rooms that are never double-booked, who is free when',
|
|
71
|
+
icon: '📅',
|
|
72
|
+
server: 'calendarApp',
|
|
73
|
+
},
|
|
74
|
+
crm: {
|
|
75
|
+
label: 'Pipeline: deals on a board, stage rules, the weighted forecast',
|
|
76
|
+
icon: '📈',
|
|
77
|
+
server: 'crm',
|
|
78
|
+
},
|
|
79
|
+
hr: {
|
|
80
|
+
label: 'Workforce: employees, the org chart, contracts and leave',
|
|
81
|
+
icon: '🧑💼',
|
|
82
|
+
server: 'hr',
|
|
83
|
+
},
|
|
84
|
+
recruitment: {
|
|
85
|
+
label: 'Hiring: openings, applicants on a board, independent scorecards, hire in one step',
|
|
86
|
+
icon: '🤝',
|
|
87
|
+
server: 'recruitment',
|
|
88
|
+
web: 'registerRecruitmentWeb',
|
|
89
|
+
},
|
|
90
|
+
stock: {
|
|
91
|
+
label: 'Stockroom: warehouses, transfers with one clear status, reservations that say what they are for',
|
|
92
|
+
icon: '🏬',
|
|
93
|
+
server: 'stock',
|
|
94
|
+
web: 'registerStockWeb',
|
|
95
|
+
},
|
|
96
|
+
mrp: {
|
|
97
|
+
label: 'Production: bills of materials with versions, orders that show what is short and what they cost',
|
|
98
|
+
icon: '🏭',
|
|
99
|
+
server: 'mrp',
|
|
100
|
+
},
|
|
101
|
+
maintenance: {
|
|
102
|
+
label: 'Asset Care: equipment, preventive plans by time or meter, maintenance orders, reliability',
|
|
103
|
+
icon: '🛠️',
|
|
104
|
+
server: 'maintenance',
|
|
105
|
+
},
|
|
106
|
+
trade_finance: {
|
|
107
|
+
label: 'Trade Finance: letters of credit, amendments, presentations and discrepancies, bank limits',
|
|
108
|
+
icon: '🏦',
|
|
109
|
+
server: 'tradeFinance',
|
|
110
|
+
},
|
|
111
|
+
event: {
|
|
112
|
+
label: 'Event Hub: events, tickets and seats, waiting lists, check-in by QR',
|
|
113
|
+
icon: '🎟️',
|
|
114
|
+
server: 'event',
|
|
115
|
+
web: 'registerEventWeb',
|
|
116
|
+
},
|
|
117
|
+
website: {
|
|
118
|
+
label: 'Sites: website pages from blocks, forms that create records, a public API',
|
|
119
|
+
icon: '🌐',
|
|
120
|
+
server: 'website',
|
|
121
|
+
web: 'registerWebsiteWeb',
|
|
122
|
+
},
|
|
123
|
+
pos: {
|
|
124
|
+
label: 'Counter: point of sale with sessions, split payments, receipts and the register',
|
|
125
|
+
icon: '🧾',
|
|
126
|
+
server: 'pos',
|
|
127
|
+
web: 'registerPosWeb',
|
|
128
|
+
},
|
|
64
129
|
sale_project: {
|
|
65
130
|
label: 'Bridge: tasks and projects from sales orders (Sales ↔ Projects)',
|
|
66
131
|
icon: '🔗',
|
|
67
132
|
server: 'saleProject',
|
|
68
133
|
bridge: ['sales', 'project'],
|
|
69
134
|
},
|
|
135
|
+
sale_stock: {
|
|
136
|
+
label: 'Bridge: deliveries from sales orders (Sales ↔ Stockroom)',
|
|
137
|
+
icon: '🔗',
|
|
138
|
+
server: 'saleStock',
|
|
139
|
+
bridge: ['sales', 'stock'],
|
|
140
|
+
},
|
|
141
|
+
purchase_stock: {
|
|
142
|
+
label: 'Bridge: receipts from purchase orders (Purchase ↔ Stockroom)',
|
|
143
|
+
icon: '🔗',
|
|
144
|
+
server: 'purchaseStock',
|
|
145
|
+
bridge: ['purchase', 'stock'],
|
|
146
|
+
},
|
|
147
|
+
stock_account: {
|
|
148
|
+
label: 'Bridge: the stock valued and posted as it moves (Stockroom ↔ Accounting)',
|
|
149
|
+
icon: '🔗',
|
|
150
|
+
server: 'stockAccount',
|
|
151
|
+
bridge: ['stock', 'accounting'],
|
|
152
|
+
},
|
|
153
|
+
purchase_stock_account: {
|
|
154
|
+
label: 'Bridge: receipts at the order price, bills clearing goods received (Purchase ↔ Stockroom ↔ Accounting)',
|
|
155
|
+
icon: '🔗',
|
|
156
|
+
server: 'purchaseStockAccount',
|
|
157
|
+
bridge: ['purchase', 'stock', 'accounting'],
|
|
158
|
+
},
|
|
159
|
+
mrp_account: {
|
|
160
|
+
label: 'Bridge: products made valued at what they consumed plus their operations (Production ↔ Accounting)',
|
|
161
|
+
icon: '🔗',
|
|
162
|
+
server: 'mrpAccount',
|
|
163
|
+
bridge: ['mrp', 'accounting'],
|
|
164
|
+
},
|
|
165
|
+
maintenance_stock: {
|
|
166
|
+
label: 'Bridge: spare parts on maintenance orders (Asset Care ↔ Stockroom)',
|
|
167
|
+
icon: '🔗',
|
|
168
|
+
server: 'maintenanceStock',
|
|
169
|
+
bridge: ['maintenance', 'stock'],
|
|
170
|
+
},
|
|
171
|
+
trade_finance_account: {
|
|
172
|
+
label: 'Bridge: LC margins, payments and bank charges in the books (Trade Finance ↔ Accounting)',
|
|
173
|
+
icon: '🔗',
|
|
174
|
+
server: 'tradeFinanceAccount',
|
|
175
|
+
bridge: ['trade_finance', 'accounting'],
|
|
176
|
+
},
|
|
177
|
+
trade_finance_purchase: {
|
|
178
|
+
label: 'Bridge: import LCs from purchase orders (Trade Finance ↔ Purchase)',
|
|
179
|
+
icon: '🔗',
|
|
180
|
+
server: 'tradeFinancePurchase',
|
|
181
|
+
bridge: ['trade_finance', 'purchase'],
|
|
182
|
+
},
|
|
183
|
+
trade_finance_sale: {
|
|
184
|
+
label: 'Bridge: export LCs for sales orders (Trade Finance ↔ Sales)',
|
|
185
|
+
icon: '🔗',
|
|
186
|
+
server: 'tradeFinanceSale',
|
|
187
|
+
bridge: ['trade_finance', 'sales'],
|
|
188
|
+
},
|
|
189
|
+
event_account: {
|
|
190
|
+
label: 'Bridge: paid event places invoiced (Event Hub ↔ Accounting)',
|
|
191
|
+
icon: '🔗',
|
|
192
|
+
server: 'eventAccount',
|
|
193
|
+
bridge: ['event', 'accounting'],
|
|
194
|
+
},
|
|
195
|
+
website_crm: {
|
|
196
|
+
label: 'Bridge: website forms that create deals (Sites ↔ Pipeline)',
|
|
197
|
+
icon: '🔗',
|
|
198
|
+
server: 'websiteCrm',
|
|
199
|
+
bridge: ['website', 'crm'],
|
|
200
|
+
},
|
|
201
|
+
pos_stock: {
|
|
202
|
+
label: 'Bridge: a closed Counter session leaves stock as one delivery (Counter ↔ Stockroom)',
|
|
203
|
+
icon: '🔗',
|
|
204
|
+
server: 'posStock',
|
|
205
|
+
bridge: ['pos', 'stock'],
|
|
206
|
+
},
|
|
70
207
|
l10n_bd: {
|
|
71
208
|
label: 'Bangladesh: chart of accounts, VAT and SD, VDS and TDS, BIN and TIN, July–June year',
|
|
72
209
|
icon: '🇧🇩',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash:
|
|
1
|
+
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: f17b2929d6c50f64
|
|
2
2
|
// Bindings of module `contacts`: import the definition API from here to get types scoped to what it can see.
|
|
3
3
|
export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
|
|
4
4
|
import { definitions } from '../../server/orm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash:
|
|
1
|
+
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: f17b2929d6c50f64
|
|
2
2
|
// Schema view of module `contacts` (RFC 0002 §7.7): the models it owns or depends on, with the extensions it can see.
|
|
3
3
|
import type { F } from '../../server/orm.js';
|
|
4
4
|
|
|
@@ -13,6 +13,7 @@ export interface SchemaView {
|
|
|
13
13
|
readonly 'auth.user_group': AuthUserGroup;
|
|
14
14
|
readonly 'kosh.image': KoshImage;
|
|
15
15
|
readonly 'kosh.saved_view': KoshSavedView;
|
|
16
|
+
readonly 'kosh.setting': KoshSetting;
|
|
16
17
|
readonly 'oauth.app': OauthApp;
|
|
17
18
|
readonly 'oauth.code': OauthCode;
|
|
18
19
|
readonly 'oauth.grant': OauthGrant;
|
|
@@ -20,7 +21,9 @@ export interface SchemaView {
|
|
|
20
21
|
readonly 'res.company': ResCompany;
|
|
21
22
|
readonly 'res.currency': ResCurrency;
|
|
22
23
|
readonly 'res.partner': ResPartner;
|
|
24
|
+
readonly 'res.partner.tag': ResPartnerTag;
|
|
23
25
|
readonly 'res.users': ResUsers;
|
|
26
|
+
readonly 'storage.attachment': StorageAttachment;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
/** `audit.event` (owner: base). */
|
|
@@ -239,6 +242,26 @@ export interface KoshSavedView {
|
|
|
239
242
|
export interface KoshSavedViewMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.saved_view'> {
|
|
240
243
|
}
|
|
241
244
|
|
|
245
|
+
/** `kosh.setting` (owner: base). */
|
|
246
|
+
export interface KoshSetting {
|
|
247
|
+
readonly name: 'kosh.setting';
|
|
248
|
+
readonly fields: {
|
|
249
|
+
readonly id: F.Id<'kosh.setting'>;
|
|
250
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
251
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
252
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
253
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
254
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
255
|
+
readonly key: F.Char<{ readonly required: true }>;
|
|
256
|
+
readonly value: F.Json;
|
|
257
|
+
};
|
|
258
|
+
readonly methods: KoshSettingMethods;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Methods of `kosh.setting`: declared ones and transitions. */
|
|
262
|
+
export interface KoshSettingMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.setting'> {
|
|
263
|
+
}
|
|
264
|
+
|
|
242
265
|
/** `oauth.app` (owner: base). */
|
|
243
266
|
export interface OauthApp {
|
|
244
267
|
readonly name: 'oauth.app';
|
|
@@ -338,7 +361,7 @@ export interface OauthToken {
|
|
|
338
361
|
export interface OauthTokenMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'oauth.token'> {
|
|
339
362
|
}
|
|
340
363
|
|
|
341
|
-
/** `res.company` (owner: base). */
|
|
364
|
+
/** `res.company` (owner: base; extended by: contacts). */
|
|
342
365
|
export interface ResCompany {
|
|
343
366
|
readonly name: 'res.company';
|
|
344
367
|
readonly fields: {
|
|
@@ -358,12 +381,14 @@ export interface ResCompany {
|
|
|
358
381
|
readonly email: F.Char;
|
|
359
382
|
readonly phone: F.Char;
|
|
360
383
|
readonly website: F.Char;
|
|
384
|
+
readonly contactTaxIdRequired: F.Bool<{ readonly required: true; readonly default: true }>; // contacts
|
|
385
|
+
readonly contactUniqueEmail: F.Bool<{ readonly required: true; readonly default: true }>; // contacts
|
|
361
386
|
};
|
|
362
387
|
readonly methods: ResCompanyMethods;
|
|
363
388
|
}
|
|
364
389
|
|
|
365
390
|
/** Methods of `res.company`: declared ones and transitions. */
|
|
366
|
-
export interface ResCompanyMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'res.company'> {
|
|
391
|
+
export interface ResCompanyMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'res.company'>, F.Methods<typeof import('../module.js').contactsShutro, 'res.company'> {
|
|
367
392
|
}
|
|
368
393
|
|
|
369
394
|
/** `res.currency` (owner: base). */
|
|
@@ -400,6 +425,10 @@ export interface ResPartner {
|
|
|
400
425
|
readonly active: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
401
426
|
readonly company: F.Many2one<'res.company', { readonly default: true }>;
|
|
402
427
|
readonly name: F.Char<{ readonly required: true }>;
|
|
428
|
+
readonly image: F.Many2one<'storage.attachment'>;
|
|
429
|
+
readonly tags: F.Many2many<'res.partner.tag', { readonly required: true }>;
|
|
430
|
+
readonly latitude: F.Decimal;
|
|
431
|
+
readonly longitude: F.Decimal;
|
|
403
432
|
readonly isCompany: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
404
433
|
readonly parent: F.Many2one<'res.partner'>;
|
|
405
434
|
readonly contacts: F.One2many<'res.partner', { readonly required: true }>;
|
|
@@ -425,6 +454,25 @@ export interface ResPartner {
|
|
|
425
454
|
export interface ResPartnerMethods extends F.Methods<typeof import('../module.js').contactsShutro, 'res.partner'> {
|
|
426
455
|
}
|
|
427
456
|
|
|
457
|
+
/** `res.partner.tag` (owner: contacts). */
|
|
458
|
+
export interface ResPartnerTag {
|
|
459
|
+
readonly name: 'res.partner.tag';
|
|
460
|
+
readonly fields: {
|
|
461
|
+
readonly id: F.Id<'res.partner.tag'>;
|
|
462
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
463
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
464
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
465
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
466
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
467
|
+
readonly name: F.Char<{ readonly required: true }>;
|
|
468
|
+
};
|
|
469
|
+
readonly methods: ResPartnerTagMethods;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** Methods of `res.partner.tag`: declared ones and transitions. */
|
|
473
|
+
export interface ResPartnerTagMethods extends F.Methods<typeof import('../module.js').contactsShutro, 'res.partner.tag'> {
|
|
474
|
+
}
|
|
475
|
+
|
|
428
476
|
/** `res.users` (owner: base). */
|
|
429
477
|
export interface ResUsers {
|
|
430
478
|
readonly name: 'res.users';
|
|
@@ -452,3 +500,30 @@ export interface ResUsers {
|
|
|
452
500
|
/** Methods of `res.users`: declared ones and transitions. */
|
|
453
501
|
export interface ResUsersMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'res.users'> {
|
|
454
502
|
}
|
|
503
|
+
|
|
504
|
+
/** `storage.attachment` (owner: storage). */
|
|
505
|
+
export interface StorageAttachment {
|
|
506
|
+
readonly name: 'storage.attachment';
|
|
507
|
+
readonly fields: {
|
|
508
|
+
readonly id: F.Id<'storage.attachment'>;
|
|
509
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
510
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
511
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
512
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
513
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
514
|
+
readonly name: F.Char<{ readonly required: true }>;
|
|
515
|
+
readonly mime: F.Char<{ readonly required: true }>;
|
|
516
|
+
readonly size: F.Integer<{ readonly required: true }>;
|
|
517
|
+
readonly sha256: F.Char<{ readonly required: true }>;
|
|
518
|
+
readonly key: F.Char<{ readonly required: true }>;
|
|
519
|
+
readonly resModel: F.Char<{ readonly required: true }>;
|
|
520
|
+
readonly resId: F.Integer<{ readonly required: true }>;
|
|
521
|
+
readonly variantOf: F.Many2one<'storage.attachment'>;
|
|
522
|
+
readonly width: F.Integer;
|
|
523
|
+
};
|
|
524
|
+
readonly methods: StorageAttachmentMethods;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/** Methods of `storage.attachment`: declared ones and transitions. */
|
|
528
|
+
export interface StorageAttachmentMethods extends F.Methods<typeof import('../../storage/index.js').storageShutro, 'storage.attachment'> {
|
|
529
|
+
}
|
package/dist/contacts/demo.js
CHANGED
|
@@ -9,8 +9,17 @@ const COMPANIES = [
|
|
|
9
9
|
isVendor: true,
|
|
10
10
|
email: 'orders@bengalsteel.example',
|
|
11
11
|
phone: '+880 31 710000',
|
|
12
|
+
latitude: '22.3569',
|
|
13
|
+
longitude: '91.7832',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Acme Trading',
|
|
17
|
+
city: 'Dhaka',
|
|
18
|
+
isCustomer: true,
|
|
19
|
+
email: 'hello@acme.example',
|
|
20
|
+
latitude: '23.8103',
|
|
21
|
+
longitude: '90.4125',
|
|
12
22
|
},
|
|
13
|
-
{ name: 'Acme Trading', city: 'Dhaka', isCustomer: true, email: 'hello@acme.example' },
|
|
14
23
|
{ name: 'Padma Cement', city: 'Narayanganj', isVendor: true, email: 'sales@padmacement.example' },
|
|
15
24
|
{ name: 'Meghna Electronics', city: 'Dhaka', isCustomer: true, isVendor: true },
|
|
16
25
|
{ name: 'Sylhet Tea Estates', city: 'Sylhet', isCustomer: true },
|
|
@@ -29,6 +38,26 @@ export async function contactsDemo(context) {
|
|
|
29
38
|
const partners = env.model('res.partner');
|
|
30
39
|
const companies = await partners.create(COMPANIES.map((c) => ({ ...c, isCompany: true, country: 'BD' })));
|
|
31
40
|
const byName = new Map(COMPANIES.map((c, i) => [c.name, companies.ids[i]]));
|
|
41
|
+
// Tags (RFC 0022 step 2): key accounts and the partners we both buy from and sell to.
|
|
42
|
+
const tags = await env
|
|
43
|
+
.model('res.partner.tag')
|
|
44
|
+
.create([{ name: 'Key account' }, { name: 'Both ways' }, { name: 'Prospect' }]);
|
|
45
|
+
const [keyAccount, bothWays] = tags.ids;
|
|
46
|
+
for (const c of COMPANIES) {
|
|
47
|
+
const id = byName.get(c.name);
|
|
48
|
+
if (id === undefined)
|
|
49
|
+
continue;
|
|
50
|
+
const wanted = [
|
|
51
|
+
...(c.isCustomer === true &&
|
|
52
|
+
c.isVendor === true &&
|
|
53
|
+
bothWays !== undefined
|
|
54
|
+
? [bothWays]
|
|
55
|
+
: []),
|
|
56
|
+
...(c.name === 'Bengal Steel Ltd' && keyAccount !== undefined ? [keyAccount] : []),
|
|
57
|
+
];
|
|
58
|
+
if (wanted.length > 0)
|
|
59
|
+
await partners.browse([id]).write({ tags: { set: wanted } });
|
|
60
|
+
}
|
|
32
61
|
await partners.create(PEOPLE.map(({ company, ...p }) => ({
|
|
33
62
|
...p,
|
|
34
63
|
parent: orm.asId(byName.get(company), 'res.partner'),
|
package/dist/contacts/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { defineModule } from '../modules-sdk/index.js';
|
|
7
7
|
export { contactsDemo, DINA } from './demo.js';
|
|
8
|
-
export { contactsShutro, ResPartner } from './module.js';
|
|
8
|
+
export { contactsShutro, ResPartner, ResPartnerTag } from './module.js';
|
|
9
9
|
export declare const contacts: ReturnType<typeof defineModule>;
|