diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 62d9962634a..111f511e9fc 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -44,6 +44,7 @@ Notes can be found in the 'Home' menu. 'pad', ], 'data': [ + 'security/res.groups.csv', 'security/note_security.xml', 'security/ir.model.access.csv', 'note_data.xml', diff --git a/addons/note/note.py b/addons/note/note.py index bce54566e64..6acb3884cd7 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -21,6 +21,7 @@ from openerp.osv import osv, fields from tools.translate import _ +import re class note_stage(osv.osv): """ Category of Note """ @@ -39,6 +40,15 @@ class note_stage(osv.osv): 'sequence' : 1, } +class note_tag(osv.osv): + + _name = "note.tag" + _description = "User can make tags on his note." + + _columns = { + 'name' : fields.char('Tag name', size=64, required=True), + } + class note_note(osv.osv): """ Note """ _name = 'note.note' @@ -52,7 +62,11 @@ class note_note(osv.osv): def _get_note_first_line(self, cr, uid, ids, name, args, context=None): res = {} for note in self.browse(cr, uid, ids, context=context): - res[note.id] = (note.note or '').strip().split('\n')[0] + text_note = (note.note or '').strip().split('\n')[0] + text_note = re.sub(r'(|

|)[\s\S]*','',text_note) + text_note = re.sub(r'<[^>]+>','',text_note) + res[note.id] = text_note + return res def _get_default_stage_id(self,cr,uid,context=None): @@ -70,16 +84,42 @@ class note_note(osv.osv): result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context) return result + def onclick_note_is_done(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, { 'active' : False, 'date_done' : fields.date.today() }) + + self.message_post(cr, uid, ids[0], body='This note is active', subject=False, + type='notification', parent_id=False, attachments=None, context=context) + + return False + + def onclick_note_not_done(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, { 'active' : True }) + + self.message_post(cr, uid, ids[0], body='This note is done', subject=False, + type='notification', parent_id=False, attachments=None, context=context) + + return False + + _columns = { - 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, string='Note Summary', type="text"), - 'note': fields.text('Pad Content'), + 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, string='Note Summary', type='text'), + 'note': fields.html('Pad Content'), 'note_pad_url': fields.char('Pad Url', size=250), 'sequence': fields.integer('Sequence'), + # the stage_id depending on the uid 'stage_id': fields.many2one('note.stage', 'Stage'), + + # ERROR for related & stage_ids => group_by for kanban + #'stage_id': fields.related('stage_ids', 'id', string='Stage', type="many2one", relation="note.stage"), + # stage per user + #'stage_ids': fields.many2many('note.stage','note_stage_rel','note_id','stage_id','Linked stages users'), + 'active': fields.boolean('Active'), + # when the user unactivate the note, record de date for un display note after 1 days + 'date_done': fields.date('Date done'), 'color': fields.integer('Color Index'), - # to be replaced by message_follower_ids - 'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers') + # put tags on the note (optional) + 'tag_ids' : fields.many2many('note.tag','note_tags_rel','note_id','tag_id','Tags'), } _defaults = { @@ -91,3 +131,4 @@ class note_note(osv.osv): _group_by_full = { 'stage_id' : _read_group_stage_ids, } + diff --git a/addons/note/note_demo.xml b/addons/note/note_demo.xml index e6ab25198a6..9c3e0457616 100644 --- a/addons/note/note_demo.xml +++ b/addons/note/note_demo.xml @@ -3,24 +3,22 @@ - + 2 + - @@ -29,26 +27,7 @@ - @@ -57,10 +36,8 @@ - + @@ -68,34 +45,21 @@ - + - 3 - + @@ -114,6 +78,52 @@ + + + + + + 3 + + + + + + + + + + + + + + + + + + + 5 - + 7 - + - + + -
- -
- í -
    -
  • Edit...
  • -
  • Delete
  • -
    • -
    +
    +
    + + D + C + + + +
    + í +
    -
    +
    -
    - - +
    + +
    @@ -96,7 +104,8 @@
    - + +
    @@ -113,6 +122,8 @@ + + @@ -128,9 +139,10 @@ form kanban,tree,form + {'search_default_active_true':True} - + \ No newline at end of file diff --git a/addons/note/security/note_security.xml b/addons/note/security/note_security.xml index 46eebee629c..3710d79839e 100644 --- a/addons/note/security/note_security.xml +++ b/addons/note/security/note_security.xml @@ -5,7 +5,7 @@ My notes - [('follower_ids','=',user.id)] + [('message_follower_ids','=',user.partner_id.id)] diff --git a/addons/note/security/res.groups.csv b/addons/note/security/res.groups.csv new file mode 100644 index 00000000000..61f38c84104 --- /dev/null +++ b/addons/note/security/res.groups.csv @@ -0,0 +1,3 @@ +id,name,implied_ids/id +group_note_tags,Note : display tags, +group_note_fancy,Note : fancy mode, diff --git a/addons/note/static/src/css/note.css b/addons/note/static/src/css/note.css index 7e79438b46a..60d7541097e 100644 --- a/addons/note/static/src/css/note.css +++ b/addons/note/static/src/css/note.css @@ -1,78 +1,73 @@ -.openerp .oe_notes .oe_fold_column .oe_kanban_card { - text-decoration:none; - color:#000; - display:block; - padding:1em; - margin-right: 1em; - margin-bottom: 1em; - - -moz-box-shadow:5px 5px 7px rgba(33,33,33,1); - -webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7); - box-shadow: 5px 5px 7px rgba(33,33,33,.7); +@charset "utf-8"; +@font-face { + font-family: "mnmliconsRegular"; + src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); + src: url("/web/static/src/font/mnmliconsv21-webfont.woff") format("woff"); + src: url("/web/static/src/font/mnmliconsv21-webfont.ttf") format("truetype"); + src: url("/web/static/src/font/mnmliconsv21-webfont.svg") format("svg") active; + font-weight: normal; + font-style: normal; } -.openerp .oe_notes .oe_kanban_record .oe_kanban_card { - -webkit-transform: rotate(-2deg); - -o-transform: rotate(-2deg); - -moz-transform:rotate(-2deg); +@font-face { + font-family: "EntypoRegular"; + src: url("/web/static/src/font/entypo-webfont.eot") format("eot"); + src: url("/web/static/src/font/entypo-webfont.eot?#iefix") format("embedded-opentype"); + src: url("/web/static/src/font/entypo-webfont.woff") format("woff"); + src: url("/web/static/src/font/entypo-webfont.ttf") format("truetype"); + src: url("/web/static/src/font/entypo-webfont.svg") format("svg") active; + font-weight: normal; + font-style: normal; } -.openerp .oe_notes .oe_kanban_record:nth-of-type(even) .oe_kanban_card { - -webkit-transform: rotate(1deg); - -o-transform: rotate(1deg); - -moz-transform:rotate(1deg); +@-moz-keyframes bounce { + 0% { + -moz-transform: scale(0); + opacity: 0; + } + + 50% { + -moz-transform: scale(1.3); + opacity: 0.4; + } + + 75% { + -moz-transform: scale(0.9); + opacity: 0.7; + } + + 100% { + -moz-transform: scale(1); + opacity: 1; + } } -.openerp .oe_notes .oe_kanban_record:nth-of-type(3n) .oe_kanban_card { - -webkit-transform: rotate(4deg); - -o-transform: rotate(4deg); - -moz-transform:rotate(4deg); +@-webkit-keyframes bounce { + 0% { + -webkit-transform: scale(0); + opacity: 0; + } + + 50% { + -webkit-transform: scale(1.3); + opacity: 0.4; + } + + 75% { + -webkit-transform: scale(0.9); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + opacity: 1; + } } -.openerp .oe_notes .oe_kanban_column:nth-of-type(even) .oe_kanban_record .oe_kanban_card { - -webkit-transform: rotate(2deg); - -o-transform: rotate(2deg); - -moz-transform:rotate(2deg); +.oe_kanban_color_2 { + background-color: red; } -.openerp .oe_notes .oe_kanban_column:nth-of-type(even) .oe_kanban_record:nth-of-type(even) .oe_kanban_card { - -webkit-transform: rotate(-3deg); - -o-transform: rotate(-3deg); - -moz-transform:rotate(-3deg); -} - -.openerp .oe_notes .oe_kanban_column:nth-of-type(even) .oe_kanban_record:nth-of-type(3n) .oe_kanban_card { - -webkit-transform: rotate(1deg); - -o-transform: rotate(1deg); - -moz-transform:rotate(1deg); -} - -.openerp .oe_notes .oe_kanban_column:nth-of-type(3n) .oe_kanban_record .oe_kanban_card { - -webkit-transform: rotate(-2deg); - -o-transform: rotate(-2deg); - -moz-transform:rotate(-2deg); -} - -.openerp .oe_notes .oe_kanban_column:nth-of-type(3n) .oe_kanban_record:nth-of-type(even) .oe_kanban_card { - -webkit-transform: rotate(1deg); - -o-transform: rotate(1deg); - -moz-transform:rotate(1deg); -} - -.openerp .oe_notes .oe_kanban_column:nth-of-type(3n) .oe_kanban_record:nth-of-type(3n) .oe_kanban_card { - -webkit-transform: rotate(-1deg); - -o-transform: rotate(-1deg); - -moz-transform:rotate(-1deg); -} - -.openerp .oe_notes .oe_kanban_column .oe_fold_column .oe_kanban_card:hover, -.openerp .oe_notes .oe_kanban_column .oe_fold_column .oe_kanban_card:focus { - box-shadow:10px 10px 7px rgba(0,0,0,.7); - -moz-box-shadow:10px 10px 7px rgba(0,0,0,.7); - -webkit-box-shadow: 10px 10px 7px rgba(0,0,0,.7); - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - position:relative; - z-index:5; +.oe_kanban_column .note_text_line_through { + text-decoration: line-through; } diff --git a/addons/note/static/src/css/note.sass b/addons/note/static/src/css/note.sass index cd04015dcbb..92cb0c9bcd8 100644 --- a/addons/note/static/src/css/note.sass +++ b/addons/note/static/src/css/note.sass @@ -131,7 +131,9 @@ $sheet-max-width: 860px .oe_kanban_color_2 - background-color:red + background-color: red // au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" +.oe_kanban_column .note_text_line_through + text-decoration: line-through