From 4badf49ad0b5e3b269e725d1a0dd12a65ec68e48 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 2 Mar 2018 10:04:57 +0100 Subject: [FIX] pad, pad_project, note_pad: duplicate object The duplication of a task crashes at the following: `content = myPad.getHtml(path).get('html', '')` The copy mechanism is quite cumbersome: - In `copy` method, generate an URL of a pad which doesn't exist since `object_id` is still undefined. - The `create` method somehow attempts to fill in the previously created pad thanks to `_set_pad_value`. The logic is made simpler. The pad URL field is set as `copy=False`, therefore the create mechanism will take care of handling the pad creation and its synchronization. opw-1818757 --- addons/note_pad/models/note.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/note_pad/models/note.py') diff --git a/addons/note_pad/models/note.py b/addons/note_pad/models/note.py index 080e313a873..49536d79b88 100644 --- a/addons/note_pad/models/note.py +++ b/addons/note_pad/models/note.py @@ -11,4 +11,4 @@ class NotePad(models.Model): _pad_fields = ['note_pad'] - note_pad_url = fields.Char('Pad Url', pad_content_field='memo') + note_pad_url = fields.Char('Pad Url', pad_content_field='memo', copy=False) -- cgit v1.2.3