mirror of https://github.com/OCA/web.git
web_m2x_options check Many2one and Many2many options
parent
1fe71fa828
commit
f969cc2b8f
|
@ -0,0 +1,43 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# SaFi J. <safi2266@gmail.com>, 2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-02-26 02:05+0000\n"
|
||||
"PO-Revision-Date: 2015-12-16 17:30+0000\n"
|
||||
"Last-Translator: SaFi J. <safi2266@gmail.com>\n"
|
||||
"Language-Team: Arabic (http://www.transifex.com/oca/OCA-web-8-0/language/ar/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: ar\n"
|
||||
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "إنشاء \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "إنشاء وتحرير ..."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "البحث عن المزيد ..."
|
|
@ -0,0 +1,43 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# Rudolf Schnapka <rs@techno-flex.de>, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-02-26 02:05+0000\n"
|
||||
"PO-Revision-Date: 2016-01-18 20:15+0000\n"
|
||||
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
|
||||
"Language-Team: German (http://www.transifex.com/oca/OCA-web-8-0/language/de/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: de\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Anlegen \"<strong>%s</strong>"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Anlegen und Bearbeiten"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Suche weitere..."
|
|
@ -0,0 +1,43 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-02-26 02:05+0000\n"
|
||||
"PO-Revision-Date: 2015-11-07 11:28+0000\n"
|
||||
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-web-8-0/language/es/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: es\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Crear \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Crear y editar..."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Buscar más..."
|
|
@ -0,0 +1,43 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-02-26 02:05+0000\n"
|
||||
"PO-Revision-Date: 2016-02-01 09:52+0000\n"
|
||||
"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>\n"
|
||||
"Language-Team: Finnish (http://www.transifex.com/oca/OCA-web-8-0/language/fi/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: fi\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Luo \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Luo ja muokkaa..."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Hae lisää..."
|
|
@ -0,0 +1,43 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# Christophe CHAUVET <christophe.chauvet@gmail.com>, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-05-06 15:50+0000\n"
|
||||
"PO-Revision-Date: 2016-05-06 08:27+0000\n"
|
||||
"Last-Translator: Christophe CHAUVET <christophe.chauvet@gmail.com>\n"
|
||||
"Language-Team: French (http://www.transifex.com/oca/OCA-web-8-0/language/fr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: fr\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Creer \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Créer et modifier..."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Rechercher plus..."
|
|
@ -0,0 +1,55 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# Ahmet Altınışık <aaltinisik@altinkaya.com.tr>, 2015
|
||||
# Antonio Trueba, 2016
|
||||
# Armando Vulcano Junior <vulcano@uol.com.br>, 2015
|
||||
# Carles Antoli <carlesantoli@hotmail.com>, 2015
|
||||
# Bole <bole@dajmi5.com>, 2015
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012,2014
|
||||
# Giacomo <giacomo.spettoli@gmail.com>, 2015
|
||||
# Hotellook, 2014
|
||||
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016
|
||||
# Paolo Valier, 2016
|
||||
# Paolo Valier, 2016
|
||||
# Rudolf Schnapka <rs@techno-flex.de>, 2016
|
||||
# Thomas A. Jaeger, 2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-04-28 07:09+0000\n"
|
||||
"PO-Revision-Date: 2016-04-28 06:46+0000\n"
|
||||
"Last-Translator: Paolo Valier\n"
|
||||
"Language-Team: Italian (http://www.transifex.com/oca/OCA-web-8-0/language/it/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: it\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Crea \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Crea e Modifica..."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Cerca altro..."
|
|
@ -0,0 +1,43 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# danimaribeiro <danimaribeiro@gmail.com>, 2016
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-03-11 02:17+0000\n"
|
||||
"PO-Revision-Date: 2016-03-05 16:20+0000\n"
|
||||
"Last-Translator: danimaribeiro <danimaribeiro@gmail.com>\n"
|
||||
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-web-8-0/language/pt_BR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: pt_BR\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Criar \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Criar e editar.."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Buscar mais..."
|
|
@ -0,0 +1,43 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-02-26 02:05+0000\n"
|
||||
"PO-Revision-Date: 2015-11-08 05:46+0000\n"
|
||||
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
|
||||
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-web-8-0/language/sl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: sl\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Ustvari \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Ustvari in urejaj..."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Poišči več..."
|
|
@ -0,0 +1,44 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * web_m2x_options
|
||||
#
|
||||
# Translators:
|
||||
# Ahmet Altınışık <aaltinisik@altinkaya.com.tr>, 2015
|
||||
# Ahmet Altınışık <aaltinisik@altinkaya.com.tr>, 2015
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: web (8.0)\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-02-26 02:05+0000\n"
|
||||
"PO-Revision-Date: 2015-12-30 21:53+0000\n"
|
||||
"Last-Translator: Ahmet Altınışık <aaltinisik@altinkaya.com.tr>\n"
|
||||
"Language-Team: Turkish (http://www.transifex.com/oca/OCA-web-8-0/language/tr/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Language: tr\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:191
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:330
|
||||
#, python-format
|
||||
msgid "Create \"<strong>%s</strong>\""
|
||||
msgstr "Oluştur \"<strong>%s</strong>\""
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:213
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:351
|
||||
#, python-format
|
||||
msgid "Create and Edit..."
|
||||
msgstr "Oluştur ve düzenle..."
|
||||
|
||||
#. module: web_m2x_options
|
||||
#. openerp-web
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:156
|
||||
#: code:addons/web_m2x_options/static/src/js/form.js:305
|
||||
#, python-format
|
||||
msgid "Search More..."
|
||||
msgstr "Daha Fazla..."
|
|
@ -67,11 +67,11 @@ openerp.web_m2x_options = function (instance) {
|
|||
var self = this;
|
||||
// add options limit used to change number of selections record
|
||||
// returned.
|
||||
if (_.isUndefined(this.view))
|
||||
return this._super.apply(this, arguments);
|
||||
if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) {
|
||||
this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']);
|
||||
}
|
||||
if (_.isUndefined(this.view))
|
||||
return this._super.apply(this, arguments);
|
||||
if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) {
|
||||
this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']);
|
||||
}
|
||||
|
||||
if (typeof this.options.limit === 'number') {
|
||||
this.limit = this.options.limit;
|
||||
|
@ -99,8 +99,7 @@ openerp.web_m2x_options = function (instance) {
|
|||
self.build_context()));
|
||||
|
||||
var create_rights;
|
||||
if (typeof this.options.create === "undefined" ||
|
||||
typeof this.options.create_edit === "undefined") {
|
||||
if (!(self.options && (self.options.no_create || self.options.no_create_edit))) {
|
||||
create_rights = new instance.web.Model(this.field.relation).call(
|
||||
"check_access_rights", ["create", false]);
|
||||
}
|
||||
|
@ -119,7 +118,7 @@ openerp.web_m2x_options = function (instance) {
|
|||
id: x[0],
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// Search result value colors
|
||||
|
||||
if (self.colors && self.field_color) {
|
||||
|
@ -127,7 +126,7 @@ openerp.web_m2x_options = function (instance) {
|
|||
for (var index in values) {
|
||||
value_ids.push(values[index].id);
|
||||
}
|
||||
|
||||
|
||||
// RPC request to get field_color from Objects
|
||||
Objects.query([self.field_color])
|
||||
.filter([['id', 'in', value_ids]])
|
||||
|
@ -137,7 +136,7 @@ openerp.web_m2x_options = function (instance) {
|
|||
if (values[index_value].id == objects[index].id) {
|
||||
// Find value in values by comparing ids
|
||||
var value = values[index_value];
|
||||
|
||||
|
||||
// Find color with field value as key
|
||||
var color = self.colors[objects[index][self.field_color]] || 'black';
|
||||
value.label = '<span style="color:'+color+'">'+value.label+'</span>';
|
||||
|
@ -171,10 +170,15 @@ openerp.web_m2x_options = function (instance) {
|
|||
var raw_result = _(data.result).map(function (x) {
|
||||
return x[1];
|
||||
});
|
||||
var no_quick_create = (
|
||||
self.options && (self.options.no_create ||
|
||||
self.options.no_quick_create)
|
||||
)
|
||||
var m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create'])
|
||||
var m2x_create = self.view.ir_options['web_m2x_options.create'] == "True"
|
||||
|
||||
if ((_.isUndefined(self.options.create) && _.isUndefined(self.view.ir_options['web_m2x_options.create']) && can_create) ||
|
||||
(_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create'] == "True") ||
|
||||
self.options.create) {
|
||||
if (!no_quick_create && ((m2x_create_undef && can_create) ||
|
||||
m2x_create)) {
|
||||
|
||||
if (search_val.length > 0 &&
|
||||
!_.include(raw_result, search_val)) {
|
||||
|
@ -192,10 +196,15 @@ openerp.web_m2x_options = function (instance) {
|
|||
}
|
||||
|
||||
// create...
|
||||
var no_create_edit = (
|
||||
self.options && (self.options.no_create ||
|
||||
self.options.no_create_edit)
|
||||
)
|
||||
var m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit'])
|
||||
var m2x_create_edit = self.view.ir_options['web_m2x_options.create_edit'] == "True"
|
||||
|
||||
if ((_.isUndefined(self.options.create_edit) && _.isUndefined(self.view.ir_options['web_m2x_options.create_edit']) && can_create) ||
|
||||
(_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create_edit'] == "True") ||
|
||||
self.options.create_edit) {
|
||||
if (!no_create_edit && ((m2x_create_edit_undef && can_create) ||
|
||||
m2x_create_edit)) {
|
||||
|
||||
values.push({
|
||||
label: _t("Create and Edit..."),
|
||||
|
@ -207,7 +216,7 @@ openerp.web_m2x_options = function (instance) {
|
|||
classname: 'oe_m2o_dropdown_option'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Check if colors specified to wait for RPC
|
||||
if (!(self.field_color && self.colors)){
|
||||
def.resolve(values);
|
||||
|
@ -226,28 +235,28 @@ openerp.web_m2x_options = function (instance) {
|
|||
new instance.web.form.M2ODialog(this).open();
|
||||
}
|
||||
},
|
||||
|
||||
start: function() {
|
||||
this._super.apply(this, arguments);
|
||||
return this.get_options();
|
||||
},
|
||||
|
||||
get_options: function() {
|
||||
var self = this;
|
||||
if (_.isUndefined(this.view.ir_options_loaded)) {
|
||||
this.view.ir_options_loaded = $.Deferred();
|
||||
this.view.ir_options = {};
|
||||
(new instance.web.Model("ir.config_parameter"))
|
||||
.query(["key", "value"]).filter([['key', 'in', OPTIONS]])
|
||||
.all().then(function(records) {
|
||||
_(records).each(function(record) {
|
||||
self.view.ir_options[record.key] = record.value;
|
||||
});
|
||||
self.view.ir_options_loaded.resolve();
|
||||
});
|
||||
}
|
||||
return this.view.ir_options_loaded;
|
||||
},
|
||||
start: function() {
|
||||
this._super.apply(this, arguments);
|
||||
return this.get_options();
|
||||
},
|
||||
|
||||
get_options: function() {
|
||||
var self = this;
|
||||
if (_.isUndefined(this.view.ir_options_loaded)) {
|
||||
this.view.ir_options_loaded = $.Deferred();
|
||||
this.view.ir_options = {};
|
||||
(new instance.web.Model("ir.config_parameter"))
|
||||
.query(["key", "value"]).filter([['key', 'in', OPTIONS]])
|
||||
.all().then(function(records) {
|
||||
_(records).each(function(record) {
|
||||
self.view.ir_options[record.key] = record.value;
|
||||
});
|
||||
self.view.ir_options_loaded.resolve();
|
||||
});
|
||||
}
|
||||
return this.view.ir_options_loaded;
|
||||
},
|
||||
|
||||
/**
|
||||
* Call this method to search using a string.
|
||||
|
@ -258,10 +267,10 @@ openerp.web_m2x_options = function (instance) {
|
|||
|
||||
// add options limit used to change number of selections record
|
||||
// returned.
|
||||
|
||||
if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) {
|
||||
this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']);
|
||||
}
|
||||
|
||||
if (!_.isUndefined(this.view.ir_options['web_m2x_options.limit'])) {
|
||||
this.limit = parseInt(this.view.ir_options['web_m2x_options.limit']);
|
||||
}
|
||||
|
||||
if (typeof this.options.limit === 'number') {
|
||||
this.limit = this.options.limit;
|
||||
|
@ -300,10 +309,14 @@ openerp.web_m2x_options = function (instance) {
|
|||
});
|
||||
}
|
||||
// quick create
|
||||
var no_quick_create = (
|
||||
self.options && (self.options.no_create ||
|
||||
self.options.no_quick_create)
|
||||
)
|
||||
var m2x_create_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create'])
|
||||
var m2x_create = self.view.ir_options['web_m2x_options.create'] == "True"
|
||||
|
||||
if ((_.isUndefined(self.options.create) && _.isUndefined(self.view.ir_options['web_m2x_options.create'])) ||
|
||||
(_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create'] == 'True') ||
|
||||
self.options.create) {
|
||||
if (!no_quick_create && (m2x_create_undef || m2x_create)) {
|
||||
|
||||
var raw_result = _(data.result).map(function(x) {return x[1];});
|
||||
if (search_val.length > 0 && !_.include(raw_result, search_val)) {
|
||||
|
@ -319,10 +332,14 @@ openerp.web_m2x_options = function (instance) {
|
|||
}
|
||||
|
||||
// create...
|
||||
var no_create_edit = (
|
||||
self.options && (self.options.no_create ||
|
||||
self.options.no_create_edit)
|
||||
)
|
||||
var m2x_create_edit_undef = _.isUndefined(self.view.ir_options['web_m2x_options.create_edit'])
|
||||
var m2x_create_edit = self.view.ir_options['web_m2x_options.create_edit'] == "True"
|
||||
|
||||
if ((_.isUndefined(self.options.create_edit === 'undefined') && _.isUndefined(self.view.ir_options['web_m2x_options.create_edit'])) ||
|
||||
(_.isUndefined(self.options.create) && self.view.ir_options['web_m2x_options.create_edit'] == 'True') ||
|
||||
self.options.create_edit) {
|
||||
if (!no_create_edit && (m2x_create_edit_undef || m2x_create_edit)) {
|
||||
|
||||
values.push({
|
||||
label: _t("Create and Edit..."),
|
||||
|
|
Loading…
Reference in New Issue