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,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data layer of the Counter ↔ Stockroom bridge (RFC 0021, Counter step 2): a closed session's sold goods leave
|
|
3
|
+
* the shop's warehouse as **one delivery per session**, done at once when the stock is there; when it is short the
|
|
4
|
+
* delivery stays confirmed for a manager to finish from Stockroom. Returns (negative quantities) come back in it.
|
|
5
|
+
*/
|
|
6
|
+
import { posShutro } from '../pos/index.js';
|
|
7
|
+
import { orm } from '../server/orm.js';
|
|
8
|
+
import { defaultLocations, stockShutro } from '../stock/index.js';
|
|
9
|
+
import { defineModule, extendModel, f } from './.kosh/bindings.js';
|
|
10
|
+
const ZERO = orm.toDecimal(0);
|
|
11
|
+
export const ShopWarehouse = extendModel('pos.shop', {
|
|
12
|
+
fields: {
|
|
13
|
+
/** The warehouse the shop sells from; the company's first one otherwise. */
|
|
14
|
+
warehouse: f.many2one('stock.warehouse', { ondelete: 'restrict' }),
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export const SessionDelivery = extendModel('pos.session', {
|
|
18
|
+
fields: {
|
|
19
|
+
delivery: f.many2one('stock.picking', { ondelete: 'set null', label: 'Stock delivery' }),
|
|
20
|
+
},
|
|
21
|
+
overrides: {
|
|
22
|
+
closed: async function (next) {
|
|
23
|
+
await next();
|
|
24
|
+
const sessions = this;
|
|
25
|
+
const env = sessions.env;
|
|
26
|
+
await env.asSuperuser({ reason: 'counter session to stock' }, async (su) => {
|
|
27
|
+
for (const s of await su
|
|
28
|
+
.model('pos.session')
|
|
29
|
+
.browse(sessions.ids)
|
|
30
|
+
.load({ shop: true, company: true, orders: { lines: { product: { uom: true } } } })) {
|
|
31
|
+
if (s.delivery !== null)
|
|
32
|
+
continue;
|
|
33
|
+
// What left the shelves: the paid sales' goods, by product (returns take away).
|
|
34
|
+
const sold = new Map();
|
|
35
|
+
for (const o of s.orders) {
|
|
36
|
+
if (o.state !== 'paid')
|
|
37
|
+
continue;
|
|
38
|
+
for (const l of o.lines) {
|
|
39
|
+
if (l.product.kind !== 'goods')
|
|
40
|
+
continue;
|
|
41
|
+
const slot = sold.get(l.product.id) ?? {
|
|
42
|
+
product: l.product.id,
|
|
43
|
+
name: l.product.name,
|
|
44
|
+
uom: l.product.uom?.id ?? null,
|
|
45
|
+
quantity: ZERO,
|
|
46
|
+
};
|
|
47
|
+
slot.quantity = slot.quantity.plus(l.quantity);
|
|
48
|
+
sold.set(l.product.id, slot);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const moves = [...sold.values()].filter((m) => m.quantity.gt(0));
|
|
52
|
+
if (moves.length === 0)
|
|
53
|
+
continue;
|
|
54
|
+
const shopWarehouse = s.shop.warehouse;
|
|
55
|
+
const places = await defaultLocations(su, 'delivery', shopWarehouse?.id ?? null, s.company.id);
|
|
56
|
+
if (places.source === null || places.destination === null)
|
|
57
|
+
throw new orm.ValidationError('pos.session', ['state'], `The company of ${s.name} has no warehouse to sell from.`, 'Add a warehouse in Stockroom › Configuration › Warehouses.');
|
|
58
|
+
const made = await su.model('stock.picking').create([
|
|
59
|
+
{
|
|
60
|
+
kind: 'delivery',
|
|
61
|
+
company: s.company.id,
|
|
62
|
+
warehouse: places.warehouse,
|
|
63
|
+
source: places.source,
|
|
64
|
+
destination: places.destination,
|
|
65
|
+
origin: s.name,
|
|
66
|
+
moves: {
|
|
67
|
+
create: moves.map((m) => ({
|
|
68
|
+
product: m.product,
|
|
69
|
+
name: m.name,
|
|
70
|
+
quantity: m.quantity,
|
|
71
|
+
quantityDone: m.quantity,
|
|
72
|
+
uom: m.uom,
|
|
73
|
+
})),
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
]);
|
|
77
|
+
await su.flush();
|
|
78
|
+
await made.confirm();
|
|
79
|
+
await su.flush();
|
|
80
|
+
await made.reserve();
|
|
81
|
+
await su.flush();
|
|
82
|
+
// Done at once when the stock is there; else it waits for a manager in Stockroom.
|
|
83
|
+
try {
|
|
84
|
+
await made.validate();
|
|
85
|
+
await su.flush();
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
const name = error.name;
|
|
89
|
+
// Short stock: the guard of validate refuses; the delivery stays confirmed for Stockroom.
|
|
90
|
+
if (!(error instanceof orm.ValidationError || name === 'TransitionGuardError'))
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
await su
|
|
94
|
+
.model('pos.session')
|
|
95
|
+
.browse([s.id])
|
|
96
|
+
.write({ delivery: made.ids[0] ?? null });
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
export const posStockShutro = defineModule({
|
|
103
|
+
name: 'pos_stock',
|
|
104
|
+
version: '0.1.0',
|
|
105
|
+
depends: [posShutro, stockShutro],
|
|
106
|
+
groups: [
|
|
107
|
+
orm.defineGroup({
|
|
108
|
+
code: 'pos_stock.user',
|
|
109
|
+
label: 'Counter sales from stock',
|
|
110
|
+
implies: ['pos.cashier'],
|
|
111
|
+
}),
|
|
112
|
+
],
|
|
113
|
+
models: [],
|
|
114
|
+
extensions: [ShopWarehouse, SessionDelivery],
|
|
115
|
+
});
|
|
@@ -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: 95df3fbe8a5c3d67
|
|
2
2
|
// Bindings of module `product`: 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: 95df3fbe8a5c3d67
|
|
2
2
|
// Schema view of module `product` (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
|
|
|
@@ -14,6 +14,7 @@ export interface SchemaView {
|
|
|
14
14
|
readonly 'auth.user_group': AuthUserGroup;
|
|
15
15
|
readonly 'kosh.image': KoshImage;
|
|
16
16
|
readonly 'kosh.saved_view': KoshSavedView;
|
|
17
|
+
readonly 'kosh.setting': KoshSetting;
|
|
17
18
|
readonly 'oauth.app': OauthApp;
|
|
18
19
|
readonly 'oauth.code': OauthCode;
|
|
19
20
|
readonly 'oauth.grant': OauthGrant;
|
|
@@ -23,6 +24,7 @@ export interface SchemaView {
|
|
|
23
24
|
readonly 'res.company': ResCompany;
|
|
24
25
|
readonly 'res.currency': ResCurrency;
|
|
25
26
|
readonly 'res.users': ResUsers;
|
|
27
|
+
readonly 'storage.attachment': StorageAttachment;
|
|
26
28
|
readonly 'uom.uom': UomUom;
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -270,6 +272,26 @@ export interface KoshSavedView {
|
|
|
270
272
|
export interface KoshSavedViewMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.saved_view'> {
|
|
271
273
|
}
|
|
272
274
|
|
|
275
|
+
/** `kosh.setting` (owner: base). */
|
|
276
|
+
export interface KoshSetting {
|
|
277
|
+
readonly name: 'kosh.setting';
|
|
278
|
+
readonly fields: {
|
|
279
|
+
readonly id: F.Id<'kosh.setting'>;
|
|
280
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
281
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
282
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
283
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
284
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
285
|
+
readonly key: F.Char<{ readonly required: true }>;
|
|
286
|
+
readonly value: F.Json;
|
|
287
|
+
};
|
|
288
|
+
readonly methods: KoshSettingMethods;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** Methods of `kosh.setting`: declared ones and transitions. */
|
|
292
|
+
export interface KoshSettingMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.setting'> {
|
|
293
|
+
}
|
|
294
|
+
|
|
273
295
|
/** `oauth.app` (owner: base). */
|
|
274
296
|
export interface OauthApp {
|
|
275
297
|
readonly name: 'oauth.app';
|
|
@@ -406,6 +428,7 @@ export interface ProductProduct {
|
|
|
406
428
|
readonly category: F.Many2one<'product.category'>;
|
|
407
429
|
readonly uom: F.Many2one<'uom.uom'>;
|
|
408
430
|
readonly barcode: F.Char;
|
|
431
|
+
readonly image: F.Many2one<'storage.attachment'>;
|
|
409
432
|
readonly listPrice: F.Decimal<{ readonly required: true; readonly default: true }>;
|
|
410
433
|
readonly standardPrice: F.Decimal<{ readonly required: true; readonly default: true }>;
|
|
411
434
|
readonly saleOk: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
@@ -500,6 +523,33 @@ export interface ResUsers {
|
|
|
500
523
|
export interface ResUsersMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'res.users'> {
|
|
501
524
|
}
|
|
502
525
|
|
|
526
|
+
/** `storage.attachment` (owner: storage). */
|
|
527
|
+
export interface StorageAttachment {
|
|
528
|
+
readonly name: 'storage.attachment';
|
|
529
|
+
readonly fields: {
|
|
530
|
+
readonly id: F.Id<'storage.attachment'>;
|
|
531
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
532
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
533
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
534
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
535
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
536
|
+
readonly name: F.Char<{ readonly required: true }>;
|
|
537
|
+
readonly mime: F.Char<{ readonly required: true }>;
|
|
538
|
+
readonly size: F.Integer<{ readonly required: true }>;
|
|
539
|
+
readonly sha256: F.Char<{ readonly required: true }>;
|
|
540
|
+
readonly key: F.Char<{ readonly required: true }>;
|
|
541
|
+
readonly resModel: F.Char<{ readonly required: true }>;
|
|
542
|
+
readonly resId: F.Integer<{ readonly required: true }>;
|
|
543
|
+
readonly variantOf: F.Many2one<'storage.attachment'>;
|
|
544
|
+
readonly width: F.Integer;
|
|
545
|
+
};
|
|
546
|
+
readonly methods: StorageAttachmentMethods;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/** Methods of `storage.attachment`: declared ones and transitions. */
|
|
550
|
+
export interface StorageAttachmentMethods extends F.Methods<typeof import('../../storage/index.js').storageShutro, 'storage.attachment'> {
|
|
551
|
+
}
|
|
552
|
+
|
|
503
553
|
/** `uom.uom` (owner: product). */
|
|
504
554
|
export interface UomUom {
|
|
505
555
|
readonly name: 'uom.uom';
|
package/dist/product/index.js
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* categories, units of measure and taxes. Sales and Purchase sell and buy them.
|
|
5
5
|
*/
|
|
6
6
|
import { defineModule } from '../modules-sdk/index.js';
|
|
7
|
+
import { reporting } from '../reporting/index.js';
|
|
7
8
|
import { base } from '../server/index.js';
|
|
9
|
+
import { storage } from '../storage/index.js';
|
|
8
10
|
import { action, form, kanban, list, search } from '../views/index.js';
|
|
9
11
|
import { productDemo } from './demo.js';
|
|
10
12
|
import { AccountTax, ProductCategory, ProductProduct, productShutro, UomUom } from './module.js';
|
|
@@ -14,7 +16,7 @@ export const product = defineModule({
|
|
|
14
16
|
shutro: productShutro,
|
|
15
17
|
kosh: '^0.1.0',
|
|
16
18
|
hooks: { demo: productDemo },
|
|
17
|
-
depends: [base],
|
|
19
|
+
depends: [base, storage, reporting],
|
|
18
20
|
app: {
|
|
19
21
|
code: 'product',
|
|
20
22
|
label: 'Products',
|
|
@@ -27,6 +29,63 @@ export const product = defineModule({
|
|
|
27
29
|
user: { label: 'User', groups: ['product.user'] },
|
|
28
30
|
manager: { label: 'Manager', groups: ['product.manager'], implies: ['user'] },
|
|
29
31
|
},
|
|
32
|
+
// The Overview (RFC 0022 step 2): the catalogue at a glance.
|
|
33
|
+
overview: {
|
|
34
|
+
cards: [
|
|
35
|
+
{
|
|
36
|
+
id: 'products_all',
|
|
37
|
+
title: 'Products',
|
|
38
|
+
kind: 'kpi',
|
|
39
|
+
model: 'product.product',
|
|
40
|
+
measure: 'count',
|
|
41
|
+
w: 3,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'goods',
|
|
45
|
+
title: 'Goods',
|
|
46
|
+
kind: 'kpi',
|
|
47
|
+
model: 'product.product',
|
|
48
|
+
measure: 'count',
|
|
49
|
+
filter: { kind: 'goods' },
|
|
50
|
+
w: 3,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'services',
|
|
54
|
+
title: 'Services',
|
|
55
|
+
kind: 'kpi',
|
|
56
|
+
model: 'product.product',
|
|
57
|
+
measure: 'count',
|
|
58
|
+
filter: { kind: 'service' },
|
|
59
|
+
w: 3,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'average_price',
|
|
63
|
+
title: 'Average sales price',
|
|
64
|
+
kind: 'kpi',
|
|
65
|
+
model: 'product.product',
|
|
66
|
+
measure: 'avg:listPrice',
|
|
67
|
+
w: 3,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'by_category',
|
|
71
|
+
title: 'By category',
|
|
72
|
+
kind: 'chart',
|
|
73
|
+
model: 'product.product',
|
|
74
|
+
measure: 'count',
|
|
75
|
+
groupBy: 'category',
|
|
76
|
+
chart: 'pie',
|
|
77
|
+
w: 6,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'priciest',
|
|
81
|
+
title: 'Highest sales prices',
|
|
82
|
+
kind: 'list',
|
|
83
|
+
model: 'product.product',
|
|
84
|
+
measure: 'sum:listPrice',
|
|
85
|
+
w: 6,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
30
89
|
actions: {
|
|
31
90
|
'product.action_products': action(ProductProduct, {
|
|
32
91
|
label: 'Products',
|
|
@@ -71,15 +130,33 @@ export const product = defineModule({
|
|
|
71
130
|
views: {
|
|
72
131
|
'product.product.kanban': kanban(ProductProduct, {
|
|
73
132
|
groupBy: 'kind',
|
|
74
|
-
card: { title: 'name', subtitle: 'code', footer: ['listPrice', 'uom'] },
|
|
133
|
+
card: { title: 'name', subtitle: 'code', footer: ['listPrice', 'uom'], image: 'image' },
|
|
75
134
|
}),
|
|
76
135
|
'product.product.list': list(ProductProduct, {
|
|
77
|
-
columns: [
|
|
136
|
+
columns: [
|
|
137
|
+
{ field: 'image', widget: 'avatar' },
|
|
138
|
+
'code',
|
|
139
|
+
'name',
|
|
140
|
+
'kind',
|
|
141
|
+
'category',
|
|
142
|
+
'listPrice',
|
|
143
|
+
'standardPrice',
|
|
144
|
+
'uom',
|
|
145
|
+
],
|
|
78
146
|
defaultOrder: ['name asc'],
|
|
79
147
|
}),
|
|
80
148
|
'product.product.form': form(ProductProduct, (k) => ({
|
|
81
149
|
sheet: [
|
|
82
|
-
|
|
150
|
+
// Sold, bought, on hand: Sales, Purchase and Stockroom append their tiles (RFC 0022 §3.1).
|
|
151
|
+
k.stats('related', []),
|
|
152
|
+
k.group('identity', [
|
|
153
|
+
{ field: 'image', widget: 'image' },
|
|
154
|
+
'name',
|
|
155
|
+
'code',
|
|
156
|
+
'kind',
|
|
157
|
+
'category',
|
|
158
|
+
'barcode',
|
|
159
|
+
]),
|
|
83
160
|
k.group('prices', ['listPrice', 'standardPrice', 'uom'], { label: 'Prices' }),
|
|
84
161
|
k.notebook('more', [
|
|
85
162
|
k.page('sales', 'Sales & purchase', [
|
package/dist/product/module.d.ts
CHANGED
|
@@ -543,6 +543,16 @@ export declare const ProductProduct: import("../server/orm.js").Model<"product.p
|
|
|
543
543
|
readonly hasDefault: false;
|
|
544
544
|
readonly readonly: false;
|
|
545
545
|
}, string>;
|
|
546
|
+
readonly image: import("../server/orm.js").Many2oneField<"storage.attachment", {
|
|
547
|
+
readonly required: false;
|
|
548
|
+
readonly computed: false;
|
|
549
|
+
readonly inverse: false;
|
|
550
|
+
readonly sequence: false;
|
|
551
|
+
readonly computeName: undefined;
|
|
552
|
+
readonly store: true;
|
|
553
|
+
readonly hasDefault: false;
|
|
554
|
+
readonly readonly: false;
|
|
555
|
+
}>;
|
|
546
556
|
readonly listPrice: import("../server/orm.js").DecimalField<{
|
|
547
557
|
readonly required: true;
|
|
548
558
|
readonly computed: false;
|
|
@@ -695,6 +705,17 @@ export declare const ProductProduct: import("../server/orm.js").Model<"product.p
|
|
|
695
705
|
readonly hasDefault: false;
|
|
696
706
|
readonly readonly: false;
|
|
697
707
|
}, string>;
|
|
708
|
+
/** A picture: an attachment of the product (RFC 0022 §3.3), with its 256 px thumbnail. */
|
|
709
|
+
readonly image: import("../server/orm.js").Many2oneField<"storage.attachment", {
|
|
710
|
+
readonly required: false;
|
|
711
|
+
readonly computed: false;
|
|
712
|
+
readonly inverse: false;
|
|
713
|
+
readonly sequence: false;
|
|
714
|
+
readonly computeName: undefined;
|
|
715
|
+
readonly store: true;
|
|
716
|
+
readonly hasDefault: false;
|
|
717
|
+
readonly readonly: false;
|
|
718
|
+
}>;
|
|
698
719
|
/** The sales price, in the company currency. */
|
|
699
720
|
readonly listPrice: import("../server/orm.js").DecimalField<{
|
|
700
721
|
readonly required: true;
|
|
@@ -1333,6 +1354,16 @@ export declare const productShutro: import("../server/orm.js").Module<readonly [
|
|
|
1333
1354
|
readonly hasDefault: false;
|
|
1334
1355
|
readonly readonly: false;
|
|
1335
1356
|
}, string>;
|
|
1357
|
+
readonly image: import("../server/orm.js").Many2oneField<"storage.attachment", {
|
|
1358
|
+
readonly required: false;
|
|
1359
|
+
readonly computed: false;
|
|
1360
|
+
readonly inverse: false;
|
|
1361
|
+
readonly sequence: false;
|
|
1362
|
+
readonly computeName: undefined;
|
|
1363
|
+
readonly store: true;
|
|
1364
|
+
readonly hasDefault: false;
|
|
1365
|
+
readonly readonly: false;
|
|
1366
|
+
}>;
|
|
1336
1367
|
readonly listPrice: import("../server/orm.js").DecimalField<{
|
|
1337
1368
|
readonly required: true;
|
|
1338
1369
|
readonly computed: false;
|
|
@@ -1485,6 +1516,17 @@ export declare const productShutro: import("../server/orm.js").Module<readonly [
|
|
|
1485
1516
|
readonly hasDefault: false;
|
|
1486
1517
|
readonly readonly: false;
|
|
1487
1518
|
}, string>;
|
|
1519
|
+
/** A picture: an attachment of the product (RFC 0022 §3.3), with its 256 px thumbnail. */
|
|
1520
|
+
readonly image: import("../server/orm.js").Many2oneField<"storage.attachment", {
|
|
1521
|
+
readonly required: false;
|
|
1522
|
+
readonly computed: false;
|
|
1523
|
+
readonly inverse: false;
|
|
1524
|
+
readonly sequence: false;
|
|
1525
|
+
readonly computeName: undefined;
|
|
1526
|
+
readonly store: true;
|
|
1527
|
+
readonly hasDefault: false;
|
|
1528
|
+
readonly readonly: false;
|
|
1529
|
+
}>;
|
|
1488
1530
|
/** The sales price, in the company currency. */
|
|
1489
1531
|
readonly listPrice: import("../server/orm.js").DecimalField<{
|
|
1490
1532
|
readonly required: true;
|
|
@@ -1580,4 +1622,4 @@ export declare const productShutro: import("../server/orm.js").Module<readonly [
|
|
|
1580
1622
|
readonly hasDefault: false;
|
|
1581
1623
|
readonly readonly: false;
|
|
1582
1624
|
}>;
|
|
1583
|
-
}>>], readonly [import("../server/orm.js").Module<readonly import("../server/orm.js").AnyModel[], readonly import("../server/orm.js").ModuleBase[], readonly import("../server/orm.js").AnyExtension[]>], readonly []>;
|
|
1625
|
+
}>>], readonly [import("../server/orm.js").Module<readonly import("../server/orm.js").AnyModel[], readonly import("../server/orm.js").ModuleBase[], readonly import("../server/orm.js").AnyExtension[]>, import("../server/orm.js").Module<readonly import("../server/orm.js").AnyModel[], readonly import("../server/orm.js").ModuleBase[], readonly import("../server/orm.js").AnyExtension[]>], readonly []>;
|
package/dist/product/module.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { baseShutro } from '../server/index.js';
|
|
7
7
|
import { orm } from '../server/orm.js';
|
|
8
|
+
import { storageShutro } from '../storage/index.js';
|
|
8
9
|
import { check, defineModel, defineModule, f, record } from './.kosh/bindings.js';
|
|
9
10
|
const ALL = ['read', 'write', 'create', 'unlink', 'export', 'import'];
|
|
10
11
|
const READ = ['read'];
|
|
@@ -90,6 +91,8 @@ export const ProductProduct = defineModel('product.product', {
|
|
|
90
91
|
category: f.many2one('product.category'),
|
|
91
92
|
uom: f.many2one('uom.uom', { label: 'Unit of measure' }),
|
|
92
93
|
barcode: f.char({ index: 'unique' }),
|
|
94
|
+
/** A picture: an attachment of the product (RFC 0022 §3.3), with its 256 px thumbnail. */
|
|
95
|
+
image: f.many2one('storage.attachment', { ondelete: 'set null', label: 'Picture' }),
|
|
93
96
|
/** The sales price, in the company currency. */
|
|
94
97
|
listPrice: f.decimal({ scale: 2, required: true, default: '0', label: 'Sales price' }),
|
|
95
98
|
/** The cost: the default purchase price. */
|
|
@@ -138,9 +141,13 @@ export const productShutro = defineModule({
|
|
|
138
141
|
},
|
|
139
142
|
},
|
|
140
143
|
],
|
|
141
|
-
depends: [baseShutro],
|
|
144
|
+
depends: [baseShutro, storageShutro],
|
|
142
145
|
groups: [
|
|
143
|
-
orm.defineGroup({
|
|
146
|
+
orm.defineGroup({
|
|
147
|
+
code: 'product.user',
|
|
148
|
+
label: 'Products user',
|
|
149
|
+
implies: ['base.user', 'storage.user'],
|
|
150
|
+
}),
|
|
144
151
|
orm.defineGroup({
|
|
145
152
|
code: 'product.manager',
|
|
146
153
|
label: 'Products manager',
|
|
@@ -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: 32f956c99138a8eb
|
|
2
2
|
// Bindings of module `project`: 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: 32f956c99138a8eb
|
|
2
2
|
// Schema view of module `project` (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 'mail.activity': MailActivity;
|
|
17
18
|
readonly 'mail.activity.type': MailActivityType;
|
|
18
19
|
readonly 'mail.channel': MailChannel;
|
|
@@ -31,6 +32,7 @@ export interface SchemaView {
|
|
|
31
32
|
readonly 'res.company': ResCompany;
|
|
32
33
|
readonly 'res.currency': ResCurrency;
|
|
33
34
|
readonly 'res.partner': ResPartner;
|
|
35
|
+
readonly 'res.partner.tag': ResPartnerTag;
|
|
34
36
|
readonly 'res.users': ResUsers;
|
|
35
37
|
readonly 'storage.attachment': StorageAttachment;
|
|
36
38
|
}
|
|
@@ -251,6 +253,26 @@ export interface KoshSavedView {
|
|
|
251
253
|
export interface KoshSavedViewMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.saved_view'> {
|
|
252
254
|
}
|
|
253
255
|
|
|
256
|
+
/** `kosh.setting` (owner: base). */
|
|
257
|
+
export interface KoshSetting {
|
|
258
|
+
readonly name: 'kosh.setting';
|
|
259
|
+
readonly fields: {
|
|
260
|
+
readonly id: F.Id<'kosh.setting'>;
|
|
261
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
262
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
263
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
264
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
265
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
266
|
+
readonly key: F.Char<{ readonly required: true }>;
|
|
267
|
+
readonly value: F.Json;
|
|
268
|
+
};
|
|
269
|
+
readonly methods: KoshSettingMethods;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** Methods of `kosh.setting`: declared ones and transitions. */
|
|
273
|
+
export interface KoshSettingMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.setting'> {
|
|
274
|
+
}
|
|
275
|
+
|
|
254
276
|
/** `mail.activity` (owner: messaging). */
|
|
255
277
|
export interface MailActivity {
|
|
256
278
|
readonly name: 'mail.activity';
|
|
@@ -638,7 +660,7 @@ export interface ProjectTimesheet {
|
|
|
638
660
|
export interface ProjectTimesheetMethods extends F.Methods<typeof import('../module.js').projectShutro, 'project.timesheet'> {
|
|
639
661
|
}
|
|
640
662
|
|
|
641
|
-
/** `res.company` (owner: base). */
|
|
663
|
+
/** `res.company` (owner: base; extended by: contacts, project). */
|
|
642
664
|
export interface ResCompany {
|
|
643
665
|
readonly name: 'res.company';
|
|
644
666
|
readonly fields: {
|
|
@@ -658,12 +680,16 @@ export interface ResCompany {
|
|
|
658
680
|
readonly email: F.Char;
|
|
659
681
|
readonly phone: F.Char;
|
|
660
682
|
readonly website: F.Char;
|
|
683
|
+
readonly contactTaxIdRequired: F.Bool<{ readonly required: true; readonly default: true }>; // contacts
|
|
684
|
+
readonly contactUniqueEmail: F.Bool<{ readonly required: true; readonly default: true }>; // contacts
|
|
685
|
+
readonly projectPlannedHoursDefault: F.Decimal; // project
|
|
686
|
+
readonly projectTimesheetStep: F.Selection<'none' | 'quarter' | 'half' | 'whole', { readonly default: true }>; // project
|
|
661
687
|
};
|
|
662
688
|
readonly methods: ResCompanyMethods;
|
|
663
689
|
}
|
|
664
690
|
|
|
665
691
|
/** Methods of `res.company`: declared ones and transitions. */
|
|
666
|
-
export interface ResCompanyMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'res.company'> {
|
|
692
|
+
export interface ResCompanyMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'res.company'>, F.Methods<typeof import('../../contacts/index.js').contactsShutro, 'res.company'>, F.Methods<typeof import('../module.js').projectShutro, 'res.company'> {
|
|
667
693
|
}
|
|
668
694
|
|
|
669
695
|
/** `res.currency` (owner: base). */
|
|
@@ -700,6 +726,10 @@ export interface ResPartner {
|
|
|
700
726
|
readonly active: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
701
727
|
readonly company: F.Many2one<'res.company', { readonly default: true }>;
|
|
702
728
|
readonly name: F.Char<{ readonly required: true }>;
|
|
729
|
+
readonly image: F.Many2one<'storage.attachment'>;
|
|
730
|
+
readonly tags: F.Many2many<'res.partner.tag', { readonly required: true }>;
|
|
731
|
+
readonly latitude: F.Decimal;
|
|
732
|
+
readonly longitude: F.Decimal;
|
|
703
733
|
readonly isCompany: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
704
734
|
readonly parent: F.Many2one<'res.partner'>;
|
|
705
735
|
readonly contacts: F.One2many<'res.partner', { readonly required: true }>;
|
|
@@ -725,6 +755,25 @@ export interface ResPartner {
|
|
|
725
755
|
export interface ResPartnerMethods extends F.Methods<typeof import('../../contacts/index.js').contactsShutro, 'res.partner'> {
|
|
726
756
|
}
|
|
727
757
|
|
|
758
|
+
/** `res.partner.tag` (owner: contacts). */
|
|
759
|
+
export interface ResPartnerTag {
|
|
760
|
+
readonly name: 'res.partner.tag';
|
|
761
|
+
readonly fields: {
|
|
762
|
+
readonly id: F.Id<'res.partner.tag'>;
|
|
763
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
764
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
765
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
766
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
767
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
768
|
+
readonly name: F.Char<{ readonly required: true }>;
|
|
769
|
+
};
|
|
770
|
+
readonly methods: ResPartnerTagMethods;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/** Methods of `res.partner.tag`: declared ones and transitions. */
|
|
774
|
+
export interface ResPartnerTagMethods extends F.Methods<typeof import('../../contacts/index.js').contactsShutro, 'res.partner.tag'> {
|
|
775
|
+
}
|
|
776
|
+
|
|
728
777
|
/** `res.users` (owner: base). */
|
|
729
778
|
export interface ResUsers {
|
|
730
779
|
readonly name: 'res.users';
|
|
@@ -770,6 +819,8 @@ export interface StorageAttachment {
|
|
|
770
819
|
readonly key: F.Char<{ readonly required: true }>;
|
|
771
820
|
readonly resModel: F.Char<{ readonly required: true }>;
|
|
772
821
|
readonly resId: F.Integer<{ readonly required: true }>;
|
|
822
|
+
readonly variantOf: F.Many2one<'storage.attachment'>;
|
|
823
|
+
readonly width: F.Integer;
|
|
773
824
|
};
|
|
774
825
|
readonly methods: StorageAttachmentMethods;
|
|
775
826
|
}
|