You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

441 lines
13 KiB

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
  7. <title>SQL Request Abstract</title>
  8. <style type="text/css">
  9. /*
  10. :Author: David Goodger (goodger@python.org)
  11. :Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $
  12. :Copyright: This stylesheet has been placed in the public domain.
  13. Default cascading style sheet for the HTML output of Docutils.
  14. See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
  15. customize this style sheet.
  16. */
  17. /* used to remove borders from tables and images */
  18. .borderless, table.borderless td, table.borderless th {
  19. border: 0 }
  20. table.borderless td, table.borderless th {
  21. /* Override padding for "table.docutils td" with "! important".
  22. The right padding separates the table cells. */
  23. padding: 0 0.5em 0 0 ! important }
  24. .first {
  25. /* Override more specific margin styles with "! important". */
  26. margin-top: 0 ! important }
  27. .last, .with-subtitle {
  28. margin-bottom: 0 ! important }
  29. .hidden {
  30. display: none }
  31. a.toc-backref {
  32. text-decoration: none ;
  33. color: black }
  34. blockquote.epigraph {
  35. margin: 2em 5em ; }
  36. dl.docutils dd {
  37. margin-bottom: 0.5em }
  38. object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
  39. overflow: hidden;
  40. }
  41. /* Uncomment (and remove this text!) to get bold-faced definition list terms
  42. dl.docutils dt {
  43. font-weight: bold }
  44. */
  45. div.abstract {
  46. margin: 2em 5em }
  47. div.abstract p.topic-title {
  48. font-weight: bold ;
  49. text-align: center }
  50. div.admonition, div.attention, div.caution, div.danger, div.error,
  51. div.hint, div.important, div.note, div.tip, div.warning {
  52. margin: 2em ;
  53. border: medium outset ;
  54. padding: 1em }
  55. div.admonition p.admonition-title, div.hint p.admonition-title,
  56. div.important p.admonition-title, div.note p.admonition-title,
  57. div.tip p.admonition-title {
  58. font-weight: bold ;
  59. font-family: sans-serif }
  60. div.attention p.admonition-title, div.caution p.admonition-title,
  61. div.danger p.admonition-title, div.error p.admonition-title,
  62. div.warning p.admonition-title, .code .error {
  63. color: red ;
  64. font-weight: bold ;
  65. font-family: sans-serif }
  66. /* Uncomment (and remove this text!) to get reduced vertical space in
  67. compound paragraphs.
  68. div.compound .compound-first, div.compound .compound-middle {
  69. margin-bottom: 0.5em }
  70. div.compound .compound-last, div.compound .compound-middle {
  71. margin-top: 0.5em }
  72. */
  73. div.dedication {
  74. margin: 2em 5em ;
  75. text-align: center ;
  76. font-style: italic }
  77. div.dedication p.topic-title {
  78. font-weight: bold ;
  79. font-style: normal }
  80. div.figure {
  81. margin-left: 2em ;
  82. margin-right: 2em }
  83. div.footer, div.header {
  84. clear: both;
  85. font-size: smaller }
  86. div.line-block {
  87. display: block ;
  88. margin-top: 1em ;
  89. margin-bottom: 1em }
  90. div.line-block div.line-block {
  91. margin-top: 0 ;
  92. margin-bottom: 0 ;
  93. margin-left: 1.5em }
  94. div.sidebar {
  95. margin: 0 0 0.5em 1em ;
  96. border: medium outset ;
  97. padding: 1em ;
  98. background-color: #ffffee ;
  99. width: 40% ;
  100. float: right ;
  101. clear: right }
  102. div.sidebar p.rubric {
  103. font-family: sans-serif ;
  104. font-size: medium }
  105. div.system-messages {
  106. margin: 5em }
  107. div.system-messages h1 {
  108. color: red }
  109. div.system-message {
  110. border: medium outset ;
  111. padding: 1em }
  112. div.system-message p.system-message-title {
  113. color: red ;
  114. font-weight: bold }
  115. div.topic {
  116. margin: 2em }
  117. h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
  118. h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  119. margin-top: 0.4em }
  120. h1.title {
  121. text-align: center }
  122. h2.subtitle {
  123. text-align: center }
  124. hr.docutils {
  125. width: 75% }
  126. img.align-left, .figure.align-left, object.align-left {
  127. clear: left ;
  128. float: left ;
  129. margin-right: 1em }
  130. img.align-right, .figure.align-right, object.align-right {
  131. clear: right ;
  132. float: right ;
  133. margin-left: 1em }
  134. img.align-center, .figure.align-center, object.align-center {
  135. display: block;
  136. margin-left: auto;
  137. margin-right: auto;
  138. }
  139. .align-left {
  140. text-align: left }
  141. .align-center {
  142. clear: both ;
  143. text-align: center }
  144. .align-right {
  145. text-align: right }
  146. /* reset inner alignment in figures */
  147. div.align-right {
  148. text-align: inherit }
  149. /* div.align-center * { */
  150. /* text-align: left } */
  151. ol.simple, ul.simple {
  152. margin-bottom: 1em }
  153. ol.arabic {
  154. list-style: decimal }
  155. ol.loweralpha {
  156. list-style: lower-alpha }
  157. ol.upperalpha {
  158. list-style: upper-alpha }
  159. ol.lowerroman {
  160. list-style: lower-roman }
  161. ol.upperroman {
  162. list-style: upper-roman }
  163. p.attribution {
  164. text-align: right ;
  165. margin-left: 50% }
  166. p.caption {
  167. font-style: italic }
  168. p.credits {
  169. font-style: italic ;
  170. font-size: smaller }
  171. p.label {
  172. white-space: nowrap }
  173. p.rubric {
  174. font-weight: bold ;
  175. font-size: larger ;
  176. color: maroon ;
  177. text-align: center }
  178. p.sidebar-title {
  179. font-family: sans-serif ;
  180. font-weight: bold ;
  181. font-size: larger }
  182. p.sidebar-subtitle {
  183. font-family: sans-serif ;
  184. font-weight: bold }
  185. p.topic-title {
  186. font-weight: bold }
  187. pre.address {
  188. margin-bottom: 0 ;
  189. margin-top: 0 ;
  190. font: inherit }
  191. pre.literal-block, pre.doctest-block, pre.math, pre.code {
  192. margin-left: 2em ;
  193. margin-right: 2em }
  194. pre.code .ln { color: grey; } /* line numbers */
  195. pre.code, code { background-color: #eeeeee }
  196. pre.code .comment, code .comment { color: #5C6576 }
  197. pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
  198. pre.code .literal.string, code .literal.string { color: #0C5404 }
  199. pre.code .name.builtin, code .name.builtin { color: #352B84 }
  200. pre.code .deleted, code .deleted { background-color: #DEB0A1}
  201. pre.code .inserted, code .inserted { background-color: #A3D289}
  202. span.classifier {
  203. font-family: sans-serif ;
  204. font-style: oblique }
  205. span.classifier-delimiter {
  206. font-family: sans-serif ;
  207. font-weight: bold }
  208. span.interpreted {
  209. font-family: sans-serif }
  210. span.option {
  211. white-space: nowrap }
  212. span.pre {
  213. white-space: pre }
  214. span.problematic {
  215. color: red }
  216. span.section-subtitle {
  217. /* font-size relative to parent (h1..h6 element) */
  218. font-size: 80% }
  219. table.citation {
  220. border-left: solid 1px gray;
  221. margin-left: 1px }
  222. table.docinfo {
  223. margin: 2em 4em }
  224. table.docutils {
  225. margin-top: 0.5em ;
  226. margin-bottom: 0.5em }
  227. table.footnote {
  228. border-left: solid 1px black;
  229. margin-left: 1px }
  230. table.docutils td, table.docutils th,
  231. table.docinfo td, table.docinfo th {
  232. padding-left: 0.5em ;
  233. padding-right: 0.5em ;
  234. vertical-align: top }
  235. table.docutils th.field-name, table.docinfo th.docinfo-name {
  236. font-weight: bold ;
  237. text-align: left ;
  238. white-space: nowrap ;
  239. padding-left: 0 }
  240. /* "booktabs" style (no vertical lines) */
  241. table.docutils.booktabs {
  242. border: 0px;
  243. border-top: 2px solid;
  244. border-bottom: 2px solid;
  245. border-collapse: collapse;
  246. }
  247. table.docutils.booktabs * {
  248. border: 0px;
  249. }
  250. table.docutils.booktabs th {
  251. border-bottom: thin solid;
  252. text-align: left;
  253. }
  254. h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
  255. h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  256. font-size: 100% }
  257. ul.auto-toc {
  258. list-style-type: none }
  259. </style>
  260. </head>
  261. <body>
  262. <div class="document" id="sql-request-abstract">
  263. <h1 class="title">SQL Request Abstract</h1>
  264. <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  265. !! This file is generated by oca-gen-addon-readme !!
  266. !! changes will be overwritten. !!
  267. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
  268. <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-tools/tree/12.0/sql_request_abstract"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-sql_request_abstract"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/149/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
  269. <p>This module provides an abstract model to manage SQL Select requests on database.
  270. It is not usefull for itself. You can see an exemple of implementation in the
  271. ‘sql_export’ module. (same repository).</p>
  272. <div class="section" id="implemented-features">
  273. <h1>Implemented features</h1>
  274. <ul>
  275. <li><dl class="first docutils">
  276. <dt>Add some restrictions in the sql request:</dt>
  277. <dd><ul class="first last simple">
  278. <li>you can only read datas. No update, deletion or creation are possible.</li>
  279. <li>some tables are not allowed, because they could contains clear password
  280. or keys. For the time being (‘ir_config_parameter’).</li>
  281. </ul>
  282. </dd>
  283. </dl>
  284. </li>
  285. <li><p class="first">The request can be in a ‘draft’ or a ‘SQL Valid’ status. To be valid,
  286. the request has to be cleaned, checked and tested. All of this operations
  287. can be disabled in the inherited modules.</p>
  288. </li>
  289. <li><dl class="first docutils">
  290. <dt>This module two new groups:</dt>
  291. <dd><ul class="first last simple">
  292. <li>SQL Request / User : Can see all the sql requests by default and execute
  293. them, if they are valid.</li>
  294. <li>SQL Request / Manager : has full access on sql requests.</li>
  295. </ul>
  296. </dd>
  297. </dl>
  298. </li>
  299. </ul>
  300. <p><strong>Table of contents</strong></p>
  301. <div class="contents local topic" id="contents">
  302. <ul class="simple">
  303. <li><a class="reference internal" href="#usage" id="id1">Usage</a></li>
  304. <li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
  305. <li><a class="reference internal" href="#credits" id="id3">Credits</a></li>
  306. </ul>
  307. </div>
  308. <div class="section" id="usage">
  309. <h2><a class="toc-backref" href="#id1">Usage</a></h2>
  310. <p>Inherit the model:</p>
  311. <blockquote>
  312. <p>from openerp import models</p>
  313. <dl class="docutils">
  314. <dt>class MyModel(models.model)</dt>
  315. <dd><p class="first">_name = ‘my.model’
  316. _inherit = [‘sql.request.mixin’]</p>
  317. <p>_sql_request_groups_relation = ‘my_model_groups_rel’</p>
  318. <p class="last">_sql_request_users_relation = ‘my_model_users_rel’</p>
  319. </dd>
  320. </dl>
  321. </blockquote>
  322. </div>
  323. <div class="section" id="bug-tracker">
  324. <h2><a class="toc-backref" href="#id2">Bug Tracker</a></h2>
  325. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>.
  326. In case of trouble, please check there if your issue has already been reported.
  327. If you spotted it first, help us smashing it by providing a detailed and welcomed
  328. <a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20sql_request_abstract%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
  329. <p>Do not contact contributors directly about support or help with technical issues.</p>
  330. </div>
  331. <div class="section" id="credits">
  332. <h2><a class="toc-backref" href="#id3">Credits</a></h2>
  333. </div>
  334. </div>
  335. <div class="section" id="authors">
  336. <h1>Authors</h1>
  337. <ul class="simple">
  338. <li>GRAP</li>
  339. <li>Akretion</li>
  340. </ul>
  341. </div>
  342. <div class="section" id="contributors">
  343. <h1>Contributors</h1>
  344. <ul class="simple">
  345. <li>Florian da Costa &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</li>
  346. <li>Sylvain LE GAL (<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>)</li>
  347. </ul>
  348. </div>
  349. <div class="section" id="maintainers">
  350. <h1>Maintainers</h1>
  351. <p>This module is maintained by the OCA.</p>
  352. <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
  353. <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
  354. mission is to support the collaborative development of Odoo features and
  355. promote its widespread use.</p>
  356. <p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/12.0/sql_request_abstract">OCA/server-tools</a> project on GitHub.</p>
  357. <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
  358. </div>
  359. </div>
  360. </body>
  361. </html>