shutro-erp 0.3.3 → 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 +181 -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 +181 -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 +205 -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/integrations/index.js +12 -0
- package/dist/integrations/web/OAuthAppsPage.d.ts +9 -0
- package/dist/integrations/web/OAuthAppsPage.js +79 -0
- package/dist/integrations/web/index.d.ts +1 -0
- package/dist/integrations/web/index.js +3 -0
- package/dist/integrations/web/messages.js +58 -0
- package/dist/l10n_bd/.kosh/bindings.js +1 -1
- package/dist/l10n_bd/.kosh/schema.d.ts +181 -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 +181 -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/messaging/web/index.js +1 -1
- 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/notify/web/index.js +1 -1
- package/dist/payment/.kosh/bindings.js +1 -1
- package/dist/payment/.kosh/schema.d.ts +181 -3
- package/dist/payment/module.d.ts +359 -6
- package/dist/portal/.kosh/bindings.js +1 -1
- package/dist/portal/.kosh/schema.d.ts +205 -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 +178 -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 +181 -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 +181 -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 +181 -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 +182 -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 +181 -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 +186 -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 +185 -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 +187 -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 +185 -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 +85 -0
- package/dist/server/auth/oauth.d.ts +21 -0
- package/dist/server/auth/oauth.js +579 -0
- package/dist/server/auth/service.d.ts +4 -0
- package/dist/server/auth/service.js +17 -0
- package/dist/server/identity.d.ts +2 -0
- package/dist/server/images.d.ts +12 -0
- package/dist/server/images.js +139 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +2 -0
- package/dist/server/server.d.ts +4 -0
- package/dist/server/server.js +9 -1
- package/dist/settings/app-settings.d.ts +2 -0
- package/dist/settings/app-settings.js +518 -0
- package/dist/settings/company.js +3 -1
- package/dist/settings/index.d.ts +1 -0
- package/dist/settings/index.js +15 -0
- package/dist/settings/people.js +32 -6
- package/dist/settings/web/AppSettingsPage.d.ts +11 -0
- package/dist/settings/web/AppSettingsPage.js +210 -0
- package/dist/settings/web/CompaniesPage.js +2 -2
- package/dist/settings/web/CompanyPage.js +13 -2
- package/dist/settings/web/ConnectedAppsPage.d.ts +7 -0
- package/dist/settings/web/ConnectedAppsPage.js +33 -0
- package/dist/settings/web/OverviewPage.js +28 -4
- package/dist/settings/web/PeoplePage.js +23 -18
- package/dist/settings/web/ProfilePage.js +9 -7
- package/dist/settings/web/index.d.ts +2 -0
- package/dist/settings/web/index.js +8 -0
- package/dist/settings/web/messages.js +146 -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 +6 -1
- package/dist/ui/api.js +2 -1
- package/dist/ui/app.js +51 -17
- package/dist/ui/components/AppIcon.js +33 -1
- package/dist/ui/components/Avatar.d.ts +21 -0
- package/dist/ui/components/Avatar.js +71 -0
- package/dist/ui/components/primitives.d.ts +2 -0
- package/dist/ui/components/primitives.js +7 -1
- package/dist/ui/i18n/messages.d.ts +53 -0
- package/dist/ui/i18n/messages.js +98 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/offline/queue.d.ts +5 -1
- package/dist/ui/offline/queue.js +2 -0
- package/dist/ui/registry.d.ts +12 -1
- package/dist/ui/registry.js +10 -1
- package/dist/ui/search/ViewTabs.d.ts +14 -0
- package/dist/ui/search/ViewTabs.js +42 -0
- package/dist/ui/shell/Consent.d.ts +5 -0
- package/dist/ui/shell/Consent.js +35 -0
- package/dist/ui/shell/Home.js +136 -16
- package/dist/ui/shell/Sidebar.js +15 -22
- 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 +155 -31
- 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
|
|
|
@@ -12,12 +12,19 @@ export interface SchemaView {
|
|
|
12
12
|
readonly 'auth.session': AuthSession;
|
|
13
13
|
readonly 'auth.user_grant': AuthUserGrant;
|
|
14
14
|
readonly 'auth.user_group': AuthUserGroup;
|
|
15
|
+
readonly 'kosh.image': KoshImage;
|
|
15
16
|
readonly 'kosh.saved_view': KoshSavedView;
|
|
17
|
+
readonly 'kosh.setting': KoshSetting;
|
|
18
|
+
readonly 'oauth.app': OauthApp;
|
|
19
|
+
readonly 'oauth.code': OauthCode;
|
|
20
|
+
readonly 'oauth.grant': OauthGrant;
|
|
21
|
+
readonly 'oauth.token': OauthToken;
|
|
16
22
|
readonly 'product.category': ProductCategory;
|
|
17
23
|
readonly 'product.product': ProductProduct;
|
|
18
24
|
readonly 'res.company': ResCompany;
|
|
19
25
|
readonly 'res.currency': ResCurrency;
|
|
20
26
|
readonly 'res.users': ResUsers;
|
|
27
|
+
readonly 'storage.attachment': StorageAttachment;
|
|
21
28
|
readonly 'uom.uom': UomUom;
|
|
22
29
|
}
|
|
23
30
|
|
|
@@ -218,6 +225,29 @@ export interface AuthUserGroup {
|
|
|
218
225
|
export interface AuthUserGroupMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'auth.user_group'> {
|
|
219
226
|
}
|
|
220
227
|
|
|
228
|
+
/** `kosh.image` (owner: base). */
|
|
229
|
+
export interface KoshImage {
|
|
230
|
+
readonly name: 'kosh.image';
|
|
231
|
+
readonly fields: {
|
|
232
|
+
readonly id: F.Id<'kosh.image'>;
|
|
233
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
234
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
235
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
236
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
237
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
238
|
+
readonly ownerModel: F.Char<{ readonly required: true }>;
|
|
239
|
+
readonly ownerId: F.Integer<{ readonly required: true }>;
|
|
240
|
+
readonly mime: F.Char<{ readonly required: true }>;
|
|
241
|
+
readonly data: F.Text<{ readonly required: true }>;
|
|
242
|
+
readonly hash: F.Char<{ readonly required: true }>;
|
|
243
|
+
};
|
|
244
|
+
readonly methods: KoshImageMethods;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Methods of `kosh.image`: declared ones and transitions. */
|
|
248
|
+
export interface KoshImageMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.image'> {
|
|
249
|
+
}
|
|
250
|
+
|
|
221
251
|
/** `kosh.saved_view` (owner: base). */
|
|
222
252
|
export interface KoshSavedView {
|
|
223
253
|
readonly name: 'kosh.saved_view';
|
|
@@ -242,6 +272,125 @@ export interface KoshSavedView {
|
|
|
242
272
|
export interface KoshSavedViewMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'kosh.saved_view'> {
|
|
243
273
|
}
|
|
244
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
|
+
|
|
295
|
+
/** `oauth.app` (owner: base). */
|
|
296
|
+
export interface OauthApp {
|
|
297
|
+
readonly name: 'oauth.app';
|
|
298
|
+
readonly fields: {
|
|
299
|
+
readonly id: F.Id<'oauth.app'>;
|
|
300
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
301
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
302
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
303
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
304
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
305
|
+
readonly name: F.Char<{ readonly required: true }>;
|
|
306
|
+
readonly clientId: F.Char<{ readonly required: true }>;
|
|
307
|
+
readonly secretHash: F.Char;
|
|
308
|
+
readonly confidential: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
309
|
+
readonly redirectUris: F.Text<{ readonly required: true }>;
|
|
310
|
+
readonly scopes: F.Char<{ readonly required: true }>;
|
|
311
|
+
readonly homepage: F.Char;
|
|
312
|
+
readonly active: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
313
|
+
readonly owner: F.Many2one<'res.users'>;
|
|
314
|
+
};
|
|
315
|
+
readonly methods: OauthAppMethods;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** Methods of `oauth.app`: declared ones and transitions. */
|
|
319
|
+
export interface OauthAppMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'oauth.app'> {
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/** `oauth.code` (owner: base). */
|
|
323
|
+
export interface OauthCode {
|
|
324
|
+
readonly name: 'oauth.code';
|
|
325
|
+
readonly fields: {
|
|
326
|
+
readonly id: F.Id<'oauth.code'>;
|
|
327
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
328
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
329
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
330
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
331
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
332
|
+
readonly codeHash: F.Char<{ readonly required: true }>;
|
|
333
|
+
readonly grant: F.Many2one<'oauth.grant', { readonly required: true }>;
|
|
334
|
+
readonly redirectUri: F.Char<{ readonly required: true }>;
|
|
335
|
+
readonly challenge: F.Char;
|
|
336
|
+
readonly expiresAt: F.Datetime<{ readonly required: true }>;
|
|
337
|
+
readonly used: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
338
|
+
};
|
|
339
|
+
readonly methods: OauthCodeMethods;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/** Methods of `oauth.code`: declared ones and transitions. */
|
|
343
|
+
export interface OauthCodeMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'oauth.code'> {
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/** `oauth.grant` (owner: base). */
|
|
347
|
+
export interface OauthGrant {
|
|
348
|
+
readonly name: 'oauth.grant';
|
|
349
|
+
readonly fields: {
|
|
350
|
+
readonly id: F.Id<'oauth.grant'>;
|
|
351
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
352
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
353
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
354
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
355
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
356
|
+
readonly user: F.Many2one<'res.users', { readonly required: true }>;
|
|
357
|
+
readonly app: F.Many2one<'oauth.app', { readonly required: true }>;
|
|
358
|
+
readonly scopes: F.Char<{ readonly required: true }>;
|
|
359
|
+
readonly revoked: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
360
|
+
readonly lastUsedAt: F.Datetime;
|
|
361
|
+
};
|
|
362
|
+
readonly methods: OauthGrantMethods;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/** Methods of `oauth.grant`: declared ones and transitions. */
|
|
366
|
+
export interface OauthGrantMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'oauth.grant'> {
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/** `oauth.token` (owner: base). */
|
|
370
|
+
export interface OauthToken {
|
|
371
|
+
readonly name: 'oauth.token';
|
|
372
|
+
readonly fields: {
|
|
373
|
+
readonly id: F.Id<'oauth.token'>;
|
|
374
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
375
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
376
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
377
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
378
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
379
|
+
readonly grant: F.Many2one<'oauth.grant', { readonly required: true }>;
|
|
380
|
+
readonly accessHash: F.Char<{ readonly required: true }>;
|
|
381
|
+
readonly refreshHash: F.Char<{ readonly required: true }>;
|
|
382
|
+
readonly accessExpiresAt: F.Datetime<{ readonly required: true }>;
|
|
383
|
+
readonly refreshExpiresAt: F.Datetime<{ readonly required: true }>;
|
|
384
|
+
readonly revoked: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
385
|
+
readonly rotated: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
386
|
+
};
|
|
387
|
+
readonly methods: OauthTokenMethods;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** Methods of `oauth.token`: declared ones and transitions. */
|
|
391
|
+
export interface OauthTokenMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'oauth.token'> {
|
|
392
|
+
}
|
|
393
|
+
|
|
245
394
|
/** `product.category` (owner: product). */
|
|
246
395
|
export interface ProductCategory {
|
|
247
396
|
readonly name: 'product.category';
|
|
@@ -279,6 +428,7 @@ export interface ProductProduct {
|
|
|
279
428
|
readonly category: F.Many2one<'product.category'>;
|
|
280
429
|
readonly uom: F.Many2one<'uom.uom'>;
|
|
281
430
|
readonly barcode: F.Char;
|
|
431
|
+
readonly image: F.Many2one<'storage.attachment'>;
|
|
282
432
|
readonly listPrice: F.Decimal<{ readonly required: true; readonly default: true }>;
|
|
283
433
|
readonly standardPrice: F.Decimal<{ readonly required: true; readonly default: true }>;
|
|
284
434
|
readonly saleOk: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
@@ -373,6 +523,33 @@ export interface ResUsers {
|
|
|
373
523
|
export interface ResUsersMethods extends F.Methods<typeof import('../../server/index.js').baseShutro, 'res.users'> {
|
|
374
524
|
}
|
|
375
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
|
+
|
|
376
553
|
/** `uom.uom` (owner: product). */
|
|
377
554
|
export interface UomUom {
|
|
378
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';
|