[FIX] base_external_system. Solve test error.

Testing fingerprint, with ignore_finger_print set to False, caused an error, because it would first set
ignore_fingerprint to False, then validate, never getting to actually setting the fingerprint, causing the
following stacktrace:
Traceback (most recent call last):

  File "/home/travis/build/OCA/server-backend/base_external_system/tests/test_external_system.py", line 28, in test_check_fingerprint_allowed

    self.record.write({"ignore_fingerprint": False, "fingerprint": "Data"})

  File "/home/travis/odoo-13.0/odoo/models.py", line 3573, in write

    fields[0].determine_inverse(real_recs)

  File "/home/travis/odoo-13.0/odoo/fields.py", line 1122, in determine_inverse

    self.inverse(records)

  File "/home/travis/odoo-13.0/odoo/fields.py", line 594, in _inverse_related

    target[field.name] = record_value[record]

  File "/home/travis/odoo-13.0/odoo/models.py", line 5629, in __setitem__

    return self._fields[key].__set__(self, value)

  File "/home/travis/odoo-13.0/odoo/fields.py", line 1087, in __set__

    records.write({self.name: write_value})

  File "/home/travis/odoo-13.0/odoo/models.py", line 3568, in write

    real_recs._validate_fields(set(vals) - set(inverse_fields))

  File "/home/travis/odoo-13.0/odoo/models.py", line 1176, in _validate_fields

    check(self)
This commit is contained in:
Ronald Portier
2020-08-21 12:09:22 +02:00
committed by Pedro M. Baeza
parent bc7f038b54
commit a141799fe5
4 changed files with 41 additions and 23 deletions

View File

@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_external_system
# * base_external_system
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -28,7 +28,7 @@ msgid "Companies"
msgstr ""
#. module: base_external_system
#: sql_constraint:external.system:0
#: model:ir.model.constraint,message:base_external_system.constraint_external_system_name_uniq
msgid "Connection name must be unique."
msgstr ""
@@ -85,7 +85,7 @@ msgid "Fingerprint"
msgstr ""
#. module: base_external_system
#: code:addons/base_external_system/models/external_system.py:90
#: code:addons/base_external_system/models/external_system.py:0
#, python-format
msgid "Fingerprint cannot be empty when Ignore Fingerprint is not checked."
msgstr ""
@@ -204,7 +204,9 @@ msgstr ""
#: model:ir.model.fields,help:base_external_system.field_external_system__ignore_fingerprint
#: model:ir.model.fields,help:base_external_system.field_external_system_adapter__ignore_fingerprint
#: model:ir.model.fields,help:base_external_system.field_external_system_os__ignore_fingerprint
msgid "Set this to `True` in order to ignore an invalid/unknown fingerprint from the system."
msgid ""
"Set this to `True` in order to ignore an invalid/unknown fingerprint from "
"the system."
msgstr ""
#. module: base_external_system
@@ -226,7 +228,7 @@ msgid "Test Connection"
msgstr ""
#. module: base_external_system
#: code:addons/base_external_system/models/external_system_adapter.py:70
#: code:addons/base_external_system/models/external_system_adapter.py:0
#, python-format
msgid "The connection was a success."
msgstr ""
@@ -249,28 +251,36 @@ msgstr ""
#: model:ir.model.fields,help:base_external_system.field_external_system__fingerprint
#: model:ir.model.fields,help:base_external_system.field_external_system_adapter__fingerprint
#: model:ir.model.fields,help:base_external_system.field_external_system_os__fingerprint
msgid "This is the fingerprint that is advertised by this system in order to validate its identity."
msgid ""
"This is the fingerprint that is advertised by this system in order to "
"validate its identity."
msgstr ""
#. module: base_external_system
#: model:ir.model.fields,help:base_external_system.field_external_system__interface
#: model:ir.model.fields,help:base_external_system.field_external_system_adapter__interface
#: model:ir.model.fields,help:base_external_system.field_external_system_os__interface
msgid "This is the interface that this system represents. It is created automatically upon creation of the external system."
msgid ""
"This is the interface that this system represents. It is created "
"automatically upon creation of the external system."
msgstr ""
#. module: base_external_system
#: model:ir.model.fields,help:base_external_system.field_external_system__password
#: model:ir.model.fields,help:base_external_system.field_external_system_adapter__password
#: model:ir.model.fields,help:base_external_system.field_external_system_os__password
msgid "This is the password that is used for authenticating to this system, if applicable."
msgid ""
"This is the password that is used for authenticating to this system, if "
"applicable."
msgstr ""
#. module: base_external_system
#: model:ir.model.fields,help:base_external_system.field_external_system__private_key_password
#: model:ir.model.fields,help:base_external_system.field_external_system_adapter__private_key_password
#: model:ir.model.fields,help:base_external_system.field_external_system_os__private_key_password
msgid "This is the password to unlock the private key that was provided for this sytem."
msgid ""
"This is the password to unlock the private key that was provided for this "
"sytem."
msgstr ""
#. module: base_external_system
@@ -284,14 +294,18 @@ msgstr ""
#: model:ir.model.fields,help:base_external_system.field_external_system__private_key
#: model:ir.model.fields,help:base_external_system.field_external_system_adapter__private_key
#: model:ir.model.fields,help:base_external_system.field_external_system_os__private_key
msgid "This is the private key that is used for authenticating to this system, if applicable."
msgid ""
"This is the private key that is used for authenticating to this system, if "
"applicable."
msgstr ""
#. module: base_external_system
#: model:ir.model.fields,help:base_external_system.field_external_system__username
#: model:ir.model.fields,help:base_external_system.field_external_system_adapter__username
#: model:ir.model.fields,help:base_external_system.field_external_system_os__username
msgid "This is the username that is used for authenticating to this system, if applicable."
msgid ""
"This is the username that is used for authenticating to this system, if "
"applicable."
msgstr ""
#. module: base_external_system
@@ -301,4 +315,3 @@ msgstr ""
#: model_terms:ir.ui.view,arch_db:base_external_system.external_system_view_search
msgid "Username"
msgstr ""