Browse Source

Migration of web_widget_x2many_2d_matrix to 10.0

pull/1106/head
jesusVMayor 8 years ago
committed by Jairo Llopis
parent
commit
7ff2c149f2
  1. 4
      web_widget_x2many_2d_matrix/__manifest__.py
  2. 2
      web_widget_x2many_2d_matrix/static/src/css/web_widget_x2many_2d_matrix.css
  3. 7
      web_widget_x2many_2d_matrix/static/src/js/web_widget_x2many_2d_matrix.js
  4. 6
      web_widget_x2many_2d_matrix/static/src/xml/web_widget_x2many_2d_matrix.xml

4
web_widget_x2many_2d_matrix/__manifest__.py

@ -5,7 +5,7 @@
{ {
"name": "2D matrix for x2many fields", "name": "2D matrix for x2many fields",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"author": "Therp BV, " "author": "Therp BV, "
"Tecnativa," "Tecnativa,"
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
@ -21,5 +21,5 @@
"qweb": [ "qweb": [
'static/src/xml/web_widget_x2many_2d_matrix.xml', 'static/src/xml/web_widget_x2many_2d_matrix.xml',
], ],
'installable': False,
"installable": True,
} }

2
web_widget_x2many_2d_matrix/static/src/css/web_widget_x2many_2d_matrix.css

@ -2,7 +2,7 @@
{ {
cursor: pointer; cursor: pointer;
} }
.openerp .oe_form_field_x2many_2d_matrix .oe_list_content > tbody > tr > td.oe_list_field_cell
.oe_form_field_x2many_2d_matrix .oe_list_content > tbody > tr > td.oe_list_field_cell
{ {
white-space: normal; white-space: normal;
} }

7
web_widget_x2many_2d_matrix/static/src/js/web_widget_x2many_2d_matrix.js

@ -10,8 +10,7 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
var FieldOne2Many = core.form_widget_registry.get('one2many'); var FieldOne2Many = core.form_widget_registry.get('one2many');
var Model = require('web.Model'); var Model = require('web.Model');
var data = require('web.data'); var data = require('web.data');
var _ = require('_');
var $ = require('$');
var $ = require('jquery');
var WidgetX2Many2dMatrix = FieldOne2Many.extend({ var WidgetX2Many2dMatrix = FieldOne2Many.extend({
template: 'FieldX2Many2dMatrix', template: 'FieldX2Many2dMatrix',
@ -383,10 +382,10 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
effective_readonly_change: function() effective_readonly_change: function()
{ {
this.$el this.$el
.find('tbody td.oe_list_field_cell span.oe_form_field .edit')
.find('tbody .read')
.toggle(!this.get('effective_readonly')); .toggle(!this.get('effective_readonly'));
this.$el this.$el
.find('tbody td.oe_list_field_cell span.oe_form_field .read')
.find('tbody .read')
.toggle(this.get('effective_readonly')); .toggle(this.get('effective_readonly'));
this.$el.find('.edit').first().focus(); this.$el.find('.edit').first().focus();
}, },

6
web_widget_x2many_2d_matrix/static/src/xml/web_widget_x2many_2d_matrix.xml

@ -1,7 +1,7 @@
<templates> <templates>
<t t-name="FieldX2Many2dMatrix"> <t t-name="FieldX2Many2dMatrix">
<div t-att-class="widget.widget_class"> <div t-att-class="widget.widget_class">
<table class="oe_list_content">
<table class="o_list_view table table-condensed table-striped">
<thead> <thead>
<tr class="oe_list_header_columns"> <tr class="oe_list_header_columns">
<th /> <th />
@ -14,9 +14,9 @@
<tbody> <tbody>
<tr t-foreach="widget.get_y_axis_values()" t-as="y" t-att-data-y="y"> <tr t-foreach="widget.get_y_axis_values()" t-as="y" t-att-data-y="y">
<th><t t-esc="widget.get_y_axis_label(y)" /></th> <th><t t-esc="widget.get_y_axis_label(y)" /></th>
<td t-foreach="widget.get_x_axis_values()" t-as="x" t-att-class="'oe_list_field_cell' + (widget.is_numeric ? ' oe_number' : '')" t-att-data-x="x">
<td t-foreach="widget.get_x_axis_values()" t-as="x" t-att-class="'' + (widget.is_numeric ? ' oe_number' : '')" t-att-data-x="x">
<span t-att-class="widget.get_xy_value_class()"> <span t-att-class="widget.get_xy_value_class()">
<input class="edit" t-att-data-id="widget.get_xy_id(x, y)" t-att-value="widget.format_xy_value(widget.get_xy_value(x, y))" t-att="widget.get_xy_att(x, y)"/>
<input class="edit o_form_input" t-att-data-id="widget.get_xy_id(x, y)" t-att-value="widget.format_xy_value(widget.get_xy_value(x, y))" t-att="widget.get_xy_att(x, y)"/>
<span class="read"><t t-esc="widget.format_xy_value(widget.get_xy_value(x, y))" /></span> <span class="read"><t t-esc="widget.format_xy_value(widget.get_xy_value(x, y))" /></span>
</span> </span>
</td> </td>

Loading…
Cancel
Save