summaryrefslogtreecommitdiff
path: root/odoo/addons/test_new_api
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2020-10-13 12:01:34 +0000
committerRaphael Collet <rco@odoo.com>2020-10-13 17:05:20 +0000
commit3563738ca5dd97791d5f32d8ffc40d07a8a95386 (patch)
tree29b5497f7266a422da289bad8edd426a264a9735 /odoo/addons/test_new_api
parent9b71458937fd15f357923434b41f95eb95af57a1 (diff)
[FIX] core: assignment of binary field on new record with origin
The assignment of a binary field on a new record with origin did actually modify the attachment storing the value of the field on the origin record! The fix is simply to avoid messing up with attachments when updating new records. closes odoo/odoo#59918 X-original-commit: 6778c4c10fa68c46bde6fae176f547f905e9c02f Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo/addons/test_new_api')
-rw-r--r--odoo/addons/test_new_api/tests/test_new_fields.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/odoo/addons/test_new_api/tests/test_new_fields.py b/odoo/addons/test_new_api/tests/test_new_fields.py
index 441362e7038..f93baf0e83e 100644
--- a/odoo/addons/test_new_api/tests/test_new_fields.py
+++ b/odoo/addons/test_new_api/tests/test_new_fields.py
@@ -1965,6 +1965,10 @@ class TestFields(TransactionCaseWithUserDemo):
self.assertEqual(record.image, image_h)
self.assertEqual(new_record.image, image_h)
+ # assignment to new record with origin should not do any query
+ with self.assertQueryCount(0):
+ new_record.image = image_w
+
def test_95_binary_bin_size(self):
binary_value = base64.b64encode(b'content')
binary_size = b'7.00 bytes'