[FIX] Cross-addons: Kanban templates: records editable/deletable

for the sake of compatibility with the communication logic in the
new Kanban implementation.
This commit is contained in:
Aaron Bohy
2015-06-15 16:30:35 +02:00
committed by Géry Debongnie
parent c530c0d1ee
commit 4072e336a2
21 changed files with 47 additions and 46 deletions
@@ -194,7 +194,7 @@
<a type="object" name="toggle_favorite"><i t-att-class="(record.show_on_dashboard.raw_value ? 'oe_star_on' : 'oe_star_off') + ' fa fa-star o_dashboard_star'" title="Click to add/remove from favorite"></i></a>
</div>
<div class="col-xs-6 text-right">
<a t-if="widget.view.is_action_enabled('edit')" type="edit">Settings</a>
<a t-if="widget.editable" type="edit">Settings</a>
</div>
</div>
</t>
+2 -2
View File
@@ -307,8 +307,8 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit Opportunity</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<t t-if="widget.editable"><li><a type="edit">Edit Opportunity</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><a name="%(mail.action_email_compose_message_wizard)d" type="action" >Send Email</a></li>
<li><a type="action" name="%(crm.crm_phonecall_category_phone_incoming0)d">Calls</a></li>
<li><a name="action_schedule_meeting" type="object">Schedule Meeting</a></li>
+1 -1
View File
@@ -165,7 +165,7 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('delete')">
<t t-if="widget.deletable">
<li><a type="delete">Delete</a></li>
</t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
+1 -1
View File
@@ -47,7 +47,7 @@
</div>
</div>
<div t-if="widget.view.is_action_enabled('edit')" class="o_kanban_card_manage_settings row">
<div t-if="widget.editable" class="o_kanban_card_manage_settings row">
<div class="col-xs-8">
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</div>
@@ -92,8 +92,8 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg" />
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<t t-if="widget.editable"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
@@ -265,8 +265,8 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg" />
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<t t-if="widget.editable"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
@@ -123,7 +123,7 @@
</div>
</div>
<div t-if="widget.view.is_action_enabled('edit')" class="o_kanban_card_manage_settings row">
<div t-if="widget.editable" class="o_kanban_card_manage_settings row">
<div class="col-xs-8">
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</div>
@@ -268,7 +268,7 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><a name="action_makeMeeting" type="object">Schedule Interview</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
+3 -3
View File
@@ -50,11 +50,11 @@
<div t-attf-class="oe_kanban_card oe_kanban_global_click oe_kanban_email_template">
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu" t-if="widget.view.is_action_enabled('edit') or widget.view.is_action_enabled('delete')">
<t t-if="widget.view.is_action_enabled('edit')">
<ul class="oe_dropdown_menu" t-if="widget.editable or widget.deletable">
<t t-if="widget.editable">
<li><a type="edit">Edit</a></li>
</t>
<t t-if="widget.view.is_action_enabled('delete')">
<t t-if="widget.deletable">
<li><a type="delete">Delete</a></li>
</t>
</ul>
+3 -3
View File
@@ -499,7 +499,7 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('delete')">
<t t-if="widget.deletable">
<li><a type="delete">Delete</a></li>
</t>
</ul>
@@ -787,10 +787,10 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('edit')">
<t t-if="widget.editable">
<li><a type="edit">Settings</a></li>
</t>
<t t-if="widget.view.is_action_enabled('delete')">
<t t-if="widget.deletable">
<li><a type="delete">Delete</a></li>
</t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
+1 -1
View File
@@ -42,7 +42,7 @@
<a name="%(action_view_task_history_cumulative_filter)d" type="action">Cumulative Flow</a>
</div>
</div>
<div t-if="widget.view.is_action_enabled('edit')" class="o_project_kanban_colorpicker">
<div t-if="widget.editable" class="o_project_kanban_colorpicker">
<div class="col-xs-12">
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</div>
+2 -2
View File
@@ -363,8 +363,8 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit Task</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<t t-if="widget.editable"><li><a type="edit">Edit Task</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
+2 -2
View File
@@ -168,8 +168,8 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit Issue</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<t t-if="widget.editable"><li><a type="edit">Edit Issue</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
+4 -4
View File
@@ -35,12 +35,12 @@
context="{'search_default_partner_id': partner_id, 'default_partner_id': partner_id}">
<field name="sale_number" widget="statinfo" string="Quotes"/>
</button>
<button class="oe_inline oe_stat_button" type="action" attrs="{'invisible': [('sale_amount_total', '=', 0)]}"
<button class="oe_stat_button" type="action" attrs="{'invisible': [('sale_amount_total', '=', 0)]}"
name="%(sale_action_quotations)d" icon="stat_button_icon fa fa-usd"
context="{'search_default_partner_id': partner_id, 'default_partner_id': partner_id}">
<div>
<strong><field name="sale_amount_total" class="oe_inline" widget="monetary" options="{'currency_field': 'company_currency'}"/></strong>
<div><field name="sale_number" class="oe_inline"/> Orders</div>
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="sale_amount_total" widget="monetary" options="{'currency_field': 'company_currency'}"/></span>
<span class="o_stat_text"> Orders</span>
</div>
</button>
</xpath>
+1 -1
View File
@@ -47,7 +47,7 @@
</div>
</div>
<div t-if="widget.view.is_action_enabled('edit')" class="o_kanban_card_manage_settings row">
<div t-if="widget.editable" class="o_kanban_card_manage_settings row">
<div class="col-xs-8">
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</div>
+1 -1
View File
@@ -100,7 +100,7 @@
</div>
</div>
<div t-if="widget.view.is_action_enabled('edit')" class="o_kanban_card_manage_settings row">
<div t-if="widget.editable" class="o_kanban_card_manage_settings row">
<div class="col-xs-8">
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</div>
+2 -2
View File
@@ -184,11 +184,11 @@
<field name="public_url" />
<templates>
<div t-name="kanban-box" t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
<div class="oe_dropdown_toggle oe_dropdown_kanban" t-if="widget.view.is_action_enabled('edit')">
<div class="oe_dropdown_toggle oe_dropdown_kanban" t-if="widget.editable">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<li><a type="edit">Edit Survey</a></li>
<li t-if="widget.view.is_action_enabled('delete')"><a type="delete">Delete</a></li>
<li t-if="widget.deletable"><a type="delete">Delete</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
@@ -1,7 +1,7 @@
.oe_WidgetWebsiteButton.danger .oe_publish {
display: none;
.oe_stat_button .o_stat_info:not(.published) > .o_stat_text.oe_publish {
display: none;
}
.oe_WidgetWebsiteButton.success .oe_unpublish {
.oe_stat_button .o_stat_info.published > .o_stat_text.oe_unpublish {
display: none;
}
.oe_form_field_html_frame iframe {
@@ -9,10 +9,13 @@ var form_widgets = require('web.form_widgets'); // required to guarantee that
var WidgetWebsiteButton = form_common.AbstractField.extend({
template: 'WidgetWebsiteButton',
render_value: function() {
// Hack to replace false value by unpublished because falsy form fields
// have classname o_form_field_empty and are hidden
if (!this.get_value()) {
this.set_value('unpublished');
}
this._super();
this.$()
.toggleClass("success", this.get_value())
.toggleClass("danger", !this.get_value());
this.$el.toggleClass("published", this.get_value() === true);
if (this.node.attrs.class) {
this.$el.addClass(this.node.attrs.class);
}
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="WidgetWebsiteButton">
<div class="oe_WidgetWebsiteButton success">
<strong class="oe_unpublish text-danger">Not<br/>Published</strong>
<strong class="oe_publish text-success">Published</strong>
</div>
</t>
<div t-name="WidgetWebsiteButton" class="o_stat_info published">
<span class="o_stat_text oe_unpublish text-danger">Not Published</span>
<span class="o_stat_text oe_publish text-success">Published</span>
</div>
<t t-name="FieldTextHtmlFrame">
<div class="oe_form_field oe_form_field_html_frame oe_form_embedded_html" t-att-style="widget.node.attrs.style">
@@ -18,8 +18,8 @@
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<li><a t-att-href="record.website_url.value" type="url">View Track</a></li>
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit Track</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<t t-if="widget.editable"><li><a type="edit">Edit Track</a></li></t>
<t t-if="widget.deletable"><li><a type="delete">Delete</a></li></t>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
+2 -2
View File
@@ -41,8 +41,8 @@
<div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
<i class="fa fa-bars fa-lg"/>
<ul class="oe_dropdown_menu">
<li t-if="widget.view.is_action_enabled('edit')"><a type="edit">Edit Post</a></li>
<li t-if="widget.view.is_action_enabled('delete')"><a type="delete">Delete</a></li>
<li t-if="widget.editable"><a type="edit">Edit Post</a></li>
<li t-if="widget.deletable"><a type="delete">Delete</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>