summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/kanban.xml
diff options
context:
space:
mode:
authorMohammed Shekha <msh@odoo.com>2019-12-19 05:14:01 +0000
committerAaron Bohy <aab@odoo.com>2020-01-22 13:01:33 +0000
commit370f53d8dcc88b4c6960fc321199df688d1d0810 (patch)
tree3062d5774444821c7516a34b9dc357c8528ac20c /addons/web/static/src/xml/kanban.xml
parenta5c4855a6b5c05a27184a55261ca01966a91248e (diff)
[IMP] web: conditional create/delete options on x2many fields
After this commit, x2many fields can have options like create/delete which accept a domain, to make create/delete on x2many conditional, say for example x2many field can have options like: options="{'create:' [('foo', '=', True)]', 'delete:' [('foo', '=', True)]'}" With this when foo field is True, Create and Delete actions will be available, but if foo is False then they won't. In case of one2many fields, if 'create' is false, then 'Add a line' (list) or 'Add' button (kanban) won't be displayed. In case of many2many fields, 'Add a line' or 'Add' button will always be displayed even if 'create' condition is false as it doesn't really create records (but rather links existing ones). Same applies for delete. Task-2092953 closes odoo/odoo#42919 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Parth Chokshi <pch@odoo.com> Co-authored-by: Aaron Bohy<aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml/kanban.xml')
-rw-r--r--addons/web/static/src/xml/kanban.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/xml/kanban.xml b/addons/web/static/src/xml/kanban.xml
index 9d998677dc4..1e7f36f8ef3 100644
--- a/addons/web/static/src/xml/kanban.xml
+++ b/addons/web/static/src/xml/kanban.xml
@@ -2,7 +2,7 @@
<t t-name="KanbanView.buttons">
<div>
- <button type="button" t-attf-class="btn #{btnClass} o-kanban-button-new" accesskey="c">
+ <button t-if="!noCreate" type="button" t-attf-class="btn #{btnClass} o-kanban-button-new" accesskey="c">
<t t-esc="create_text || _t('Create')"/>
</button>
</div>