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.

391 lines
9.6 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.11: http://docutils.sourceforge.net/" />
  7. <title>Add new options for many2one field</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="add-new-options-for-many2one-field">
  263. <h1 class="title">Add new options for many2one field</h1>
  264. <div class="section" id="description">
  265. <h1>Description</h1>
  266. <p>This modules modifies &quot;many2one&quot; form fields so as to add some new display
  267. control options.</p>
  268. <p>** New: support many2manytags widget ! **</p>
  269. <p>Options provided includes possibility to remove &quot;Create...&quot; and/or &quot;Create and
  270. Edit...&quot; entries from many2one drop down. You can also change default number of
  271. proposition appearing in the drop-down. Or prevent the dialog box poping in
  272. case of validation error.</p>
  273. <p>If not specified, the module will avoid proposing any of the create options
  274. if the current user have no permission rights to create the related object.</p>
  275. </div>
  276. <div class="section" id="requirements">
  277. <h1>Requirements</h1>
  278. <p>Was tested on openerp v7.0</p>
  279. </div>
  280. <div class="section" id="new-option">
  281. <h1>New option</h1>
  282. <p><tt class="docutils literal">create</tt> <em>boolean</em> (Default: depends if user have create rights)</p>
  283. <blockquote>
  284. Whether to display the &quot;Create...&quot; entry in dropdown panel.</blockquote>
  285. <p><tt class="docutils literal">create_edit</tt> <em>boolean</em> (Default: depends if user have create rights)</p>
  286. <blockquote>
  287. Whether to display &quot;Create and Edit...&quot; entry in dropdown panel</blockquote>
  288. <p><tt class="docutils literal">m2o_dialog</tt> <em>boolean</em> (Default: depends if user have create rights)</p>
  289. <blockquote>
  290. Whether to display the many2one dialog in case of validation error.</blockquote>
  291. <p><tt class="docutils literal">limit</tt> <em>int</em> (Default: openerp default value is <tt class="docutils literal">7</tt>)</p>
  292. <blockquote>
  293. Number of displayed record in drop-down panel</blockquote>
  294. </div>
  295. <div class="section" id="example">
  296. <h1>Example</h1>
  297. <p>Your XML form view definition could contain:</p>
  298. <pre class="literal-block">
  299. ...
  300. &lt;field name=&quot;partner_id&quot; options=&quot;{'limit': 10, 'create': false, 'create_edit': false}&quot;/&gt;
  301. ...
  302. </pre>
  303. </div>
  304. <div class="section" id="note">
  305. <h1>Note</h1>
  306. <p>Double check that you have no inherited view that remote <tt class="docutils literal">options</tt> you set on a field !
  307. If nothing work, add a debugger in the first ligne of <tt class="docutils literal">get_search_result method</tt> and enable debug mode in OpenERP. When you write something in a many2one field, javascript debugger should pause. If not verify your installation.</p>
  308. </div>
  309. </div>
  310. </body>
  311. </html>