diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-08-09 19:33:32 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-08-09 19:33:32 +0200 |
| commit | 7717f082c08d6121cd7d2478e14ff855afd6d384 (patch) | |
| tree | 5b26650048ba249f021792c1d4cb5900e7f0f7a4 /addons/web | |
| parent | d3df57bf906b3ff1964d3c96ea6b45950858099c (diff) | |
| parent | af35aea6b0d6ff52126141ab0e3754a0427553fc (diff) | |
[MERGE] forward port branch saas-11.3 up to af35aea6b0d
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/controllers/main.py | 5 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 | ||||
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 25 |
3 files changed, 30 insertions, 2 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index cd0f2ff0873..930dde340ed 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -744,6 +744,8 @@ class Database(http.Controller): @http.route('/web/database/restore', type='http', auth="none", methods=['POST'], csrf=False) def restore(self, master_pwd, backup_file, name, copy=False): try: + data_file = None + db.check_super(master_pwd) with tempfile.NamedTemporaryFile(delete=False) as data_file: backup_file.save(data_file) db.restore_db(name, data_file.name, str2bool(copy)) @@ -752,7 +754,8 @@ class Database(http.Controller): error = "Database restore error: %s" % (str(e) or repr(e)) return self._render_template(error=error) finally: - os.unlink(data_file.name) + if data_file: + os.unlink(data_file.name) @http.route('/web/database/change_password', type='http', auth="none", methods=['POST'], csrf=False) def change_password(self, master_pwd, master_pwd_new): diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 328f1ab93b5..ffc10145474 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -829,7 +829,7 @@ <t t-foreach="elements" t-as="el"> <t t-set="color" t-value="el[colorField] || 0"/> <span t-attf-class="badge dropdown o_tag_color_#{color}" t-att-data-color="color" t-att-data-index="el_index" t-att-data-id="el.id"> - <span class="o_badge_text"><t t-esc="el.display_name"/></span> + <span class="o_badge_text" t-att-title="el.display_name"><t t-esc="el.display_name"/></span> <span t-if="!readonly" class="fa fa-times o_delete"/> </span> </t> diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index b232a9bc4b9..39002f6b797 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -10680,6 +10680,31 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('widget many2many_tags', function (assert) { + assert.expect(1); + this.data.turtle.records[0].partner_ids = [2]; + + var form = createView({ + View: FormView, + model: 'turtle', + data: this.data, + arch:'<form string="Turtles">' + + '<sheet>' + + '<field name="display_name"/>' + + '<field name="partner_ids" widget="many2many_tags"/>' + + '</sheet>' + + '</form>', + res_id: 1, + }); + + assert.deepEqual( + form.$('.o_field_many2manytags.o_field_widget .badge .o_badge_text').attr('title'), + 'second record', 'the title should be filled in' + ); + + form.destroy(); + }); + QUnit.module('FieldStatus'); QUnit.test('static statusbar widget on many2one field', function (assert) { |
