shutro-erp 0.3.5 → 0.3.6
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_asset/.kosh/bindings.d.ts +22 -0
- package/dist/account_asset/.kosh/bindings.js +15 -0
- package/dist/account_asset/.kosh/schema.d.ts +1755 -0
- package/dist/account_asset/board.d.ts +61 -0
- package/dist/account_asset/board.js +86 -0
- package/dist/account_asset/books.d.ts +42 -0
- package/dist/account_asset/books.js +398 -0
- package/dist/account_asset/demo.d.ts +7 -0
- package/dist/account_asset/demo.js +72 -0
- package/dist/account_asset/index.d.ts +9 -0
- package/dist/account_asset/index.js +335 -0
- package/dist/account_asset/module.d.ts +7622 -0
- package/dist/account_asset/module.js +230 -0
- package/dist/account_budget/.kosh/bindings.d.ts +22 -0
- package/dist/account_budget/.kosh/bindings.js +15 -0
- package/dist/account_budget/.kosh/schema.d.ts +1767 -0
- package/dist/account_budget/budget.d.ts +5 -0
- package/dist/account_budget/budget.js +142 -0
- package/dist/account_budget/demo.d.ts +6 -0
- package/dist/account_budget/demo.js +30 -0
- package/dist/account_budget/index.d.ts +4 -0
- package/dist/account_budget/index.js +223 -0
- package/dist/account_budget/module.d.ts +13863 -0
- package/dist/account_budget/module.js +167 -0
- package/dist/account_portal/.kosh/bindings.js +1 -1
- package/dist/account_portal/.kosh/schema.d.ts +123 -4
- package/dist/account_portal/module.d.ts +146 -0
- package/dist/accounting/.kosh/bindings.js +1 -1
- package/dist/accounting/.kosh/schema.d.ts +123 -4
- package/dist/accounting/index.d.ts +1 -1
- package/dist/accounting/index.js +131 -3
- package/dist/accounting/module.d.ts +296 -0
- package/dist/accounting/module.js +32 -1
- package/dist/approvals/.kosh/bindings.d.ts +22 -0
- package/dist/approvals/.kosh/bindings.js +15 -0
- package/dist/approvals/.kosh/schema.d.ts +611 -0
- package/dist/approvals/index.d.ts +18 -0
- package/dist/approvals/index.js +302 -0
- package/dist/approvals/mails.d.ts +25 -0
- package/dist/approvals/mails.js +82 -0
- package/dist/approvals/module.d.ts +1 -0
- package/dist/approvals/module.js +12 -0
- package/dist/approvals/web/History.d.ts +4 -0
- package/dist/approvals/web/History.js +13 -0
- package/dist/approvals/web/Inbox.d.ts +9 -0
- package/dist/approvals/web/Inbox.js +114 -0
- package/dist/approvals/web/Mine.d.ts +7 -0
- package/dist/approvals/web/Mine.js +27 -0
- package/dist/approvals/web/index.d.ts +13 -0
- package/dist/approvals/web/index.js +22 -0
- package/dist/approvals/web/messages.d.ts +2 -0
- package/dist/approvals/web/messages.js +119 -0
- package/dist/approvals/web/shared.d.ts +59 -0
- package/dist/approvals/web/shared.js +46 -0
- package/dist/attendance/.kosh/bindings.d.ts +22 -0
- package/dist/attendance/.kosh/bindings.js +15 -0
- package/dist/attendance/.kosh/schema.d.ts +1048 -0
- package/dist/attendance/days.d.ts +96 -0
- package/dist/attendance/days.js +430 -0
- package/dist/attendance/demo.d.ts +7 -0
- package/dist/attendance/demo.js +58 -0
- package/dist/attendance/index.d.ts +4 -0
- package/dist/attendance/index.js +513 -0
- package/dist/attendance/module.d.ts +3969 -0
- package/dist/attendance/module.js +412 -0
- package/dist/attendance/routes.d.ts +16 -0
- package/dist/attendance/routes.js +266 -0
- package/dist/attendance/web/Check.d.ts +8 -0
- package/dist/attendance/web/Check.js +40 -0
- package/dist/attendance/web/Kiosk.d.ts +8 -0
- package/dist/attendance/web/Kiosk.js +62 -0
- package/dist/attendance/web/PinButton.d.ts +7 -0
- package/dist/attendance/web/PinButton.js +29 -0
- package/dist/attendance/web/index.d.ts +13 -0
- package/dist/attendance/web/index.js +22 -0
- package/dist/attendance/web/messages.d.ts +2 -0
- package/dist/attendance/web/messages.js +61 -0
- package/dist/cli/init.js +32 -0
- package/dist/cli/templates.d.ts +1 -1
- package/dist/cli/templates.js +89 -0
- package/dist/contacts/module.js +13 -2
- package/dist/crm/.kosh/bindings.js +1 -1
- package/dist/crm/.kosh/schema.d.ts +2 -1
- package/dist/crm/module.d.ts +2 -0
- package/dist/crm/module.js +2 -1
- package/dist/documents/.kosh/bindings.d.ts +22 -0
- package/dist/documents/.kosh/bindings.js +15 -0
- package/dist/documents/.kosh/schema.d.ts +862 -0
- package/dist/documents/demo.d.ts +6 -0
- package/dist/documents/demo.js +22 -0
- package/dist/documents/documents.d.ts +98 -0
- package/dist/documents/documents.js +318 -0
- package/dist/documents/index.d.ts +30 -0
- package/dist/documents/index.js +442 -0
- package/dist/documents/module.d.ts +2781 -0
- package/dist/documents/module.js +214 -0
- package/dist/documents/web/Versions.d.ts +7 -0
- package/dist/documents/web/Versions.js +45 -0
- package/dist/documents/web/index.d.ts +11 -0
- package/dist/documents/web/index.js +16 -0
- package/dist/documents/web/messages.d.ts +2 -0
- package/dist/documents/web/messages.js +21 -0
- package/dist/event_account/.kosh/bindings.js +1 -1
- package/dist/event_account/.kosh/schema.d.ts +123 -4
- package/dist/event_account/module.d.ts +146 -0
- package/dist/expense/.kosh/bindings.d.ts +22 -0
- package/dist/expense/.kosh/bindings.js +15 -0
- package/dist/expense/.kosh/schema.d.ts +1299 -0
- package/dist/expense/demo.d.ts +7 -0
- package/dist/expense/demo.js +69 -0
- package/dist/expense/index.d.ts +3 -0
- package/dist/expense/index.js +495 -0
- package/dist/expense/module.d.ts +4747 -0
- package/dist/expense/module.js +647 -0
- package/dist/expense_account/.kosh/bindings.d.ts +22 -0
- package/dist/expense_account/.kosh/bindings.js +15 -0
- package/dist/expense_account/.kosh/schema.d.ts +1936 -0
- package/dist/expense_account/index.d.ts +3 -0
- package/dist/expense_account/index.js +74 -0
- package/dist/expense_account/module.d.ts +9153 -0
- package/dist/expense_account/module.js +318 -0
- package/dist/helpdesk/.kosh/bindings.d.ts +22 -0
- package/dist/helpdesk/.kosh/bindings.js +15 -0
- package/dist/helpdesk/.kosh/schema.d.ts +885 -0
- package/dist/helpdesk/demo.d.ts +7 -0
- package/dist/helpdesk/demo.js +65 -0
- package/dist/helpdesk/hours.d.ts +17 -0
- package/dist/helpdesk/hours.js +94 -0
- package/dist/helpdesk/index.d.ts +10 -0
- package/dist/helpdesk/index.js +461 -0
- package/dist/helpdesk/module.d.ts +2940 -0
- package/dist/helpdesk/module.js +326 -0
- package/dist/helpdesk/routes.d.ts +12 -0
- package/dist/helpdesk/routes.js +132 -0
- package/dist/helpdesk/sla.d.ts +37 -0
- package/dist/helpdesk/sla.js +226 -0
- package/dist/hr/index.d.ts +1 -1
- package/dist/hr/index.js +1 -1
- package/dist/l10n_bd/.kosh/bindings.js +1 -1
- package/dist/l10n_bd/.kosh/schema.d.ts +123 -4
- package/dist/l10n_bd/module.d.ts +146 -0
- package/dist/l10n_bd_payroll/.kosh/bindings.d.ts +22 -0
- package/dist/l10n_bd_payroll/.kosh/bindings.js +15 -0
- package/dist/l10n_bd_payroll/.kosh/schema.d.ts +2312 -0
- package/dist/l10n_bd_payroll/data.d.ts +47 -0
- package/dist/l10n_bd_payroll/data.js +347 -0
- package/dist/l10n_bd_payroll/index.d.ts +4 -0
- package/dist/l10n_bd_payroll/index.js +24 -0
- package/dist/l10n_bd_payroll/module.d.ts +12932 -0
- package/dist/l10n_bd_payroll/module.js +86 -0
- package/dist/l10n_in/.kosh/bindings.js +1 -1
- package/dist/l10n_in/.kosh/schema.d.ts +123 -4
- package/dist/l10n_in/module.d.ts +147 -0
- package/dist/mail/inbound/handle.js +6 -1
- package/dist/maintenance_stock/.kosh/bindings.js +1 -1
- package/dist/maintenance_stock/.kosh/schema.d.ts +77 -2
- package/dist/maintenance_stock/module.d.ts +788 -66
- package/dist/modules-sdk/index.d.ts +1 -1
- package/dist/modules-sdk/manifest.d.ts +39 -2
- package/dist/mrp/.kosh/bindings.js +1 -1
- package/dist/mrp/.kosh/schema.d.ts +77 -2
- package/dist/mrp/index.d.ts +1 -1
- package/dist/mrp/index.js +2 -1
- package/dist/mrp/module.d.ts +781 -54
- package/dist/mrp/module.js +64 -2
- package/dist/mrp_account/.kosh/bindings.js +1 -1
- package/dist/mrp_account/.kosh/schema.d.ts +198 -5
- package/dist/mrp_account/module.d.ts +4852 -2541
- package/dist/payment/.kosh/bindings.js +1 -1
- package/dist/payment/.kosh/schema.d.ts +125 -5
- package/dist/payment/index.d.ts +41 -0
- package/dist/payment/index.js +131 -74
- package/dist/payment/module.d.ts +210 -6
- package/dist/payment/module.js +19 -3
- package/dist/payment/settle.js +10 -1
- package/dist/payroll/.kosh/bindings.d.ts +22 -0
- package/dist/payroll/.kosh/bindings.js +15 -0
- package/dist/payroll/.kosh/schema.d.ts +1390 -0
- package/dist/payroll/compute.d.ts +35 -0
- package/dist/payroll/compute.js +398 -0
- package/dist/payroll/demo.d.ts +55 -0
- package/dist/payroll/demo.js +121 -0
- package/dist/payroll/formula.d.ts +62 -0
- package/dist/payroll/formula.js +320 -0
- package/dist/payroll/index.d.ts +230 -0
- package/dist/payroll/index.js +713 -0
- package/dist/payroll/module.d.ts +9390 -0
- package/dist/payroll/module.js +606 -0
- package/dist/payroll/routes.d.ts +10 -0
- package/dist/payroll/routes.js +112 -0
- package/dist/payroll_account/.kosh/bindings.d.ts +22 -0
- package/dist/payroll_account/.kosh/bindings.js +15 -0
- package/dist/payroll_account/.kosh/schema.d.ts +2308 -0
- package/dist/payroll_account/index.d.ts +3 -0
- package/dist/payroll_account/index.js +40 -0
- package/dist/payroll_account/module.d.ts +12396 -0
- package/dist/payroll_account/module.js +256 -0
- package/dist/permissions/approvals.d.ts +131 -9
- package/dist/permissions/approvals.js +662 -57
- package/dist/permissions/index.d.ts +1 -1
- package/dist/permissions/index.js +2 -2
- package/dist/permissions/models.js +191 -12
- package/dist/permissions/routes.d.ts +6 -1
- package/dist/permissions/routes.js +37 -4
- package/dist/permissions/web/ApprovalPanel.d.ts +5 -4
- package/dist/permissions/web/ApprovalPanel.js +39 -13
- package/dist/permissions/web/index.d.ts +6 -4
- package/dist/permissions/web/index.js +13 -4
- package/dist/permissions/web/messages.d.ts +2 -0
- package/dist/permissions/web/messages.js +43 -0
- package/dist/portal/index.js +1 -1
- package/dist/pos/.kosh/bindings.js +1 -1
- package/dist/pos/.kosh/schema.d.ts +123 -4
- package/dist/pos/index.js +4 -0
- package/dist/pos/module.d.ts +147 -0
- package/dist/pos_stock/.kosh/bindings.js +1 -1
- package/dist/pos_stock/.kosh/schema.d.ts +198 -5
- package/dist/pos_stock/module.d.ts +914 -46
- package/dist/product/.kosh/bindings.js +1 -1
- package/dist/product/.kosh/schema.d.ts +2 -1
- package/dist/product/index.js +13 -0
- package/dist/product/module.d.ts +2 -0
- package/dist/product/module.js +2 -1
- package/dist/project/.kosh/bindings.js +1 -1
- package/dist/project/.kosh/schema.d.ts +672 -1
- package/dist/project/index.d.ts +3 -1
- package/dist/project/index.js +901 -14
- package/dist/project/module.d.ts +9892 -390
- package/dist/project/module.js +1530 -13
- package/dist/project/routes.d.ts +44 -0
- package/dist/project/routes.js +314 -0
- package/dist/project/schedule.d.ts +72 -0
- package/dist/project/schedule.js +192 -0
- package/dist/project/web/Refresh.d.ts +8 -0
- package/dist/project/web/Refresh.js +29 -0
- package/dist/project/web/Schedule.d.ts +9 -0
- package/dist/project/web/Schedule.js +93 -0
- package/dist/project/web/Structure.d.ts +8 -0
- package/dist/project/web/Structure.js +86 -0
- package/dist/project/web/Workload.d.ts +8 -0
- package/dist/project/web/Workload.js +43 -0
- package/dist/project/web/index.d.ts +14 -0
- package/dist/project/web/index.js +25 -0
- package/dist/project/web/messages.d.ts +2 -0
- package/dist/project/web/messages.js +85 -0
- package/dist/project_account/.kosh/bindings.d.ts +22 -0
- package/dist/project_account/.kosh/bindings.js +15 -0
- package/dist/project_account/.kosh/schema.d.ts +2241 -0
- package/dist/project_account/index.d.ts +3 -0
- package/dist/project_account/index.js +27 -0
- package/dist/project_account/module.d.ts +11539 -0
- package/dist/project_account/module.js +76 -0
- package/dist/project_portal/.kosh/bindings.js +1 -1
- package/dist/project_portal/.kosh/schema.d.ts +672 -1
- package/dist/project_portal/module.d.ts +4798 -129
- package/dist/project_purchase/.kosh/bindings.d.ts +22 -0
- package/dist/project_purchase/.kosh/bindings.js +15 -0
- package/dist/project_purchase/.kosh/schema.d.ts +2320 -0
- package/dist/project_purchase/index.d.ts +9 -0
- package/dist/project_purchase/index.js +22 -0
- package/dist/project_purchase/module.d.ts +25147 -0
- package/dist/project_purchase/module.js +56 -0
- package/dist/purchase/.kosh/bindings.js +1 -1
- package/dist/purchase/.kosh/schema.d.ts +97 -4
- package/dist/purchase/module.d.ts +13 -2
- package/dist/purchase/module.js +10 -1
- package/dist/purchase_account/.kosh/bindings.js +1 -1
- package/dist/purchase_account/.kosh/schema.d.ts +126 -6
- package/dist/purchase_account/index.js +1 -0
- package/dist/purchase_account/module.d.ts +176 -1
- package/dist/purchase_account/module.js +13 -2
- package/dist/purchase_portal/.kosh/bindings.js +1 -1
- package/dist/purchase_portal/.kosh/schema.d.ts +97 -4
- package/dist/purchase_portal/module.d.ts +6 -1
- package/dist/purchase_stock/.kosh/bindings.js +1 -1
- package/dist/purchase_stock/.kosh/schema.d.ts +174 -5
- package/dist/purchase_stock/index.d.ts +1 -1
- package/dist/purchase_stock/index.js +9 -2
- package/dist/purchase_stock/module.d.ts +840 -68
- package/dist/purchase_stock/module.js +242 -6
- package/dist/purchase_stock_account/.kosh/bindings.js +1 -1
- package/dist/purchase_stock_account/.kosh/schema.d.ts +203 -7
- package/dist/purchase_stock_account/module.d.ts +8163 -5514
- package/dist/purchase_stock_account/module.js +11 -5
- package/dist/recruitment/.kosh/bindings.js +1 -1
- package/dist/recruitment/.kosh/schema.d.ts +2 -1
- package/dist/recruitment/module.d.ts +2 -0
- package/dist/recruitment/module.js +2 -1
- package/dist/sale_account/.kosh/bindings.js +1 -1
- package/dist/sale_account/.kosh/schema.d.ts +123 -4
- package/dist/sale_account/module.d.ts +147 -0
- package/dist/sale_portal/.kosh/bindings.js +1 -1
- package/dist/sale_portal/.kosh/schema.d.ts +2 -1
- package/dist/sale_portal/module.d.ts +1 -0
- package/dist/sale_project/.kosh/bindings.js +1 -1
- package/dist/sale_project/.kosh/schema.d.ts +673 -1
- package/dist/sale_project/module.d.ts +4800 -129
- package/dist/sale_project/module.js +17 -1
- package/dist/sale_stock/.kosh/bindings.js +1 -1
- package/dist/sale_stock/.kosh/schema.d.ts +77 -2
- package/dist/sale_stock/module.d.ts +789 -66
- package/dist/sales/.kosh/bindings.js +1 -1
- package/dist/sales/.kosh/schema.d.ts +2 -1
- package/dist/sales/index.js +4 -0
- package/dist/sales/module.d.ts +1 -0
- package/dist/sign/.kosh/bindings.d.ts +22 -0
- package/dist/sign/.kosh/bindings.js +15 -0
- package/dist/sign/.kosh/schema.d.ts +990 -0
- package/dist/sign/index.d.ts +14 -0
- package/dist/sign/index.js +350 -0
- package/dist/sign/module.d.ts +4478 -0
- package/dist/sign/module.js +158 -0
- package/dist/sign/sign.d.ts +82 -0
- package/dist/sign/sign.js +474 -0
- package/dist/stock/.kosh/bindings.js +1 -1
- package/dist/stock/.kosh/schema.d.ts +77 -2
- package/dist/stock/demo.d.ts +2 -1
- package/dist/stock/demo.js +28 -1
- package/dist/stock/index.d.ts +2 -1
- package/dist/stock/index.js +233 -4
- package/dist/stock/module.d.ts +2363 -837
- package/dist/stock/module.js +569 -14
- package/dist/stock/replenish.d.ts +38 -0
- package/dist/stock/replenish.js +176 -0
- package/dist/stock/web/Replenishment.d.ts +8 -0
- package/dist/stock/web/Replenishment.js +84 -0
- package/dist/stock/web/index.d.ts +4 -2
- package/dist/stock/web/index.js +6 -2
- package/dist/stock/web/messages.js +52 -0
- package/dist/stock_account/.kosh/bindings.js +1 -1
- package/dist/stock_account/.kosh/schema.d.ts +198 -5
- package/dist/stock_account/index.js +10 -0
- package/dist/stock_account/module.d.ts +969 -101
- package/dist/trade_finance/index.js +2 -0
- package/dist/trade_finance/module.js +2 -0
- package/dist/trade_finance_account/.kosh/bindings.js +1 -1
- package/dist/trade_finance_account/.kosh/schema.d.ts +123 -4
- package/dist/trade_finance_account/index.js +1 -0
- package/dist/trade_finance_account/module.d.ts +146 -0
- package/dist/trade_finance_account/module.js +1 -0
- package/dist/trade_finance_purchase/.kosh/bindings.js +1 -1
- package/dist/trade_finance_purchase/.kosh/schema.d.ts +97 -4
- package/dist/trade_finance_purchase/module.d.ts +6 -1
- package/dist/trade_finance_sale/.kosh/bindings.js +1 -1
- package/dist/trade_finance_sale/.kosh/schema.d.ts +2 -1
- package/dist/trade_finance_sale/module.d.ts +1 -0
- package/dist/ui/app.js +24 -12
- package/dist/ui/components/AppIcon.js +8 -1
- package/dist/ui/i18n/messages.d.ts +4 -0
- package/dist/ui/i18n/messages.js +8 -0
- package/dist/ui/views/FormView.js +4 -2
- package/dist/ui/views/KanbanView.js +9 -1
- package/dist/ui/views/ListView.js +4 -2
- package/dist/ui/views/widgets.js +7 -1
- package/dist/website/index.js +1 -0
- package/dist/website/module.js +1 -0
- package/dist/website_crm/.kosh/bindings.js +1 -1
- package/dist/website_crm/.kosh/schema.d.ts +2 -1
- package/dist/website_crm/module.d.ts +1 -0
- package/dist/website_sale/.kosh/bindings.d.ts +22 -0
- package/dist/website_sale/.kosh/bindings.js +15 -0
- package/dist/website_sale/.kosh/schema.d.ts +2284 -0
- package/dist/website_sale/couriers.d.ts +50 -0
- package/dist/website_sale/couriers.js +59 -0
- package/dist/website_sale/demo.d.ts +7 -0
- package/dist/website_sale/demo.js +90 -0
- package/dist/website_sale/growth.d.ts +31 -0
- package/dist/website_sale/growth.js +163 -0
- package/dist/website_sale/index.d.ts +49 -0
- package/dist/website_sale/index.js +538 -0
- package/dist/website_sale/module.d.ts +22027 -0
- package/dist/website_sale/module.js +397 -0
- package/dist/website_sale/shipments.d.ts +16 -0
- package/dist/website_sale/shipments.js +113 -0
- package/dist/website_sale/shop.d.ts +81 -0
- package/dist/website_sale/shop.js +649 -0
- package/dist/website_sale_stock/.kosh/bindings.d.ts +22 -0
- package/dist/website_sale_stock/.kosh/bindings.js +15 -0
- package/dist/website_sale_stock/.kosh/schema.d.ts +2681 -0
- package/dist/website_sale_stock/index.d.ts +9 -0
- package/dist/website_sale_stock/index.js +20 -0
- package/dist/website_sale_stock/module.d.ts +24998 -0
- package/dist/website_sale_stock/module.js +28 -0
- package/package.json +83 -2
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data layer of Documents (RFC 0024 §2.8): folders of a company — open to everyone with Documents, or kept to their
|
|
3
|
+
* members —, documents in them with tags and versions (each version a stored file, the latest the current one),
|
|
4
|
+
* share links with an expiry and an optional password (only hashes are kept), and requests: a person is asked for a
|
|
5
|
+
* file by email, with a link that uploads it into the right folder, and reminded once when it is late.
|
|
6
|
+
*/
|
|
7
|
+
import { contactsShutro } from '../contacts/index.js';
|
|
8
|
+
import { messagingShutro } from '../messaging/index.js';
|
|
9
|
+
import { orm } from '../server/orm.js';
|
|
10
|
+
import { check, compute, defineModel, defineModule, f, records, } from './.kosh/bindings.js';
|
|
11
|
+
import { announceRequests } from './documents.js';
|
|
12
|
+
const ALL = ['read', 'write', 'create', 'unlink'];
|
|
13
|
+
const me = { $env: 'uid' };
|
|
14
|
+
export const DocumentsFolder = defineModel('documents.folder', {
|
|
15
|
+
label: 'Folder',
|
|
16
|
+
recName: 'fullName',
|
|
17
|
+
order: ['fullName asc'],
|
|
18
|
+
archivable: true,
|
|
19
|
+
companyScoped: { required: true },
|
|
20
|
+
hierarchy: { parent: 'parent', path: 'parentPath' },
|
|
21
|
+
tracking: ['restricted', 'members'],
|
|
22
|
+
access: { 'documents.user': ['read'], 'documents.manager': [...ALL, 'export'] },
|
|
23
|
+
rules: {
|
|
24
|
+
// A restricted folder is its members' (and its owner's); the others are everyone's with Documents.
|
|
25
|
+
see: {
|
|
26
|
+
groups: ['documents.user'],
|
|
27
|
+
perms: ['read'],
|
|
28
|
+
domain: { or: [{ restricted: false }, { owner: me }, { members: { any: { id: me } } }] },
|
|
29
|
+
},
|
|
30
|
+
all: { groups: ['documents.manager'], perms: [...ALL], domain: {} },
|
|
31
|
+
},
|
|
32
|
+
fields: {
|
|
33
|
+
name: f.char({ required: true, translate: true }),
|
|
34
|
+
parent: f.many2one('documents.folder', { ondelete: 'restrict', label: 'Inside' }),
|
|
35
|
+
parentPath: f.char({ readonly: true, index: true }),
|
|
36
|
+
children: f.one2many('documents.folder', 'parent'),
|
|
37
|
+
fullName: f.char({
|
|
38
|
+
store: true,
|
|
39
|
+
label: 'Folder',
|
|
40
|
+
...compute('documents.folder', 'fullName', ['name', 'parent.name', 'parent.parent.name'], (folders) => {
|
|
41
|
+
for (const x of folders)
|
|
42
|
+
x.fullName = [x.parent?.parent?.name, x.parent?.name, x.name]
|
|
43
|
+
.filter((n) => n !== null && n !== undefined)
|
|
44
|
+
.join(' / ');
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
owner: f.many2one('res.users', { default: (env) => env.userId, label: 'Owner' }),
|
|
48
|
+
/** Kept to its members (and its owner); otherwise everyone with Documents sees it. */
|
|
49
|
+
restricted: f.boolean({ default: false, label: 'Members only' }),
|
|
50
|
+
members: f.many2many('res.users', {
|
|
51
|
+
relation: 'documents_folder_member_rel',
|
|
52
|
+
label: 'Members',
|
|
53
|
+
}),
|
|
54
|
+
documents: f.one2many('documents.document', 'folder'),
|
|
55
|
+
description: f.text(),
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
export const DocumentsTag = defineModel('documents.tag', {
|
|
59
|
+
label: 'Document tag',
|
|
60
|
+
recName: 'name',
|
|
61
|
+
order: ['name asc'],
|
|
62
|
+
archivable: true,
|
|
63
|
+
access: { 'documents.user': ['read', 'create'], 'documents.manager': ALL },
|
|
64
|
+
fields: {
|
|
65
|
+
name: f.char({ required: true, translate: true }),
|
|
66
|
+
color: f.char({ label: 'Colour' }),
|
|
67
|
+
},
|
|
68
|
+
sqlConstraints: { oneName: { unique: ['name'], message: 'Another tag has this name.' } },
|
|
69
|
+
});
|
|
70
|
+
export const DocumentsDocument = defineModel('documents.document', {
|
|
71
|
+
label: 'Document',
|
|
72
|
+
recName: 'name',
|
|
73
|
+
order: ['updatedAt desc', 'id desc'],
|
|
74
|
+
archivable: true,
|
|
75
|
+
companyScoped: { required: true },
|
|
76
|
+
tracking: ['name', 'folder', 'attachment'],
|
|
77
|
+
access: {
|
|
78
|
+
'documents.user': ['read', 'write', 'create'],
|
|
79
|
+
'documents.manager': [...ALL, 'export', 'import'],
|
|
80
|
+
},
|
|
81
|
+
rules: {
|
|
82
|
+
// Read: in a folder they see, or their own; made and changed only in a folder they see.
|
|
83
|
+
see: {
|
|
84
|
+
groups: ['documents.user'],
|
|
85
|
+
perms: ['read'],
|
|
86
|
+
domain: {
|
|
87
|
+
or: [
|
|
88
|
+
{ 'folder.restricted': false },
|
|
89
|
+
{ 'folder.owner': me },
|
|
90
|
+
{ 'folder.members': { any: { id: me } } },
|
|
91
|
+
{ owner: me },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
edit: {
|
|
96
|
+
groups: ['documents.user'],
|
|
97
|
+
perms: ['write', 'create'],
|
|
98
|
+
domain: {
|
|
99
|
+
or: [
|
|
100
|
+
{ 'folder.restricted': false },
|
|
101
|
+
{ 'folder.owner': me },
|
|
102
|
+
{ 'folder.members': { any: { id: me } } },
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
all: { groups: ['documents.manager'], perms: [...ALL], domain: {} },
|
|
107
|
+
},
|
|
108
|
+
fields: {
|
|
109
|
+
name: f.char({ required: true }),
|
|
110
|
+
folder: f.many2one('documents.folder', { required: true, ondelete: 'restrict' }),
|
|
111
|
+
tags: f.many2many('documents.tag', { relation: 'documents_document_tag_rel' }),
|
|
112
|
+
owner: f.many2one('res.users', { default: (env) => env.userId, label: 'Owner' }),
|
|
113
|
+
/** The current version: the latest file uploaded (`POST /api/v1/documents/:id/versions`). */
|
|
114
|
+
attachment: f.many2one('storage.attachment', { ondelete: 'set null', label: 'File' }),
|
|
115
|
+
mime: f.char({ label: 'Type' }),
|
|
116
|
+
size: f.integer({ label: 'Size (bytes)' }),
|
|
117
|
+
versions: f.integer({ required: true, default: 0, label: 'Versions' }),
|
|
118
|
+
/** The record it is about (an employee, an order), when there is one. */
|
|
119
|
+
resModel: f.char({ label: 'About (model)' }),
|
|
120
|
+
resId: f.integer({ label: 'About (record)' }),
|
|
121
|
+
description: f.text(),
|
|
122
|
+
/** The request it answered, when it came from one. */
|
|
123
|
+
request: f.many2one('documents.request', { ondelete: 'set null', label: 'Requested by' }),
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
export const DocumentsShare = defineModel('documents.share', {
|
|
127
|
+
label: 'Share link',
|
|
128
|
+
order: ['id desc'],
|
|
129
|
+
companyScoped: { required: true },
|
|
130
|
+
access: { 'documents.user': ['read', 'create', 'write'], 'documents.manager': ALL },
|
|
131
|
+
rules: {
|
|
132
|
+
mine: {
|
|
133
|
+
groups: ['documents.user'],
|
|
134
|
+
perms: ['read', 'create', 'write'],
|
|
135
|
+
domain: { createdBy: me },
|
|
136
|
+
},
|
|
137
|
+
all: { groups: ['documents.manager'], perms: [...ALL], domain: {} },
|
|
138
|
+
},
|
|
139
|
+
fields: {
|
|
140
|
+
document: f.many2one('documents.document', { ondelete: 'cascade' }),
|
|
141
|
+
folder: f.many2one('documents.folder', { ondelete: 'cascade' }),
|
|
142
|
+
/** The hash of the link's token (the token is shown once, when the link is made). */
|
|
143
|
+
tokenHash: f.char({ required: true, index: 'unique', label: 'Token (hash)' }),
|
|
144
|
+
passwordHash: f.char({ label: 'Password (hash)' }),
|
|
145
|
+
expiresAt: f.datetime({ required: true, label: 'Expires at' }),
|
|
146
|
+
downloads: f.integer({ required: true, default: 0 }),
|
|
147
|
+
revoked: f.boolean({ default: false }),
|
|
148
|
+
},
|
|
149
|
+
constraints: {
|
|
150
|
+
oneTarget: {
|
|
151
|
+
...check('documents.share', ['document', 'folder'], async (shares) => (await shares.load({ document: true, folder: true }))
|
|
152
|
+
.filter((s) => (s.document === null) === (s.folder === null))
|
|
153
|
+
.map((s) => s.id)),
|
|
154
|
+
message: 'A link shares a document or a folder.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
export const DocumentsRequest = defineModel('documents.request', {
|
|
159
|
+
label: 'Document request',
|
|
160
|
+
recName: 'name',
|
|
161
|
+
order: ['id desc'],
|
|
162
|
+
companyScoped: { required: true },
|
|
163
|
+
tracking: ['state', 'dueDate'],
|
|
164
|
+
access: { 'documents.user': ['read', 'write', 'create'], 'documents.manager': ALL },
|
|
165
|
+
fields: {
|
|
166
|
+
/** What is asked for: "Your NID card", "The signed contract". */
|
|
167
|
+
name: f.char({ required: true, label: 'What is asked for' }),
|
|
168
|
+
folder: f.many2one('documents.folder', { required: true, ondelete: 'restrict', label: 'Into' }),
|
|
169
|
+
partner: f.many2one('res.partner', { ondelete: 'set null', label: 'From' }),
|
|
170
|
+
email: f.char({ required: true }),
|
|
171
|
+
message: f.text(),
|
|
172
|
+
dueDate: f.date({ label: 'Due' }),
|
|
173
|
+
/** The hash of the upload link's token (sent by email, never kept). */
|
|
174
|
+
tokenHash: f.char({ index: true, label: 'Token (hash)' }),
|
|
175
|
+
sentAt: f.datetime({ label: 'Sent at' }),
|
|
176
|
+
remindedAt: f.datetime({ label: 'Reminded at' }),
|
|
177
|
+
document: f.many2one('documents.document', { ondelete: 'set null', label: 'Received' }),
|
|
178
|
+
state: f.state({
|
|
179
|
+
states: { draft: 'Draft', sent: 'Sent', received: 'Received', cancel: 'Cancelled' },
|
|
180
|
+
initial: 'draft',
|
|
181
|
+
transitions: {
|
|
182
|
+
/** Emails the person a link that uploads the file into the folder. */
|
|
183
|
+
send: {
|
|
184
|
+
from: ['draft'],
|
|
185
|
+
to: 'sent',
|
|
186
|
+
before: records('documents.request', async (requests) => {
|
|
187
|
+
await announceRequests(requests.env, requests.ids);
|
|
188
|
+
}),
|
|
189
|
+
},
|
|
190
|
+
receive: { from: ['sent'], to: 'received' },
|
|
191
|
+
cancel: { from: ['draft', 'sent'], to: 'cancel' },
|
|
192
|
+
redraft: { from: ['cancel'], to: 'draft' },
|
|
193
|
+
},
|
|
194
|
+
}),
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
export const documentsShutro = defineModule({
|
|
198
|
+
name: 'documents',
|
|
199
|
+
version: '0.1.0',
|
|
200
|
+
depends: [contactsShutro, messagingShutro],
|
|
201
|
+
groups: [
|
|
202
|
+
orm.defineGroup({
|
|
203
|
+
code: 'documents.user',
|
|
204
|
+
label: 'Documents user',
|
|
205
|
+
implies: ['contacts.user'],
|
|
206
|
+
}),
|
|
207
|
+
orm.defineGroup({
|
|
208
|
+
code: 'documents.manager',
|
|
209
|
+
label: 'Documents manager',
|
|
210
|
+
implies: ['documents.user'],
|
|
211
|
+
}),
|
|
212
|
+
],
|
|
213
|
+
models: [DocumentsFolder, DocumentsTag, DocumentsDocument, DocumentsShare, DocumentsRequest],
|
|
214
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The versions of a document on its form (RFC 0024 §2.8): each upload a new version, the latest the current one;
|
|
3
|
+
* every version can be downloaded. The server stores the file and keeps the count; this only shows and sends it.
|
|
4
|
+
*/
|
|
5
|
+
import { type NodeComponentProps } from '../../ui/index.js';
|
|
6
|
+
import { type ReactElement } from 'react';
|
|
7
|
+
export declare function Versions({ record, api }: NodeComponentProps): ReactElement | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The versions of a document on its form (RFC 0024 §2.8): each upload a new version, the latest the current one;
|
|
4
|
+
* every version can be downloaded. The server stores the file and keeps the count; this only shows and sends it.
|
|
5
|
+
*/
|
|
6
|
+
import { Alert, Button, useKosh } from '../../ui/index.js';
|
|
7
|
+
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
8
|
+
import { useId, useRef } from 'react';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
export function Versions({ record, api }) {
|
|
11
|
+
const { t } = useTranslation('documents');
|
|
12
|
+
const { format } = useKosh();
|
|
13
|
+
const id = useId();
|
|
14
|
+
const input = useRef(null);
|
|
15
|
+
const doc = typeof record?.['id'] === 'number' ? record['id'] : null;
|
|
16
|
+
const versions = useQuery({
|
|
17
|
+
queryKey: ['documents', 'versions', doc],
|
|
18
|
+
queryFn: () => api.call('GET', `/api/v1/documents/${String(doc)}/versions`),
|
|
19
|
+
enabled: doc !== null,
|
|
20
|
+
});
|
|
21
|
+
const upload = useMutation({
|
|
22
|
+
mutationFn: (file) => api.upload(`/api/v1/documents/${String(doc)}/versions`, file, file.name),
|
|
23
|
+
onSuccess: async () => {
|
|
24
|
+
if (input.current !== null)
|
|
25
|
+
input.current.value = '';
|
|
26
|
+
await versions.refetch();
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
if (doc === null)
|
|
30
|
+
return _jsx("p", { className: "text-sm text-muted-foreground", children: t('saveFirst') });
|
|
31
|
+
const rows = versions.data?.versions ?? [];
|
|
32
|
+
return (_jsxs("section", { "aria-labelledby": `${id}-title`, className: "col-span-full grid gap-2", children: [_jsx("h3", { id: `${id}-title`, className: "text-sm font-semibold", children: t('versions') }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("input", { ref: input, id: `${id}-file`, type: "file", "aria-label": t('newVersion'), className: "text-sm", onChange: (e) => {
|
|
33
|
+
const file = e.target.files?.[0];
|
|
34
|
+
if (file !== undefined)
|
|
35
|
+
upload.mutate(file);
|
|
36
|
+
} }), upload.isPending ? _jsx("span", { className: "text-sm", children: t('uploading') }) : null] }), upload.error === null ? null : _jsx(Alert, { tone: "danger", children: upload.error.message }), rows.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: t('noVersion') })) : (_jsx("ul", { className: "grid gap-1 text-sm", children: rows.map((v, i) => (_jsxs("li", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "font-medium", children: t('version', { n: rows.length - i }) }), _jsx("span", { children: v.name }), _jsxs("span", { className: "text-muted-foreground", children: [format.decimal(String(Math.ceil(v.size / 1024))), " KB \u00B7 ", format.date(v.at)] }), _jsx(Button, { variant: "secondary", onClick: async () => {
|
|
37
|
+
const { blob, filename } = await api.download(`/api/v1/attachments/${v.id}/download`, undefined, 'GET');
|
|
38
|
+
const url = URL.createObjectURL(blob);
|
|
39
|
+
const a = document.createElement('a');
|
|
40
|
+
a.href = url;
|
|
41
|
+
a.download = filename;
|
|
42
|
+
a.click();
|
|
43
|
+
URL.revokeObjectURL(url);
|
|
44
|
+
}, children: t('download') })] }, v.id))) }))] }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* The web contribution of `shutro-erp/documents`: the versions panel of a document's form.
|
|
4
|
+
*/
|
|
5
|
+
import { type Registry } from '../../ui/index.js';
|
|
6
|
+
import type { i18n } from 'i18next';
|
|
7
|
+
import { messages } from './messages.js';
|
|
8
|
+
export { Versions } from './Versions.js';
|
|
9
|
+
/** Registers the component (and the messages in `i18n`, when given). */
|
|
10
|
+
export declare function registerDocumentsWeb(registry: Registry, i18n?: i18n): Registry;
|
|
11
|
+
export { messages as documentsMessages };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* The web contribution of `shutro-erp/documents`: the versions panel of a document's form.
|
|
4
|
+
*/
|
|
5
|
+
import { addMessages } from '../../ui/index.js';
|
|
6
|
+
import { messages } from './messages.js';
|
|
7
|
+
import { Versions } from './Versions.js';
|
|
8
|
+
export { Versions } from './Versions.js';
|
|
9
|
+
/** Registers the component (and the messages in `i18n`, when given). */
|
|
10
|
+
export function registerDocumentsWeb(registry, i18n) {
|
|
11
|
+
registry.registerComponent('documents.Versions', Versions);
|
|
12
|
+
if (i18n !== undefined)
|
|
13
|
+
addMessages(i18n, 'documents', messages);
|
|
14
|
+
return registry;
|
|
15
|
+
}
|
|
16
|
+
export { messages as documentsMessages };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Messages of the Documents screens (namespace `documents`), in English and Bangla. */
|
|
2
|
+
export const messages = {
|
|
3
|
+
en: {
|
|
4
|
+
versions: 'Versions',
|
|
5
|
+
newVersion: 'Upload a new version',
|
|
6
|
+
uploading: 'Uploading…',
|
|
7
|
+
noVersion: 'No file yet: upload the first version.',
|
|
8
|
+
version: 'Version {{n}}',
|
|
9
|
+
download: 'Download',
|
|
10
|
+
saveFirst: 'Save the document, then upload its file.',
|
|
11
|
+
},
|
|
12
|
+
bn: {
|
|
13
|
+
versions: 'সংস্করণ',
|
|
14
|
+
newVersion: 'নতুন সংস্করণ আপলোড করুন',
|
|
15
|
+
uploading: 'আপলোড হচ্ছে…',
|
|
16
|
+
noVersion: 'এখনো কোনো ফাইল নেই: প্রথম সংস্করণ আপলোড করুন।',
|
|
17
|
+
version: 'সংস্করণ {{n}}',
|
|
18
|
+
download: 'ডাউনলোড',
|
|
19
|
+
saveFirst: 'আগে নথিটি সংরক্ষণ করুন, তারপর ফাইল আপলোড করুন।',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -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: 0f41dee2e33036c2
|
|
2
2
|
// Bindings of module `event_account`: 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,10 +1,11 @@
|
|
|
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: 0f41dee2e33036c2
|
|
2
2
|
// Schema view of module `event_account` (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
|
|
|
5
5
|
/** Model name → model type (RFC 0002 §7.7). */
|
|
6
6
|
export interface SchemaView {
|
|
7
7
|
readonly 'account.account': AccountAccount;
|
|
8
|
+
readonly 'account.analytic': AccountAnalytic;
|
|
8
9
|
readonly 'account.fiscal.year': AccountFiscalYear;
|
|
9
10
|
readonly 'account.full.reconcile': AccountFullReconcile;
|
|
10
11
|
readonly 'account.journal': AccountJournal;
|
|
@@ -18,9 +19,12 @@ export interface SchemaView {
|
|
|
18
19
|
readonly 'account.tax': AccountTax;
|
|
19
20
|
readonly 'account.tax.component': AccountTaxComponent;
|
|
20
21
|
readonly 'account.withholding': AccountWithholding;
|
|
22
|
+
readonly 'approval.delegation': ApprovalDelegation;
|
|
21
23
|
readonly 'approval.level': ApprovalLevel;
|
|
24
|
+
readonly 'approval.link': ApprovalLink;
|
|
22
25
|
readonly 'approval.policy': ApprovalPolicy;
|
|
23
26
|
readonly 'approval.request': ApprovalRequest;
|
|
27
|
+
readonly 'approval.vote': ApprovalVote;
|
|
24
28
|
readonly 'audit.event': AuditEvent;
|
|
25
29
|
readonly 'auth.api_key': AuthApiKey;
|
|
26
30
|
readonly 'auth.credential': AuthCredential;
|
|
@@ -90,6 +94,30 @@ export interface AccountAccount {
|
|
|
90
94
|
export interface AccountAccountMethods extends F.Methods<typeof import('../../accounting/index.js').accountingShutro, 'account.account'> {
|
|
91
95
|
}
|
|
92
96
|
|
|
97
|
+
/** `account.analytic` (owner: accounting). */
|
|
98
|
+
export interface AccountAnalytic {
|
|
99
|
+
readonly name: 'account.analytic';
|
|
100
|
+
readonly fields: {
|
|
101
|
+
readonly id: F.Id<'account.analytic'>;
|
|
102
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
103
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
104
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
105
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
106
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
107
|
+
readonly active: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
108
|
+
readonly company: F.Many2one<'res.company', { readonly required: true; readonly default: true }>;
|
|
109
|
+
readonly code: F.Char;
|
|
110
|
+
readonly name: F.Char<{ readonly required: true; readonly translate: true }>;
|
|
111
|
+
readonly parent: F.Many2one<'account.analytic'>;
|
|
112
|
+
readonly note: F.Text;
|
|
113
|
+
};
|
|
114
|
+
readonly methods: AccountAnalyticMethods;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Methods of `account.analytic`: declared ones and transitions. */
|
|
118
|
+
export interface AccountAnalyticMethods extends F.Methods<typeof import('../../accounting/index.js').accountingShutro, 'account.analytic'> {
|
|
119
|
+
}
|
|
120
|
+
|
|
93
121
|
/** `account.fiscal.year` (owner: accounting). */
|
|
94
122
|
export interface AccountFiscalYear {
|
|
95
123
|
readonly name: 'account.fiscal.year';
|
|
@@ -245,6 +273,7 @@ export interface AccountMoveLine {
|
|
|
245
273
|
readonly lineKind: F.Selection<'entry' | 'product' | 'tax' | 'counterpart', { readonly required: true; readonly default: true }>;
|
|
246
274
|
readonly invoice: F.Many2one<'account.move', { readonly readonly: true; readonly compute: true; readonly store: true }>;
|
|
247
275
|
readonly product: F.Many2one<'product.product'>;
|
|
276
|
+
readonly analytic: F.Many2one<'account.analytic'>;
|
|
248
277
|
readonly quantity: F.Decimal<{ readonly default: true }>;
|
|
249
278
|
readonly priceUnit: F.Decimal<{ readonly default: true }>;
|
|
250
279
|
readonly discount: F.Decimal<{ readonly default: true }>;
|
|
@@ -486,6 +515,29 @@ export interface AccountWithholding {
|
|
|
486
515
|
export interface AccountWithholdingMethods extends F.Methods<typeof import('../../accounting/index.js').accountingShutro, 'account.withholding'> {
|
|
487
516
|
}
|
|
488
517
|
|
|
518
|
+
/** `approval.delegation` (owner: permissions). */
|
|
519
|
+
export interface ApprovalDelegation {
|
|
520
|
+
readonly name: 'approval.delegation';
|
|
521
|
+
readonly fields: {
|
|
522
|
+
readonly id: F.Id<'approval.delegation'>;
|
|
523
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
524
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
525
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
526
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
527
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
528
|
+
readonly user: F.Many2one<'res.users', { readonly required: true; readonly default: true }>;
|
|
529
|
+
readonly delegate: F.Many2one<'res.users', { readonly required: true }>;
|
|
530
|
+
readonly dateFrom: F.DateOnly<{ readonly required: true }>;
|
|
531
|
+
readonly dateTo: F.DateOnly<{ readonly required: true }>;
|
|
532
|
+
readonly note: F.Char;
|
|
533
|
+
};
|
|
534
|
+
readonly methods: ApprovalDelegationMethods;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/** Methods of `approval.delegation`: declared ones and transitions. */
|
|
538
|
+
export interface ApprovalDelegationMethods extends F.Methods<typeof import('../../permissions/index.js').permissionsShutro, 'approval.delegation'> {
|
|
539
|
+
}
|
|
540
|
+
|
|
489
541
|
/** `approval.level` (owner: permissions). */
|
|
490
542
|
export interface ApprovalLevel {
|
|
491
543
|
readonly name: 'approval.level';
|
|
@@ -500,7 +552,14 @@ export interface ApprovalLevel {
|
|
|
500
552
|
readonly sequence: F.Integer<{ readonly default: true }>;
|
|
501
553
|
readonly name: F.Char<{ readonly required: true }>;
|
|
502
554
|
readonly condition: F.Json;
|
|
503
|
-
readonly
|
|
555
|
+
readonly approverKind: F.Selection<'role' | 'users' | 'manager' | 'field', { readonly required: true; readonly default: true }>;
|
|
556
|
+
readonly approverRole: F.Char;
|
|
557
|
+
readonly approverUsers: F.Many2many<'res.users', { readonly required: true }>;
|
|
558
|
+
readonly approverField: F.Char;
|
|
559
|
+
readonly quorum: F.Selection<'any' | 'all' | 'count', { readonly required: true; readonly default: true }>;
|
|
560
|
+
readonly quorumCount: F.Integer;
|
|
561
|
+
readonly deadlineHours: F.Integer;
|
|
562
|
+
readonly escalateRole: F.Char;
|
|
504
563
|
};
|
|
505
564
|
readonly methods: ApprovalLevelMethods;
|
|
506
565
|
}
|
|
@@ -509,6 +568,29 @@ export interface ApprovalLevel {
|
|
|
509
568
|
export interface ApprovalLevelMethods extends F.Methods<typeof import('../../permissions/index.js').permissionsShutro, 'approval.level'> {
|
|
510
569
|
}
|
|
511
570
|
|
|
571
|
+
/** `approval.link` (owner: permissions). */
|
|
572
|
+
export interface ApprovalLink {
|
|
573
|
+
readonly name: 'approval.link';
|
|
574
|
+
readonly fields: {
|
|
575
|
+
readonly id: F.Id<'approval.link'>;
|
|
576
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
577
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
578
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
579
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
580
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
581
|
+
readonly request: F.Many2one<'approval.request', { readonly required: true }>;
|
|
582
|
+
readonly user: F.Many2one<'res.users', { readonly required: true }>;
|
|
583
|
+
readonly tokenHash: F.Char<{ readonly required: true }>;
|
|
584
|
+
readonly expiresAt: F.Datetime<{ readonly required: true }>;
|
|
585
|
+
readonly usedAt: F.Datetime;
|
|
586
|
+
};
|
|
587
|
+
readonly methods: ApprovalLinkMethods;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/** Methods of `approval.link`: declared ones and transitions. */
|
|
591
|
+
export interface ApprovalLinkMethods extends F.Methods<typeof import('../../permissions/index.js').permissionsShutro, 'approval.link'> {
|
|
592
|
+
}
|
|
593
|
+
|
|
512
594
|
/** `approval.policy` (owner: permissions). */
|
|
513
595
|
export interface ApprovalPolicy {
|
|
514
596
|
readonly name: 'approval.policy';
|
|
@@ -526,6 +608,9 @@ export interface ApprovalPolicy {
|
|
|
526
608
|
readonly company: F.Many2one<'res.company'>;
|
|
527
609
|
readonly onApproved: F.Char;
|
|
528
610
|
readonly onRejected: F.Char;
|
|
611
|
+
readonly onSentBack: F.Char;
|
|
612
|
+
readonly onWithdrawn: F.Char;
|
|
613
|
+
readonly reasonRequired: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
529
614
|
readonly levels: F.One2many<'approval.level', { readonly required: true }>;
|
|
530
615
|
};
|
|
531
616
|
readonly methods: ApprovalPolicyMethods;
|
|
@@ -552,8 +637,16 @@ export interface ApprovalRequest {
|
|
|
552
637
|
readonly targetModel: F.Char<{ readonly required: true }>;
|
|
553
638
|
readonly targetId: F.Integer<{ readonly required: true }>;
|
|
554
639
|
readonly company: F.Many2one<'res.company'>;
|
|
555
|
-
readonly approverRole: F.Char
|
|
556
|
-
readonly
|
|
640
|
+
readonly approverRole: F.Char;
|
|
641
|
+
readonly approvers: F.Many2many<'res.users', { readonly required: true }>;
|
|
642
|
+
readonly required: F.Integer<{ readonly required: true; readonly default: true }>;
|
|
643
|
+
readonly round: F.Integer<{ readonly required: true; readonly default: true }>;
|
|
644
|
+
readonly votes: F.One2many<'approval.vote', { readonly required: true }>;
|
|
645
|
+
readonly dueAt: F.Datetime;
|
|
646
|
+
readonly remindedAt: F.Datetime;
|
|
647
|
+
readonly escalatedTo: F.Char;
|
|
648
|
+
readonly escalatedAt: F.Datetime;
|
|
649
|
+
readonly state: F.Selection<'pending' | 'approved' | 'rejected' | 'sent_back' | 'cancelled', { readonly required: true; readonly default: true }>;
|
|
557
650
|
readonly requestedBy: F.Many2one<'res.users'>;
|
|
558
651
|
readonly decidedBy: F.Many2one<'res.users'>;
|
|
559
652
|
readonly decidedAt: F.Datetime;
|
|
@@ -566,6 +659,31 @@ export interface ApprovalRequest {
|
|
|
566
659
|
export interface ApprovalRequestMethods extends F.Methods<typeof import('../../permissions/index.js').permissionsShutro, 'approval.request'> {
|
|
567
660
|
}
|
|
568
661
|
|
|
662
|
+
/** `approval.vote` (owner: permissions). */
|
|
663
|
+
export interface ApprovalVote {
|
|
664
|
+
readonly name: 'approval.vote';
|
|
665
|
+
readonly fields: {
|
|
666
|
+
readonly id: F.Id<'approval.vote'>;
|
|
667
|
+
readonly createdAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
668
|
+
readonly updatedAt: F.Datetime<{ readonly required: true; readonly readonly: true }>;
|
|
669
|
+
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
670
|
+
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
671
|
+
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
672
|
+
readonly request: F.Many2one<'approval.request', { readonly required: true }>;
|
|
673
|
+
readonly user: F.Many2one<'res.users', { readonly required: true }>;
|
|
674
|
+
readonly decision: F.Selection<'approve' | 'reject' | 'send_back', { readonly required: true }>;
|
|
675
|
+
readonly comment: F.Text;
|
|
676
|
+
readonly at: F.Datetime<{ readonly required: true }>;
|
|
677
|
+
readonly onBehalfOf: F.Many2one<'res.users'>;
|
|
678
|
+
readonly ip: F.Char;
|
|
679
|
+
};
|
|
680
|
+
readonly methods: ApprovalVoteMethods;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/** Methods of `approval.vote`: declared ones and transitions. */
|
|
684
|
+
export interface ApprovalVoteMethods extends F.Methods<typeof import('../../permissions/index.js').permissionsShutro, 'approval.vote'> {
|
|
685
|
+
}
|
|
686
|
+
|
|
569
687
|
/** `audit.event` (owner: base). */
|
|
570
688
|
export interface AuditEvent {
|
|
571
689
|
readonly name: 'audit.event';
|
|
@@ -1215,6 +1333,7 @@ export interface ProductCategory {
|
|
|
1215
1333
|
readonly createdBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
1216
1334
|
readonly updatedBy: F.Many2one<'res.users', { readonly readonly: true }>;
|
|
1217
1335
|
readonly displayName: F.Char<{ readonly required: true; readonly readonly: true; readonly compute: true }>;
|
|
1336
|
+
readonly active: F.Bool<{ readonly required: true; readonly default: true }>;
|
|
1218
1337
|
readonly name: F.Char<{ readonly required: true; readonly translate: true }>;
|
|
1219
1338
|
readonly parent: F.Many2one<'product.category'>;
|
|
1220
1339
|
};
|