Skip to content

Add orm mongodb exist #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.pydevproject
.settings
*.pyc
.idea
45 changes: 45 additions & 0 deletions i18n/ca_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
#
# Translators:
# Jaume Florez Valenzuela <[email protected]>, 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 <[email protected]>\n"
"Language-Team: Catalan (Spain) <[email protected]>\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"
45 changes: 45 additions & 0 deletions i18n/es_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
#
# Translators:
# Jaume Florez Valenzuela <[email protected]>, 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 <[email protected]>\n"
"Language-Team: Spanish (Spain) <[email protected]>\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"
43 changes: 43 additions & 0 deletions i18n/mongodb_backend.pot
Original file line number Diff line number Diff line change
@@ -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: [email protected]\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 ""

12 changes: 12 additions & 0 deletions orm_mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):

Expand Down