forked from Techsystech/web
[FIX] web_widget_x2many_2d_matrix: fixes (#712)
* Patches to make module operational. * Minor fix to Readonly Switch * Fix to render to set change attribute. * Totals recompute. Fixes #69716.0
parent
92f920247b
commit
82b0d44651
|
@ -5,7 +5,7 @@
|
|||
|
||||
{
|
||||
"name": "2D matrix for x2many fields",
|
||||
"version": "10.0.1.0.0",
|
||||
"version": "10.0.1.0.1",
|
||||
"author": "Therp BV, "
|
||||
"Tecnativa,"
|
||||
"Odoo Community Association (OCA)",
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_widget_x2many_2d_matrix
|
||||
#
|
||||
# Translators:
|
||||
# Viktoras Norkus <viktoras@bmx.lt>, 2018
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-01-25 01:58+0000\n"
|
||||
"PO-Revision-Date: 2018-01-25 01:58+0000\n"
|
||||
"Last-Translator: Viktoras Norkus <viktoras@bmx.lt>, 2018\n"
|
||||
"Language-Team: Lithuanian (https://www.transifex.com/oca/teams/23907/lt/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: lt\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
|
||||
#. module: web_widget_x2many_2d_matrix
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_x2many_2d_matrix/static/src/xml/web_widget_x2many_2d_matrix.xml:11
|
||||
#: code:addons/web_widget_x2many_2d_matrix/static/src/xml/web_widget_x2many_2d_matrix.xml:28
|
||||
#, python-format
|
||||
msgid "Total"
|
||||
msgstr "Suma"
|
|
@ -0,0 +1,27 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_widget_x2many_2d_matrix
|
||||
#
|
||||
# Translators:
|
||||
# Peter Hageman <hageman.p@gmail.com>, 2017
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-01-03 03:50+0000\n"
|
||||
"PO-Revision-Date: 2018-01-03 03:50+0000\n"
|
||||
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
|
||||
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: nl_NL\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: web_widget_x2many_2d_matrix
|
||||
#. openerp-web
|
||||
#: code:addons/web_widget_x2many_2d_matrix/static/src/xml/web_widget_x2many_2d_matrix.xml:11
|
||||
#: code:addons/web_widget_x2many_2d_matrix/static/src/xml/web_widget_x2many_2d_matrix.xml:28
|
||||
#, python-format
|
||||
msgid "Total"
|
||||
msgstr "Totaal"
|
|
@ -131,7 +131,7 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
|
|||
})
|
||||
.then(function()
|
||||
{
|
||||
return self.dataset.read_ids(self.dataset.ids).then(function(rows)
|
||||
return self.dataset.read_ids(self.dataset.ids, self.fields).then(function(rows)
|
||||
{
|
||||
// setup data structure
|
||||
_.each(rows, function(row)
|
||||
|
@ -369,6 +369,7 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
|
|||
$this.val(this.format_xy_value(value));
|
||||
|
||||
this.dataset.write($this.data('id'), data);
|
||||
this.by_id[$this.data('id')][this.field_value] = value;
|
||||
$this.parent().removeClass('oe_form_invalid');
|
||||
this.compute_totals();
|
||||
}
|
||||
|
@ -382,7 +383,7 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
|
|||
effective_readonly_change: function()
|
||||
{
|
||||
this.$el
|
||||
.find('tbody .read')
|
||||
.find('tbody .edit')
|
||||
.toggle(!this.get('effective_readonly'));
|
||||
this.$el
|
||||
.find('tbody .read')
|
||||
|
@ -404,6 +405,9 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
|
|||
return $.when(result).then(function()
|
||||
{
|
||||
self.renderElement();
|
||||
self.compute_totals();
|
||||
self.$el.find('.edit').on(
|
||||
'change', self.proxy(self.xy_value_change));
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<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="'' + (widget.is_numeric ? ' oe_number' : '')" t-att-data-x="x">
|
||||
<span t-att-class="widget.get_xy_value_class()">
|
||||
<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>
|
||||
<input class="edit o_form_input oe_edit_only" 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 oe_read_only"><t t-esc="widget.format_xy_value(widget.get_xy_value(x, y))" /></span>
|
||||
</span>
|
||||
</td>
|
||||
<td t-if="widget.show_row_totals" class="row_total oe_number" t-att-data-y="y"/>
|
||||
|
|
Loading…
Reference in New Issue