Files
odoo_source/addons/note_pad/models/note.py
T
Nicolas Martinelli 4badf49ad0 [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
2018-03-05 08:42:11 +01:00

15 lines
344 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class NotePad(models.Model):
_name = 'note.note'
_inherit = ['pad.common', 'note.note']
_pad_fields = ['note_pad']
note_pad_url = fields.Char('Pad Url', pad_content_field='memo', copy=False)