shutro-erp 0.3.4 → 0.3.5

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