From 49fe4aa8b29957e87d71b52aae9807b86540227b Mon Sep 17 00:00:00 2001 From: Jaume Florez Date: Tue, 24 Oct 2017 10:53:39 +0200 Subject: [PATCH 1/3] Add orm_mongodb.exists method --- orm_mongodb.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/orm_mongodb.py b/orm_mongodb.py index 672f7bc..d3ba142 100644 --- a/orm_mongodb.py +++ b/orm_mongodb.py @@ -222,6 +222,18 @@ def preformat_write_fields(self, vals): ss = self._columns[key]._symbol_set vals[key] = ss[1](value) + def exists(self, cr, uid, ids, context=None): + collection = mdbpool.get_collection(self._table) + + if not context: + context = {} + if not ids: + return False + + mongo_cr = collection.find({'id': ids}, ['id']) + res = [x for x in mongo_cr] + return True if res else False + def read(self, cr, user, ids, fields=None, context=None, load='_classic_read'): From 4ca83055960749a9766c73212ca9bd647cdbbc62 Mon Sep 17 00:00:00 2001 From: Jaume Florez Date: Tue, 24 Oct 2017 11:37:35 +0200 Subject: [PATCH 2/3] Add i18n locale translations --- i18n/ca_ES.po | 45 ++++++++++++++++++++++++++++++++++++++++ i18n/es_ES.po | 45 ++++++++++++++++++++++++++++++++++++++++ i18n/mongodb_backend.pot | 43 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 i18n/ca_ES.po create mode 100644 i18n/es_ES.po create mode 100644 i18n/mongodb_backend.pot diff --git a/i18n/ca_ES.po b/i18n/ca_ES.po new file mode 100644 index 0000000..282988c --- /dev/null +++ b/i18n/ca_ES.po @@ -0,0 +1,45 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +# Translators: +# Jaume Florez Valenzuela , 2017. +msgid "" +msgstr "" +"Project-Id-Version: GISCE-ERP\n" +"Report-Msgid-Bugs-To: https://github.com/gisce/erp/issues\n" +"POT-Creation-Date: 2017-10-24 11:27\n" +"PO-Revision-Date: 2017-10-24 09:36+0000\n" +"Last-Translator: Jaume Florez Valenzuela \n" +"Language-Team: Catalan (Spain) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca_ES\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mongodb_backend +#: model:ir.module.module,shortdesc:mongodb_backend.module_meta_information +msgid "MongoDB Backend" +msgstr "MongoDB Backend" + +#. module: mongodb_backend +#: model:ir.module.module,description:mongodb_backend.module_meta_information +msgid "" +"\n" +"NoSQL MongoDB backend for OpenERP. It allows to create objects and store\n" +"all the data in a NoSQL way. You can interact with this data the same way\n" +"as it was stored in PostgreSQL from the client.\n" +" " +msgstr "\nNoSQL MongoDB backend per OpenERP. Permet la creació i emmagatzematge d'objectes mitjançant NoSQL. Es pot interactuar amb les dades de la mateixa manera que amb PostgreSQL desde el client.\n " + +#. module: mongodb_backend +#: code:addons/mongodb_backend/orm_mongodb.py:437 +#, python-format +msgid "Error" +msgstr "Error" + +#. module: mongodb_backend +#: code:addons/mongodb_backend/orm_mongodb.py:438 +#, python-format +msgid "Bad order declaration for model %s" +msgstr "Declaració incorrecta del ordre per al model %s" diff --git a/i18n/es_ES.po b/i18n/es_ES.po new file mode 100644 index 0000000..64f679f --- /dev/null +++ b/i18n/es_ES.po @@ -0,0 +1,45 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +# Translators: +# Jaume Florez Valenzuela , 2017. +msgid "" +msgstr "" +"Project-Id-Version: GISCE-ERP\n" +"Report-Msgid-Bugs-To: https://github.com/gisce/erp/issues\n" +"POT-Creation-Date: 2017-10-24 11:27\n" +"PO-Revision-Date: 2017-10-24 09:34+0000\n" +"Last-Translator: Jaume Florez Valenzuela \n" +"Language-Team: Spanish (Spain) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_ES\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mongodb_backend +#: model:ir.module.module,shortdesc:mongodb_backend.module_meta_information +msgid "MongoDB Backend" +msgstr "MongoDB Backend" + +#. module: mongodb_backend +#: model:ir.module.module,description:mongodb_backend.module_meta_information +msgid "" +"\n" +"NoSQL MongoDB backend for OpenERP. It allows to create objects and store\n" +"all the data in a NoSQL way. You can interact with this data the same way\n" +"as it was stored in PostgreSQL from the client.\n" +" " +msgstr "\nNoSQL MongoDB backend para OpenERP. Permite la creación y almacenaje de datos con NoSQL. Puede interactuar con los datos de la misma forma que con PostgreSQL desde el cliente.\n " + +#. module: mongodb_backend +#: code:addons/mongodb_backend/orm_mongodb.py:437 +#, python-format +msgid "Error" +msgstr "Error" + +#. module: mongodb_backend +#: code:addons/mongodb_backend/orm_mongodb.py:438 +#, python-format +msgid "Bad order declaration for model %s" +msgstr "Mala declaración del orden para el modelo %s" diff --git a/i18n/mongodb_backend.pot b/i18n/mongodb_backend.pot new file mode 100644 index 0000000..72831a8 --- /dev/null +++ b/i18n/mongodb_backend.pot @@ -0,0 +1,43 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * mongodb_backend +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.14\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2017-10-24 11:27\n" +"PO-Revision-Date: 2017-10-24 11:27\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mongodb_backend +#: model:ir.module.module,shortdesc:mongodb_backend.module_meta_information +msgid "MongoDB Backend" +msgstr "" + +#. module: mongodb_backend +#: model:ir.module.module,description:mongodb_backend.module_meta_information +msgid "\n" +"NoSQL MongoDB backend for OpenERP. It allows to create objects and store\n" +"all the data in a NoSQL way. You can interact with this data the same way\n" +"as it was stored in PostgreSQL from the client.\n" +" " +msgstr "" + +#. module: mongodb_backend +#: code:addons/mongodb_backend/orm_mongodb.py:437 +#, python-format +msgid "Error" +msgstr "" + +#. module: mongodb_backend +#: code:addons/mongodb_backend/orm_mongodb.py:438 +#, python-format +msgid "Bad order declaration for model %s" +msgstr "" + From 48b6fc63aafe135f8e42da1777e94b2e39201599 Mon Sep 17 00:00:00 2001 From: Jaume Florez Date: Tue, 24 Oct 2017 11:38:07 +0200 Subject: [PATCH 3/3] Add .idea on gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5392440..edf472f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .pydevproject .settings *.pyc +.idea