From 481c300cc5b98ffca245fa59573063513074a0d8 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Sep 2012 11:17:08 +0200 Subject: [PATCH 01/11] [IMP] note: add button and search filters on kanban view for active/inactive notes. Add note.tag. Html field on form view. bzr revid: chm@openerp.com-20120907091708-z9x8g9tzdu6e7oad --- addons/note/__openerp__.py | 1 + addons/note/note.py | 51 +++++++++- addons/note/note_demo.xml | 126 +++++++++++++----------- addons/note/note_view.xml | 44 ++++++--- addons/note/security/note_security.xml | 2 +- addons/note/security/res.groups.csv | 3 + addons/note/static/src/css/note.css | 129 ++++++++++++------------- addons/note/static/src/css/note.sass | 4 +- 8 files changed, 212 insertions(+), 148 deletions(-) create mode 100644 addons/note/security/res.groups.csv 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 From b49b72f00ec2d818338aa8af008ac8337ba990df Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Sep 2012 13:56:04 +0200 Subject: [PATCH 02/11] [IMP] note : split of note module : note module & note_pad module bzr revid: chm@openerp.com-20120907115604-wmp8rxec0fk9508r --- addons/note/note.py | 5 +-- addons/note/note_demo.xml | 58 +++++++++++++++---------------- addons/note/note_view.xml | 1 - addons/note_pad/__init__.py | 23 ++++++++++++ addons/note_pad/__openerp__.py | 50 ++++++++++++++++++++++++++ addons/note_pad/note_pad.py | 40 +++++++++++++++++++++ addons/note_pad/note_pad_view.xml | 16 +++++++++ 7 files changed, 159 insertions(+), 34 deletions(-) create mode 100644 addons/note_pad/__init__.py create mode 100644 addons/note_pad/__openerp__.py create mode 100644 addons/note_pad/note_pad.py create mode 100644 addons/note_pad/note_pad_view.xml diff --git a/addons/note/note.py b/addons/note/note.py index 6acb3884cd7..985cacd3404 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -52,8 +52,7 @@ class note_tag(osv.osv): class note_note(osv.osv): """ Note """ _name = 'note.note' - _inherit = ['mail.thread','pad.common'] - _pad_fields = ['note_pad'] + _inherit = ['mail.thread'] _description = "Note" def _set_note_first_line(self, cr, uid, id, name, value, args, context=None): @@ -104,7 +103,6 @@ class note_note(osv.osv): _columns = { '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'), @@ -125,7 +123,6 @@ class note_note(osv.osv): _defaults = { 'active' : 1, 'stage_id' : _get_default_stage_id, - 'note_pad_url': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), } _order = 'sequence asc' _group_by_full = { diff --git a/addons/note/note_demo.xml b/addons/note/note_demo.xml index 9c3e0457616..c46846c53f7 100644 --- a/addons/note/note_demo.xml +++ b/addons/note/note_demo.xml @@ -4,10 +4,10 @@
    * Calendar app in Home +
    * The base_calendar module should create a menu in Home, like described above. +
    * This module should become a main application (in the first screen at installation) +
    * We should use the term Calendar, not Meeting. ]]>
    @@ -18,7 +18,7 @@
    * Followed by the telephone conversation and mail about D.544.3 ]]>
    @@ -28,7 +28,7 @@ +

    ]]>
    @@ -37,7 +37,7 @@ +

    ]]>
    @@ -46,8 +46,8 @@ * stuffed turkey +
    * wine ]]>
    @@ -57,7 +57,7 @@
    * Create a module note_pad it transforms the html editable note text field into widget='pad', similar to project_pad depends on 'note' and 'pad' modules ]]>
    @@ -68,8 +68,8 @@
    * Open ERP: a modern approach to integrated business management +
    * Open ERP for Retail and Industrial Management ]]>
    @@ -79,19 +79,19 @@
    * Motherboard according to processor - * Processor +
    * Processor need to decide - * Graphic card +
    * Graphic card with great performance for games ! - * Hard drive +
    * Hard drive big, for lot of internet backups - * Tower +
    * Tower silent, better when watching films - * Blueray drive ? +
    * Blueray drive ? is it interesting yet ? - * Screen +
    * Screen a big one, full of pixels, of course ! ]]>
    @@ -103,8 +103,8 @@
    * Open ERP: a modern approach to integrated business management +
    * Open ERP for Retail and Industrial Management ]]>
    @@ -114,8 +114,8 @@
    * Open ERP: a modern approach to integrated business management +
    * Open ERP for Retail and Industrial Management ]]>
    @@ -125,8 +125,8 @@
    * Open ERP: a modern approach to integrated business management +
    * Open ERP for Retail and Industrial Management ]]>
    @@ -137,8 +137,8 @@
    * Open ERP: a modern approach to integrated business management +
    * Open ERP for Retail and Industrial Management ]]>
    @@ -149,8 +149,8 @@
    * Open ERP: a modern approach to integrated business management +
    * Open ERP for Retail and Industrial Management ]]>
    diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 640b6ce010e..b7e76c5fe5e 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -106,7 +106,6 @@ -
    diff --git a/addons/note_pad/__init__.py b/addons/note_pad/__init__.py new file mode 100644 index 00000000000..44a484adac4 --- /dev/null +++ b/addons/note_pad/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import note_pad + diff --git a/addons/note_pad/__openerp__.py b/addons/note_pad/__openerp__.py new file mode 100644 index 00000000000..7eee5eee487 --- /dev/null +++ b/addons/note_pad/__openerp__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Notes pad', + 'version': '0.1', + 'category': 'Tools', + 'description': """ +This module update notes inside OpenERP for using an external pad +=================================================================== + +Use for update your text note in real time with the following user that you invite. + +""", + 'author': 'OpenERP SA', + 'website': 'http://openerp.com', + 'summary': 'Sticky Notes, Collaborative', + 'depends': [ + 'base_tools', + 'mail', + 'pad', + 'note', + ], + 'data': [ + 'note_pad_view.xml', + ], + 'installable': True, + 'application': False, + 'auto_install': False, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/note_pad/note_pad.py b/addons/note_pad/note_pad.py new file mode 100644 index 00000000000..73cc9d76a62 --- /dev/null +++ b/addons/note_pad/note_pad.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import osv, fields +from tools.translate import _ + +class note_pad_note(osv.osv): + """ Note pad """ + + _name = 'note.note' + _inherit = ['pad.common','note.note'] + + _pad_fields = ['note_pad'] + _description = "Note pad" + + _columns = { + 'note_pad_url': fields.char('Pad Url', size=250), + } + + _defaults = { + 'note_pad_url': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), + } diff --git a/addons/note_pad/note_pad_view.xml b/addons/note_pad/note_pad_view.xml new file mode 100644 index 00000000000..fd5c48d7f2a --- /dev/null +++ b/addons/note_pad/note_pad_view.xml @@ -0,0 +1,16 @@ + + + + + note_pad.view.form + note.note + + + + + + + + + + From 7dd65a0f9ba6ca0c59addc22f2b3fed6e9f56504 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Sep 2012 14:25:06 +0200 Subject: [PATCH 03/11] note : constraint for note min len bzr revid: chm@openerp.com-20120907122506-fs6d3vvqowr2m6yk --- addons/note/note.py | 19 +++++++++++++++++-- addons/note/note_view.xml | 6 ++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index 985cacd3404..1b5704eb601 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -55,10 +55,10 @@ class note_note(osv.osv): _inherit = ['mail.thread'] _description = "Note" - def _set_note_first_line(self, cr, uid, id, name, value, args, context=None): + def _set_note_first_line(self, cr, uid, id, name, value, args={}, context=None): return self.write(cr, uid, [id], {'note': value}, context=context) - def _get_note_first_line(self, cr, uid, ids, name, args, context=None): + def _get_note_first_line(self, cr, uid, ids, name="", args={}, context=None): res = {} for note in self.browse(cr, uid, ids, context=context): text_note = (note.note or '').strip().split('\n')[0] @@ -99,6 +99,16 @@ class note_note(osv.osv): return False + def _constraints_min_len(self, cr, uid, ids, context=None): + + res = self._get_note_first_line(cr, uid, ids, context=context) + + for note in self.browse(cr, uid, ids, context=context): + if len(res[note.id])<1 : + return False + + return True + _columns = { 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, string='Note Summary', type='text'), @@ -120,9 +130,14 @@ class note_note(osv.osv): 'tag_ids' : fields.many2many('note.tag','note_tags_rel','note_id','tag_id','Tags'), } + _constraints = [ + (_constraints_min_len,'The title (first line on the note) must have at least one character.',['note']), + ] + _defaults = { 'active' : 1, 'stage_id' : _get_default_stage_id, + 'note': " " } _order = 'sequence asc' _group_by_full = { diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index b7e76c5fe5e..63dd8afcd1b 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -104,8 +104,10 @@
    - - + + + +
    From 22d1ff0c82585beb6ac999cc7b10d98d6107a8cd Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 10 Sep 2012 09:24:59 +0200 Subject: [PATCH 04/11] note : add comments and change name in 'Memo' bzr revid: chm@openerp.com-20120910072459-tlue035os3ci1pbz --- addons/note/__openerp__.py | 16 ++++++++-------- addons/note/note.py | 29 +++++++++++++++++++++-------- addons/note/note_view.xml | 10 +++++----- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 111f511e9fc..2e02ac567c7 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -20,24 +20,24 @@ ############################################################################## { - 'name': 'Notes', + 'name': 'Memos', 'version': '0.1', 'category': 'Tools', 'description': """ -This module allows users to create their own notes inside OpenERP +This module allows users to create their own memos inside OpenERP ================================================================= -Use notes to write meeting minutes, organize ideas, organize personnal todo -lists, etc. Each user manages his own personnal notes. Notes are available to -their authors only, but they can share notes to others users so that several -people can work on the same note in real time. It's very efficient to share +Use memos to write meeting minutes, organize ideas, organize personnal todo +lists, etc. Each user manages his own personnal memos. Memos are available to +their authors only, but they can share memos to others users so that several +people can work on the same memo in real time. It's very efficient to share meeting minutes. -Notes can be found in the 'Home' menu. +Memos can be found in the 'Home' menu. """, 'author': 'OpenERP SA', 'website': 'http://openerp.com', - 'summary': 'Sticky Notes, Collaborative', + 'summary': 'Sticky Memos, Collaborative', 'depends': [ 'base_tools', 'mail', diff --git a/addons/note/note.py b/addons/note/note.py index 1b5704eb601..7387d1c3d54 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -23,10 +23,11 @@ from openerp.osv import osv, fields from tools.translate import _ import re +#every user can create his name of stage for his notes class note_stage(osv.osv): """ Category of Note """ _name = "note.stage" - _description = "Note Stage" + _description = "Memo Stage" _columns = { 'name': fields.char('Category Name', size=64, required=True), 'sequence': fields.integer('Sequence', help="Used to order the note stages"), @@ -40,24 +41,30 @@ class note_stage(osv.osv): 'sequence' : 1, } +#Object for tagging the diferent note. The tagging is shared with all follower class note_tag(osv.osv): _name = "note.tag" - _description = "User can make tags on his note." + _description = "User can make tags on his memo." _columns = { 'name' : fields.char('Tag name', size=64, required=True), } +#object note is kanban view orriented. The first line of the notes are put on the +#kanban view like a title. An upgrade note_pad, can make a pad object in the form view. +#The user can unactivate a note, this note disapear after one days. class note_note(osv.osv): """ Note """ _name = 'note.note' _inherit = ['mail.thread'] - _description = "Note" + _description = "Memo" + #writing method (no modification of values) def _set_note_first_line(self, cr, uid, id, name, value, args={}, context=None): return self.write(cr, uid, [id], {'note': value}, context=context) + #read the first line (convert hml into text) def _get_note_first_line(self, cr, uid, ids, name="", args={}, context=None): res = {} for note in self.browse(cr, uid, ids, context=context): @@ -68,10 +75,13 @@ class note_note(osv.osv): return res + #return the default stage for the uid user def _get_default_stage_id(self,cr,uid,context=None): ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)]) return ids and ids[0] or False + #nead IMP : return the list of stage for the uid user + #because one note can have more of one stage (one stage per note and per user) def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None): access_rights_uid = access_rights_uid or uid stage_obj = self.pool.get('note.stage') @@ -83,22 +93,25 @@ class note_note(osv.osv): result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context) return result + #unactivate a note and record the date 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, + self.message_post(cr, uid, ids[0], body='This memo is active', subject=False, type='notification', parent_id=False, attachments=None, context=context) return False + #activate a note 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, + self.message_post(cr, uid, ids[0], body='This memo is done', subject=False, type='notification', parent_id=False, attachments=None, context=context) return False + #look that the title (first line of the note) have more of one caracter def _constraints_min_len(self, cr, uid, ids, context=None): res = self._get_note_first_line(cr, uid, ids, context=context) @@ -109,9 +122,9 @@ class note_note(osv.osv): return True - + _columns = { - 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, string='Note Summary', type='text'), + 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, string='Memo Summary', type='text'), 'note': fields.html('Pad Content'), 'sequence': fields.integer('Sequence'), # the stage_id depending on the uid @@ -131,7 +144,7 @@ class note_note(osv.osv): } _constraints = [ - (_constraints_min_len,'The title (first line on the note) must have at least one character.',['note']), + (_constraints_min_len,'The title (first line on the memo) must have at least one character.',['note']), ] _defaults = { diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 63dd8afcd1b..2a2d7d8af8a 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -9,7 +9,7 @@ note.stage.form note.stage -
    + @@ -23,7 +23,7 @@ note.stage - + @@ -100,7 +100,7 @@ note.note.form note.note - +
    @@ -120,8 +120,8 @@ note.note.search note.note - - + + From 5ea9342dc52e82fc492d84ea3837c58767b95eba Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 11 Sep 2012 11:49:48 +0200 Subject: [PATCH 05/11] [IMP] note : tags on kanban bzr revid: chm@openerp.com-20120911094948-hr4odql5k1dmief4 --- addons/note/__openerp__.py | 3 +- addons/note/note.py | 90 ++++++++++++---------- addons/note/note_demo.xml | 28 +++---- addons/note/note_view.xml | 95 +++++++++++++++++------- addons/note/security/ir.model.access.csv | 4 +- addons/note/security/res.groups.csv | 5 +- addons/note/static/src/css/Makefile | 4 +- addons/note/static/src/css/note.css | 70 +++++++++++++++++ addons/note/static/src/css/note.sass | 86 +++++++++++++++++++-- addons/note_pad/__init__.py | 2 +- addons/note_pad/__openerp__.py | 8 +- addons/note_pad/note_pad.py | 4 +- addons/note_pad/note_pad_view.xml | 2 +- 13 files changed, 298 insertions(+), 103 deletions(-) diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 2e02ac567c7..c0c05c4cdb9 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -37,11 +37,10 @@ Memos can be found in the 'Home' menu. """, 'author': 'OpenERP SA', 'website': 'http://openerp.com', - 'summary': 'Sticky Memos, Collaborative', + 'summary': 'Sticky notes, Collaborative, Memos', 'depends': [ 'base_tools', 'mail', - 'pad', ], 'data': [ 'security/res.groups.csv', diff --git a/addons/note/note.py b/addons/note/note.py index 7387d1c3d54..ed69214f97d 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -23,15 +23,14 @@ from openerp.osv import osv, fields from tools.translate import _ import re -#every user can create his name of stage for his notes class note_stage(osv.osv): - """ Category of Note """ + """ Category of memo """ _name = "note.stage" _description = "Memo Stage" _columns = { 'name': fields.char('Category Name', size=64, required=True), - 'sequence': fields.integer('Sequence', help="Used to order the note stages"), - 'user_id': fields.many2one('res.users', 'Owner', help="Owner of the note stage.", required=True, readonly=True), + 'sequence': fields.integer('Sequence', help="Used to order the memo stages"), + 'user_id': fields.many2one('res.users', 'Owner', help="Owner of the memo stage.", required=True, readonly=True), 'fold': fields.boolean('Folded'), } _order = 'sequence asc' @@ -41,34 +40,30 @@ class note_stage(osv.osv): 'sequence' : 1, } -#Object for tagging the diferent note. The tagging is shared with all follower class note_tag(osv.osv): _name = "note.tag" - _description = "User can make tags on his memo." + _description = "User can make tags on his note." _columns = { 'name' : fields.char('Tag name', size=64, required=True), } -#object note is kanban view orriented. The first line of the notes are put on the -#kanban view like a title. An upgrade note_pad, can make a pad object in the form view. -#The user can unactivate a note, this note disapear after one days. class note_note(osv.osv): - """ Note """ + """ memo """ _name = 'note.note' _inherit = ['mail.thread'] _description = "Memo" #writing method (no modification of values) def _set_note_first_line(self, cr, uid, id, name, value, args={}, context=None): - return self.write(cr, uid, [id], {'note': value}, context=context) + return self.write(cr, uid, [id], {'memo': value}, context=context) #read the first line (convert hml into text) def _get_note_first_line(self, cr, uid, ids, name="", args={}, context=None): res = {} for note in self.browse(cr, uid, ids, context=context): - text_note = (note.note or '').strip().split('\n')[0] + text_note = (note.memo 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 @@ -80,20 +75,7 @@ class note_note(osv.osv): ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)]) return ids and ids[0] or False - #nead IMP : return the list of stage for the uid user - #because one note can have more of one stage (one stage per note and per user) - def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None): - access_rights_uid = access_rights_uid or uid - stage_obj = self.pool.get('note.stage') - - # only show stage groups not folded and owned by user - search_domain = [('fold', '=', False),('user_id', '=', uid)] - - stage_ids = stage_obj._search(cr, uid, search_domain, order=self._order, access_rights_uid=access_rights_uid, context=context) - result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context) - return result - - #unactivate a note and record the date + #unactivate a memo and record the date def onclick_note_is_done(self, cr, uid, ids, context=None): self.write(cr, uid, ids, { 'active' : False, 'date_done' : fields.date.today() }) @@ -102,16 +84,16 @@ class note_note(osv.osv): return False - #activate a note + #activate a memo 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 memo is done', subject=False, + self.message_post(cr, uid, ids[0], body='This memo is close', subject=False, type='notification', parent_id=False, attachments=None, context=context) return False - #look that the title (first line of the note) have more of one caracter + #look that the title (first line of the memo) have more of one caracter def _constraints_min_len(self, cr, uid, ids, context=None): res = self._get_note_first_line(cr, uid, ids, context=context) @@ -121,11 +103,28 @@ class note_note(osv.osv): return False return True - - + + + #used for undisplay the follower if it's the current user + def _get_my_current_partner(self, cr, uid, ids, name, args, context=None): + user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + pid = user.partner_id and user.partner_id.id or False + + result = {} + for record in self.browse(cr, uid, ids, context=context): + result[record.id]=pid + + return result + + + _columns = { - 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, string='Memo Summary', type='text'), - 'note': fields.html('Pad Content'), + 'name': fields.function(_get_note_first_line, + fnct_inv=_set_note_first_line, + string='Memo Summary', + type='text', + store=True), + 'memo': fields.html('Pad Content'), 'sequence': fields.integer('Sequence'), # the stage_id depending on the uid 'stage_id': fields.many2one('note.stage', 'Stage'), @@ -136,24 +135,35 @@ class note_note(osv.osv): #'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 + # when the user unactivate the memo, record de date for un display memo after 1 days 'date_done': fields.date('Date done'), 'color': fields.integer('Color Index'), - # put tags on the note (optional) + # put tags on the memo (optional) 'tag_ids' : fields.many2many('note.tag','note_tags_rel','note_id','tag_id','Tags'), + + 'current_partner_id' : fields.function(_get_my_current_partner), } _constraints = [ - (_constraints_min_len,'The title (first line on the memo) must have at least one character.',['note']), + (_constraints_min_len,'The title (first line on the memo) must have at least one character.',['memo']), ] _defaults = { 'active' : 1, 'stage_id' : _get_default_stage_id, - 'note': " " + 'memo': " " } _order = 'sequence asc' - _group_by_full = { - 'stage_id' : _read_group_stage_ids, - } + +#upgrade config setting page to configure pad, fancy and tags mode +class note_base_config_settings(osv.osv_memory): + _inherit = 'base.config.settings' + _columns = { + #install of the note_pad module => automatic with "module_" + 'module_note_pad': fields.boolean('Use an etherpad'), + #auto group user => automatic with "group_" + 'group_note_fancy': fields.boolean('Use fancy render', implied_group='note.group_note_fancy'), + 'group_note_tags': fields.boolean('Use tags for memo', implied_group='note.group_note_tags'), + 'group_note_thread': fields.boolean('Use mail thread and follower', implied_group='note.group_note_thread'), + } diff --git a/addons/note/note_demo.xml b/addons/note/note_demo.xml index c46846c53f7..22ed73deca3 100644 --- a/addons/note/note_demo.xml +++ b/addons/note/note_demo.xml @@ -3,7 +3,7 @@ -
    * Calendar app in Home
    * The base_calendar module should create a menu in Home, like described above.
    * This module should become a main application (in the first screen at installation) @@ -17,7 +17,7 @@
    -
    * Followed by the telephone conversation and mail about D.544.3 ]]>
    @@ -27,7 +27,7 @@
    -
    ]]>
    @@ -36,7 +36,7 @@
    -
    ]]>
    @@ -45,7 +45,7 @@
    - * stuffed turkey
    * wine ]]> @@ -56,9 +56,9 @@
    -
    * Create a module note_pad - it transforms the html editable note text field into widget='pad', similar to project_pad depends on 'note' and 'pad' modules + it transforms the html editable memo text field into widget='pad', similar to project_pad depends on 'memo' and 'pad' modules ]]>
    @@ -67,7 +67,7 @@
    -
    * Open ERP: a modern approach to integrated business management
    * Open ERP for Retail and Industrial Management ]]> @@ -78,7 +78,7 @@
    -
    * Motherboard according to processor
    * Processor @@ -102,7 +102,7 @@
    -
    * Open ERP: a modern approach to integrated business management
    * Open ERP for Retail and Industrial Management ]]> @@ -113,7 +113,7 @@
    -
    * Open ERP: a modern approach to integrated business management
    * Open ERP for Retail and Industrial Management ]]> @@ -124,7 +124,7 @@
    -
    * Open ERP: a modern approach to integrated business management
    * Open ERP for Retail and Industrial Management ]]> @@ -136,7 +136,7 @@
    -
    * Open ERP: a modern approach to integrated business management
    * Open ERP for Retail and Industrial Management ]]> @@ -148,7 +148,7 @@
    -
    * Open ERP: a modern approach to integrated business management
    * Open ERP for Retail and Industrial Management ]]> diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 2a2d7d8af8a..763489b0fd7 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -4,7 +4,7 @@ - + note.stage.form note.stage @@ -17,7 +17,7 @@
    - + note.stage.tree note.stage @@ -31,7 +31,7 @@
    - + Stages note.stage @@ -42,7 +42,7 @@ - + note.note.kanban note.note @@ -53,49 +53,58 @@ - + + + -
    + + + +
    - D - C + W + è
    - +
    -
    - - +
    + +
    +
    + + + +
    +
    -
    - + note.note.form note.note @@ -104,38 +113,74 @@
    - - - + + + -
    +
    +
    - + note.note.search note.note - + + + - + - + + + + note.view.general_settings.form + base.config.settings + + + + + + + + + + - Notes + note note.note form kanban,tree,form @@ -143,7 +188,7 @@ {'search_default_active_true':True} - + \ No newline at end of file diff --git a/addons/note/security/ir.model.access.csv b/addons/note/security/ir.model.access.csv index fdd6030ca51..fe523cdd2ee 100644 --- a/addons/note/security/ir.model.access.csv +++ b/addons/note/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_note_stage_user,note.stage user,model_note_stage,base.group_user,1,1,1,1 -access_note_note_user,note.note user,model_note_note,base.group_user,1,1,1,1 +access_note_stage_user,note.stage,model_note_stage,base.group_user,1,1,1,1 +access_note_note_user,note.note,model_note_note,base.group_user,1,1,1,1 diff --git a/addons/note/security/res.groups.csv b/addons/note/security/res.groups.csv index 61f38c84104..5ce1df4106c 100644 --- a/addons/note/security/res.groups.csv +++ b/addons/note/security/res.groups.csv @@ -1,3 +1,4 @@ id,name,implied_ids/id -group_note_tags,Note : display tags, -group_note_fancy,Note : fancy mode, +group_note_tags,Memo / Display tags, +group_note_fancy,Memo / Fancy mode, +group_note_thread,Memo / Mail thread, diff --git a/addons/note/static/src/css/Makefile b/addons/note/static/src/css/Makefile index d6019f4ed4a..91b3abc9333 100644 --- a/addons/note/static/src/css/Makefile +++ b/addons/note/static/src/css/Makefile @@ -1,3 +1,3 @@ -note.css: note.sass - sass -t expanded note.sass note.css +memo.css: memo.sass + sass -t expanded memo.sass memo.css diff --git a/addons/note/static/src/css/note.css b/addons/note/static/src/css/note.css index 60d7541097e..6ada8d6cd14 100644 --- a/addons/note/static/src/css/note.css +++ b/addons/note/static/src/css/note.css @@ -71,3 +71,73 @@ .oe_kanban_column .note_text_line_through { text-decoration: line-through; } + +.openerp .oe_fold_column .oe_kanban_card_fancy { + text-decoration: none; + color: black; + display: block; + padding: 1em; + margin-right: 1em; + margin-bottom: 1em; + -moz-box-shadow: 5px 5px 7px #212121; + -webkit-box-shadow: 5px 5px 7px rgba(33, 33, 33, 0.7); + box-shadow: 5px 5px 7px rgba(33, 33, 33, 0.7); +} + +.openerp .oe_kanban_record .oe_kanban_card_fancy { + -webkit-transform: rotate(-2deg); + -o-transform: rotate(-2deg); + -moz-transform: rotate(-2deg); +} +.openerp .oe_kanban_record:nth-of-type(even) .oe_kanban_card_fancy { + -webkit-transform: rotate(1deg); + -o-transform: rotate(1deg); + -moz-transform: rotate(1deg); +} +.openerp .oe_kanban_record:nth-of-type(3n) .oe_kanban_card_fancy { + -webkit-transform: rotate(4deg); + -o-transform: rotate(4deg); + -moz-transform: rotate(4deg); +} +.openerp .oe_kanban_column:nth-of-type(even) .oe_kanban_card_fancy { + -webkit-transform: rotate(2deg); + -o-transform: rotate(2deg); + -moz-transform: rotate(2deg); +} +.openerp .oe_kanban_column:nth-of-type(even) .oe_kanban_record:nth-of-type(even) .oe_kanban_card_fancy { + -webkit-transform: rotate(-3deg); + -o-transform: rotate(-3deg); + -moz-transform: rotate(-3deg); +} +.openerp .oe_kanban_column:nth-of-type(even) .oe_kanban_record:nth-of-type(3n) .oe_kanban_card_fancy { + -webkit-transform: rotate(1deg); + -o-transform: rotate(1deg); + -moz-transform: rotate(1deg); +} +.openerp .oe_kanban_column:nth-of-type(3n) .oe_kanban_card_fancy { + -webkit-transform: rotate(-2deg); + -o-transform: rotate(-2deg); + -moz-transform: rotate(-2deg); +} +.openerp .oe_kanban_column:nth-of-type(3n) .oe_kanban_record:nth-of-type(even) .oe_kanban_card_fancy { + -webkit-transform: rotate(1deg); + -o-transform: rotate(1deg); + -moz-transform: rotate(1deg); +} +.openerp .oe_kanban_column:nth-of-type(3n) .oe_kanban_record:nth-of-type(3n) .oe_kanban_card_fancy { + -webkit-transform: rotate(-1deg); + -o-transform: rotate(-1deg); + -moz-transform: rotate(-1deg); +} + +.openerp .oe_kanban_column .oe_fold_column .oe_kanban_card_fancy:hover, +.openerp .oe_kanban_column .oe_fold_column .oe_kanban_card_fancy:focus { + box-shadow: 10px 10px 7px rgba(0, 0, 0, 0.7); + -moz-box-shadow: 10px 10px 7px rgba(0, 0, 0, 0.7); + -webkit-box-shadow: 10px 10px 7px rgba(0, 0, 0, 0.7); + position: relative; + z-index: 5; + -webkit-transform: rotate(0); + -o-transform: rotate(0); + -moz-transform: rotate(0); +} diff --git a/addons/note/static/src/css/note.sass b/addons/note/static/src/css/note.sass index 92cb0c9bcd8..56aa91abc44 100644 --- a/addons/note/static/src/css/note.sass +++ b/addons/note/static/src/css/note.sass @@ -42,10 +42,10 @@ $sheet-max-width: 860px background-color: $startColor background-image: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) /* Saf4+, Chrome */ background-image: -webkit-linear-gradient(top, $startColor, $endColor) /* Chrome 10+, Saf5.1+, iOS 5+ */ - background-image: -moz-linear-gradient(top, $startColor, $endColor) /* FF3.6 */ - background-image: -ms-linear-gradient(top, $startColor, $endColor) /* IE10 */ - background-image: -o-linear-gradient(top, $startColor, $endColor) /* Opera 11.10+ */ - background-image: linear-gradient(to bottom, $startColor, $endColor) + background-image: -moz-linear-gradient(top, $startColor, $endColor) /* FF3.6 */ + background-image: -ms-linear-gradient(top, $startColor, $endColor) /* IE10 */ + background-image: -o-linear-gradient(top, $startColor, $endColor) /* Opera 11.10+ */ + background-image: linear-gradient(to bottom, $startColor, $endColor) @mixin radial-gradient($gradient) background-position: center center @@ -93,7 +93,7 @@ $sheet-max-width: 860px font-size: 1px letter-spacing: -1px color: transparent - &:before + &: before font: 21px "mnmliconsRegular" content: $icon-name color: $color @@ -133,7 +133,77 @@ $sheet-max-width: 860px .oe_kanban_color_2 background-color: red -// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" +// au BufWritePost,FileWritePost *.sass : !sass --style expanded --line-numbers > "%: p: r.css" -.oe_kanban_column .note_text_line_through - text-decoration: line-through +.oe_kanban_column + .note_text_line_through + text-decoration: line-through + + +.openerp + .oe_fold_column + .oe_kanban_card_fancy + 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) + + +@mixin rotate($a) + -webkit-transform: rotate($a) + -o-transform: rotate($a) + -moz-transform: rotate($a) + +.openerp + .oe_kanban_record + .oe_kanban_card_fancy + @include rotate(-2deg) + .oe_kanban_record:nth-of-type(even) + .oe_kanban_card_fancy + @include rotate(1deg) + .oe_kanban_record:nth-of-type(3n) + .oe_kanban_card_fancy + @include rotate(4deg) + .oe_kanban_column:nth-of-type(even) + .oe_kanban_card_fancy + @include rotate(2deg) + .oe_kanban_column:nth-of-type(even) + .oe_kanban_record:nth-of-type(even) + .oe_kanban_card_fancy + @include rotate(-3deg) + .oe_kanban_column:nth-of-type(even) + .oe_kanban_record:nth-of-type(3n) + .oe_kanban_card_fancy + @include rotate(1deg) + .oe_kanban_column:nth-of-type(3n) + .oe_kanban_card_fancy + @include rotate(-2deg) + .oe_kanban_column:nth-of-type(3n) + .oe_kanban_record:nth-of-type(even) + .oe_kanban_card_fancy + @include rotate(1deg) + .oe_kanban_column:nth-of-type(3n) + .oe_kanban_record:nth-of-type(3n) + .oe_kanban_card_fancy + @include rotate(-1deg) + + +@mixin oe_kanban_card_fancy + 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) + position: relative + z-index: 5 + @include rotate(0) + +.openerp + .oe_kanban_column + .oe_fold_column + .oe_kanban_card_fancy:hover, + .oe_kanban_card_fancy:focus + @include oe_kanban_card_fancy diff --git a/addons/note_pad/__init__.py b/addons/note_pad/__init__.py index 44a484adac4..75aae47f772 100644 --- a/addons/note_pad/__init__.py +++ b/addons/note_pad/__init__.py @@ -19,5 +19,5 @@ # ############################################################################## -import note_pad +import memo_pad diff --git a/addons/note_pad/__openerp__.py b/addons/note_pad/__openerp__.py index 7eee5eee487..1a40ef80cc6 100644 --- a/addons/note_pad/__openerp__.py +++ b/addons/note_pad/__openerp__.py @@ -20,19 +20,19 @@ ############################################################################## { - 'name': 'Notes pad', + 'name': 'Memos pad', 'version': '0.1', 'category': 'Tools', 'description': """ -This module update notes inside OpenERP for using an external pad +This module update memos inside OpenERP for using an external pad =================================================================== -Use for update your text note in real time with the following user that you invite. +Use for update your text memo in real time with the following user that you invite. """, 'author': 'OpenERP SA', 'website': 'http://openerp.com', - 'summary': 'Sticky Notes, Collaborative', + 'summary': 'Sticky memos, Collaborative', 'depends': [ 'base_tools', 'mail', diff --git a/addons/note_pad/note_pad.py b/addons/note_pad/note_pad.py index 73cc9d76a62..673867afd53 100644 --- a/addons/note_pad/note_pad.py +++ b/addons/note_pad/note_pad.py @@ -23,13 +23,13 @@ from openerp.osv import osv, fields from tools.translate import _ class note_pad_note(osv.osv): - """ Note pad """ + """ memo pad """ _name = 'note.note' _inherit = ['pad.common','note.note'] _pad_fields = ['note_pad'] - _description = "Note pad" + _description = "Memo pad" _columns = { 'note_pad_url': fields.char('Pad Url', size=250), diff --git a/addons/note_pad/note_pad_view.xml b/addons/note_pad/note_pad_view.xml index fd5c48d7f2a..eec7735d488 100644 --- a/addons/note_pad/note_pad_view.xml +++ b/addons/note_pad/note_pad_view.xml @@ -8,7 +8,7 @@ - + From 9ab1f35de57682686c3bf8e959bfb77f7a2b225f Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 11 Sep 2012 13:25:19 +0200 Subject: [PATCH 06/11] [IMP]base_setup: kanban view with .oe_kanban_list_many2many method bzr revid: chm@openerp.com-20120911112519-agdudw6g0lk156mc --- addons/base_setup/res_partner_view.xml | 8 ++++--- addons/base_setup/static/src/js/base_setup.js | 24 ------------------- 2 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 addons/base_setup/static/src/js/base_setup.js diff --git a/addons/base_setup/res_partner_view.xml b/addons/base_setup/res_partner_view.xml index 5aa24b3474d..5e54c0b8629 100644 --- a/addons/base_setup/res_partner_view.xml +++ b/addons/base_setup/res_partner_view.xml @@ -9,9 +9,11 @@ - - - + + + + + diff --git a/addons/base_setup/static/src/js/base_setup.js b/addons/base_setup/static/src/js/base_setup.js deleted file mode 100644 index db217b71b38..00000000000 --- a/addons/base_setup/static/src/js/base_setup.js +++ /dev/null @@ -1,24 +0,0 @@ -openerp.base_setup = function(openerp) { - /* extend kanban to include the names of partner categories in the kanban view of partners */ - openerp.web_kanban.KanbanView.include({ - on_groups_started: function() { - var self = this; - self._super.apply(this, arguments); - if (this.dataset.model === 'res.partner') { - /* Set names for partner categories */ - var category_ids = []; - this.$el.find('.oe_kanban_partner_categories span').each(function() { - category_ids.push($(this).data('category_id')); - }); - var dataset = new openerp.web.DataSetSearch(this, 'res.partner.category', self.session.context); - dataset.name_get(_.uniq(category_ids)).then(function(result) { - _.each(result, function(value) { - self.$el - .find('.oe_kanban_partner_categories span[data-category_id=' + value[0] + ']') - .html(value[1]); - }); - }); - } - } - }); -}; From 576d664f883bce3744903b081a9e25f4d35644ce Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 13 Sep 2012 19:19:38 +0200 Subject: [PATCH 07/11] [IMP] note: stage by user, group by stage, access rules bzr revid: chm@openerp.com-20120913171938-0zmtm2ds5mjdgttj --- addons/mail/mail_message.py | 2 +- addons/mail/security/ir.model.access.csv | 1 + addons/note/__openerp__.py | 2 +- addons/note/note.py | 99 +++++++++++++++++------- addons/note/note_view.xml | 44 +++++++---- addons/note/security/ir.model.access.csv | 5 +- addons/note/security/ir.rule.xml | 12 +++ addons/note/security/note_security.xml | 12 --- addons/note_pad/__init__.py | 2 +- addons/note_pad/note_pad.py | 11 +-- addons/note_pad/note_pad_view.xml | 5 +- 11 files changed, 124 insertions(+), 71 deletions(-) create mode 100644 addons/note/security/ir.rule.xml delete mode 100644 addons/note/security/note_security.xml diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index e4862ca9fb9..e7b6df7f05f 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -57,7 +57,7 @@ class mail_message(osv.Model): for message in self.browse(cr, uid, ids, context=context): if not message.model or not message.res_id: continue - result[message.id] = self._shorten_name(self.pool.get(message.model).name_get(cr, uid, [message.res_id], context=context)[0][1]) + result[message.id] = self._shorten_name(self.pool.get(message.model).name_get(cr, 1, [message.res_id], context=context)[0][1]) return result def _get_unread(self, cr, uid, ids, name, arg, context=None): diff --git a/addons/mail/security/ir.model.access.csv b/addons/mail/security/ir.model.access.csv index 1979e2fec05..efd600400ad 100644 --- a/addons/mail/security/ir.model.access.csv +++ b/addons/mail/security/ir.model.access.csv @@ -1,4 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_mail_global,mail.mail,model_mail_mail,base.group_system,1,1,1,1 access_mail_message_all,mail.message.all,model_mail_message,,1,0,0,0 access_mail_message_group_user,mail.message.group.user,model_mail_message,base.group_user,1,1,1,1 access_mail_thread,mail.thread,model_mail_thread,base.group_user,1,1,1,0 diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index c0c05c4cdb9..02e4653031c 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -44,7 +44,7 @@ Memos can be found in the 'Home' menu. ], 'data': [ 'security/res.groups.csv', - 'security/note_security.xml', + 'security/ir.rule.xml', 'security/ir.model.access.csv', 'note_data.xml', 'note_view.xml', diff --git a/addons/note/note.py b/addons/note/note.py index ed69214f97d..c600c54b162 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -70,11 +70,6 @@ class note_note(osv.osv): return res - #return the default stage for the uid user - def _get_default_stage_id(self,cr,uid,context=None): - ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)]) - return ids and ids[0] or False - #unactivate a memo and record the date def onclick_note_is_done(self, cr, uid, ids, context=None): self.write(cr, uid, ids, { 'active' : False, 'date_done' : fields.date.today() }) @@ -95,27 +90,34 @@ class note_note(osv.osv): #look that the title (first line of the memo) have more of one caracter def _constraints_min_len(self, cr, uid, ids, context=None): - res = self._get_note_first_line(cr, uid, ids, context=context) - - for note in self.browse(cr, uid, ids, context=context): - if len(res[note.id])<1 : - return False - - return True - + return dict.fromkeys(ids, (len(res[ids])>0) ) #used for undisplay the follower if it's the current user def _get_my_current_partner(self, cr, uid, ids, name, args, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) pid = user.partner_id and user.partner_id.id or False - - result = {} - for record in self.browse(cr, uid, ids, context=context): - result[record.id]=pid - - return result + return dict.fromkeys(ids, pid) + #return the default stage for the uid user + def _get_default_stage_id(self,cr,uid,context=None): + ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context) + return ids and ids[0] or 0 + + def _set_stage_per_user(self, cr, uid, id, name, value, args=None, context=None): + note = self.browse(cr, uid, id, context=context) + if not value: return False + stage_ids = [value] + [stage.id for stage in note.stage_ids if stage.user_id.id != uid ] + return self.write(cr, uid, [id], {'stage_ids': [(6, 0, stage_ids)]}, context=context) + + #used for undisplay the follower if it's the current user + def _get_stage_per_user(self, cr, uid, ids, name, args, context=None): + result = dict.fromkeys(ids, False) + for record in self.browse(cr, uid, ids, context=context): + for stage in record.stage_ids: + if stage.user_id.id == uid: + result[record.id] = stage.id + return result _columns = { @@ -126,13 +128,18 @@ class note_note(osv.osv): store=True), 'memo': fields.html('Pad Content'), '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_id': fields.many2one('note.stage', 'Stage'), + + # the stage_id depending on the uid + 'stage_id': fields.function(_get_stage_per_user, + fnct_inv=_set_stage_per_user, + string='Stages', + type='many2one', + relation='note.stage'), + # stage per user - #'stage_ids': fields.many2many('note.stage','note_stage_rel','note_id','stage_id','Linked stages users'), + '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 memo, record de date for un display memo after 1 days @@ -144,10 +151,6 @@ class note_note(osv.osv): 'current_partner_id' : fields.function(_get_my_current_partner), } - _constraints = [ - (_constraints_min_len,'The title (first line on the memo) must have at least one character.',['memo']), - ] - _defaults = { 'active' : 1, 'stage_id' : _get_default_stage_id, @@ -156,6 +159,44 @@ class note_note(osv.osv): _order = 'sequence asc' + def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False): + if groupby and groupby[0]=="stage_id": + + #search all stages + stage_ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context) + stage_name = dict(self.pool.get('note.stage').name_get(cr, uid, stage_ids, context=context)) #dict: map l'id sur le nom + + result = [{ #notes by stage for stages user + '__context': {'group_by': groupby[1:]}, + '__domain': domain + [('stage_ids.id', '=', stage_id)], + 'stage_id': (stage_id, stage_name[stage_id]), + 'stage_id_count': len(self.search(cr,uid, domain+[('stage_ids', '=', stage_id)], context=context )) + } for stage_id in stage_ids] + + nb_notes_ws = len(self.search(cr,uid, domain+[('stage_ids', 'not in', stage_ids)], context=context )) + + if nb_notes_ws>0: + result += [{ #notes for unknown stage + '__context': {'group_by': groupby[1:]}, + '__domain': domain + [('stage_ids', 'not in', stage_ids)], + 'stage_id': (0, 'Unknown'), + 'stage_id_count':nb_notes_ws + }] + + return result + + else: + return super(note_note, self).read_group(self, cr, uid, domain, fields, groupby, + offset=offset, limit=limit, context=context, orderby=orderby) + + # object.execute_kw time:0.017s [{'__context': {'group_by': []}, + # '__domain': [('author', '=', u'OpenERP SA'), ['application', '=', 1]], + # 'author': u'OpenERP SA', + # 'author_count': 20L}] + + + + #upgrade config setting page to configure pad, fancy and tags mode class note_base_config_settings(osv.osv_memory): _inherit = 'base.config.settings' @@ -165,5 +206,5 @@ class note_base_config_settings(osv.osv_memory): #auto group user => automatic with "group_" 'group_note_fancy': fields.boolean('Use fancy render', implied_group='note.group_note_fancy'), 'group_note_tags': fields.boolean('Use tags for memo', implied_group='note.group_note_tags'), - 'group_note_thread': fields.boolean('Use mail thread and follower', implied_group='note.group_note_thread'), + 'group_note_thread': fields.boolean('Use mail thread', implied_group='note.group_note_thread'), } diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 763489b0fd7..9381489a8d9 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -24,9 +24,9 @@ - - - + + + @@ -39,8 +39,7 @@ [('user_id','=',uid)] - + @@ -86,11 +85,8 @@
    -
    - - - -
    +
    +
    @@ -104,6 +100,20 @@ + + + note.note.tree + note.note + + + + + + + + + + note.note.form @@ -111,16 +121,16 @@
    - +
    - + -
    - - -
    +
    + +
    +
    @@ -180,7 +190,7 @@ - note + Memos note.note form kanban,tree,form diff --git a/addons/note/security/ir.model.access.csv b/addons/note/security/ir.model.access.csv index fe523cdd2ee..6c5ea823d96 100644 --- a/addons/note/security/ir.model.access.csv +++ b/addons/note/security/ir.model.access.csv @@ -1,3 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_note_stage_user,note.stage,model_note_stage,base.group_user,1,1,1,1 -access_note_note_user,note.note,model_note_note,base.group_user,1,1,1,1 +access_note_stage,note.stage,model_note_stage,,1,1,1,1 +access_note_note,note.note,model_note_note,,1,1,1,1 +access_note_tag,note.tag,model_note_tag,,1,1,1,1 diff --git a/addons/note/security/ir.rule.xml b/addons/note/security/ir.rule.xml new file mode 100644 index 00000000000..4eab169519f --- /dev/null +++ b/addons/note/security/ir.rule.xml @@ -0,0 +1,12 @@ + + + + + Only followers can read a memos + + ['|',('message_follower_ids.id','=',user.partner_id.id),('message_follower_ids','=',False)] + + + + + diff --git a/addons/note/security/note_security.xml b/addons/note/security/note_security.xml deleted file mode 100644 index 3710d79839e..00000000000 --- a/addons/note/security/note_security.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - My notes - - - [('message_follower_ids','=',user.partner_id.id)] - - - - diff --git a/addons/note_pad/__init__.py b/addons/note_pad/__init__.py index 75aae47f772..44a484adac4 100644 --- a/addons/note_pad/__init__.py +++ b/addons/note_pad/__init__.py @@ -19,5 +19,5 @@ # ############################################################################## -import memo_pad +import note_pad diff --git a/addons/note_pad/note_pad.py b/addons/note_pad/note_pad.py index 673867afd53..9864f0ae14f 100644 --- a/addons/note_pad/note_pad.py +++ b/addons/note_pad/note_pad.py @@ -29,12 +29,13 @@ class note_pad_note(osv.osv): _inherit = ['pad.common','note.note'] _pad_fields = ['note_pad'] - _description = "Memo pad" _columns = { - 'note_pad_url': fields.char('Pad Url', size=250), + 'note_pad_url': fields.char('Pad Url', + pad_content_field='memo', + size=250 ), } - _defaults = { - 'note_pad_url': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), - } + #_defaults = { + # 'note_pad_url': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), + #} diff --git a/addons/note_pad/note_pad_view.xml b/addons/note_pad/note_pad_view.xml index eec7735d488..9e45a3952f1 100644 --- a/addons/note_pad/note_pad_view.xml +++ b/addons/note_pad/note_pad_view.xml @@ -6,9 +6,8 @@ note.note - - - + + From 4a48e74c72694180e3c15bc293350582b1488582 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 14 Sep 2012 10:15:15 +0200 Subject: [PATCH 08/11] [IMP] note: read_group for unknown stage and with empty stage_ids ; statusbar widget bzr revid: chm@openerp.com-20120914081515-sew3sq23151ghqsr --- addons/note/note.py | 53 ++++++++++++++++++++++++++------------- addons/note/note_view.xml | 2 +- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index c600c54b162..fff44f9f5b7 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -64,7 +64,7 @@ class note_note(osv.osv): res = {} for note in self.browse(cr, uid, ids, context=context): text_note = (note.memo or '').strip().split('\n')[0] - text_note = re.sub(r'(|

    |
    )[\s\S]*','',text_note) + text_note = re.sub(r'(\S?)(|<[/]?p>|<[/]?div>|)[\s\S]*',r'\1',text_note) text_note = re.sub(r'<[^>]+>','',text_note) res[note.id] = text_note @@ -119,7 +119,6 @@ class note_note(osv.osv): result[record.id] = stage.id return result - _columns = { 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, @@ -164,25 +163,43 @@ class note_note(osv.osv): #search all stages stage_ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context) - stage_name = dict(self.pool.get('note.stage').name_get(cr, uid, stage_ids, context=context)) #dict: map l'id sur le nom - result = [{ #notes by stage for stages user - '__context': {'group_by': groupby[1:]}, - '__domain': domain + [('stage_ids.id', '=', stage_id)], - 'stage_id': (stage_id, stage_name[stage_id]), - 'stage_id_count': len(self.search(cr,uid, domain+[('stage_ids', '=', stage_id)], context=context )) - } for stage_id in stage_ids] + if stage_ids: #if the user have some stages - nb_notes_ws = len(self.search(cr,uid, domain+[('stage_ids', 'not in', stage_ids)], context=context )) + #dict of stages: map les ids sur les noms + stage_name = dict(self.pool.get('note.stage').name_get(cr, uid, stage_ids, context=context)) + + result = [{ #notes by stage for stages user + '__context': {'group_by': groupby[1:]}, + '__domain': domain + [('stage_ids.id', '=', stage_id)], + 'stage_id': (stage_id, stage_name[stage_id]), + 'stage_id_count': self.search(cr,uid, domain+[('stage_ids', '=', stage_id)], context=context, count=True) + } for stage_id in stage_ids] + + #note without user's stage + nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', stage_ids)], context=context, count=True) + if nb_notes_ws: + result += [{ #notes for unknown stage and if stage_ids is not empty + '__context': {'group_by': groupby[1:]}, + '__domain': domain + [('stage_ids', 'not in', stage_ids)], + 'stage_id': (0, 'Unknown'), + 'stage_id_count':nb_notes_ws + }] + + else: # if stage_ids is empty + + #note without user's stage + nb_notes_ws = self.search(cr,uid, domain, context=context, count=True) + if nb_notes_ws: + result = [{ #notes for unknown stage + '__context': {'group_by': groupby[1:]}, + '__domain': domain, + 'stage_id': (0, 'Unknown'), + 'stage_id_count':nb_notes_ws + }] + else: + result = [] - if nb_notes_ws>0: - result += [{ #notes for unknown stage - '__context': {'group_by': groupby[1:]}, - '__domain': domain + [('stage_ids', 'not in', stage_ids)], - 'stage_id': (0, 'Unknown'), - 'stage_id_count':nb_notes_ws - }] - return result else: diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 9381489a8d9..62cf4444d91 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -121,7 +121,7 @@
    - +
    From a15456ba0f3ff40bcf5bd95167880a9f856d05a6 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 14 Sep 2012 12:14:18 +0200 Subject: [PATCH 09/11] [FIX] note: access rules bzr revid: chm@openerp.com-20120914101418-7bpc4aecprfz1vvt --- addons/note/note.py | 45 ++++++++++-------------- addons/note/note_view.xml | 14 ++++---- addons/note/security/ir.model.access.csv | 6 ++-- addons/note/security/ir.rule.xml | 4 +-- 4 files changed, 30 insertions(+), 39 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index 58ffc027a1d..11b3af1ac89 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -26,7 +26,7 @@ import re class note_stage(osv.osv): """ Category of Note """ _name = "note.stage" - _description = "Note Stage" + _description = "Sticky note Stage" _columns = { 'name': fields.char('Category Name', size=64, required=True), 'sequence': fields.integer('Sequence', help="Used to order the note stages"), @@ -53,7 +53,7 @@ class note_note(osv.osv): """ Note """ _name = 'note.note' _inherit = ['mail.thread'] - _description = "Memo" + _description = "Sticky note" #writing method (no modification of values) def _set_note_first_line(self, cr, uid, id, name, value, args={}, context=None): @@ -70,25 +70,25 @@ class note_note(osv.osv): return res - #unactivate a memo and record the date + #unactivate a sticky note and record the date 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 memo is active', subject=False, + self.message_post(cr, uid, ids[0], body='This sticky note is active', subject=False, type='notification', parent_id=False, attachments=None, context=context) return False - #activate a memo + #activate a Sticky note 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 memo is close', subject=False, + self.message_post(cr, uid, ids[0], body='This sticky note is close', subject=False, type='notification', parent_id=False, attachments=None, context=context) return False - #look that the title (first line of the memo) have more of one caracter + #look that the title (first line of the Sticky note) have more of one caracter def _constraints_min_len(self, cr, uid, ids, context=None): res = self._get_note_first_line(cr, uid, ids, context=context) return dict.fromkeys(ids, (len(res[ids])>0) ) @@ -122,7 +122,7 @@ class note_note(osv.osv): _columns = { 'name': fields.function(_get_note_first_line, fnct_inv=_set_note_first_line, - string='Memo Summary', + string='Sticky note Summary', type='text', store=True), 'memo': fields.html('Pad Content'), @@ -141,7 +141,7 @@ class note_note(osv.osv): '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 memo, record de date for un display memo after 1 days + # when the user unactivate the Sticky note, record de date for un display Sticky note after 1 days 'date_done': fields.date('Date done'), 'color': fields.integer('Color Index'), # put tags on the memo (optional) @@ -162,26 +162,26 @@ class note_note(osv.osv): if groupby and groupby[0]=="stage_id": #search all stages - stage_ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context) + current_stage_ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context) - if stage_ids: #if the user have some stages + if current_stage_ids: #if the user have some stages #dict of stages: map les ids sur les noms - stage_name = dict(self.pool.get('note.stage').name_get(cr, uid, stage_ids, context=context)) + stage_name = dict(self.pool.get('note.stage').name_get(cr, uid, current_stage_ids, context=context)) result = [{ #notes by stage for stages user '__context': {'group_by': groupby[1:]}, - '__domain': domain + [('stage_ids.id', '=', stage_id)], - 'stage_id': (stage_id, stage_name[stage_id]), - 'stage_id_count': self.search(cr,uid, domain+[('stage_ids', '=', stage_id)], context=context, count=True) - } for stage_id in stage_ids] + '__domain': domain + [('stage_ids.id', '=', current_stage_id)], + 'stage_id': (current_stage_id, stage_name[current_stage_id]), + 'stage_id_count': self.search(cr,uid, domain+[('stage_ids', '=', current_stage_id)], context=context, count=True) + } for current_stage_id in current_stage_ids] #note without user's stage - nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', stage_ids)], context=context, count=True) + nb_notes_ws = self.search(cr,uid, domain+[('stage_ids', 'not in', current_stage_ids)], context=context, count=True) if nb_notes_ws: result += [{ #notes for unknown stage and if stage_ids is not empty '__context': {'group_by': groupby[1:]}, - '__domain': domain + [('stage_ids', 'not in', stage_ids)], + '__domain': domain + [('stage_ids', 'not in', current_stage_ids)], 'stage_id': (0, 'Unknown'), 'stage_id_count':nb_notes_ws }] @@ -206,13 +206,6 @@ class note_note(osv.osv): return super(note_note, self).read_group(self, cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby) - # object.execute_kw time:0.017s [{'__context': {'group_by': []}, - # '__domain': [('author', '=', u'OpenERP SA'), ['application', '=', 1]], - # 'author': u'OpenERP SA', - # 'author_count': 20L}] - - - #upgrade config setting page to configure pad, fancy and tags mode class note_base_config_settings(osv.osv_memory): @@ -222,6 +215,6 @@ class note_base_config_settings(osv.osv_memory): 'module_note_pad': fields.boolean('Use an etherpad'), #auto group user => automatic with "group_" 'group_note_fancy': fields.boolean('Use fancy render', implied_group='note.group_note_fancy'), - 'group_note_tags': fields.boolean('Use tags for memo', implied_group='note.group_note_tags'), + 'group_note_tags': fields.boolean('Use tags for sticky note', implied_group='note.group_note_tags'), 'group_note_thread': fields.boolean('Use mail thread', implied_group='note.group_note_thread'), } diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 62cf4444d91..46c326279e8 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -119,7 +119,7 @@ note.note.form note.note - +
    @@ -127,10 +127,8 @@ -
    - -
    - + + @@ -140,9 +138,9 @@ note.note.search note.note - + - + @@ -164,7 +162,7 @@ - diff --git a/addons/note/security/res.groups.csv b/addons/note/security/res.groups.csv index 5ce1df4106c..61c54c964ff 100644 --- a/addons/note/security/res.groups.csv +++ b/addons/note/security/res.groups.csv @@ -1,4 +1,3 @@ id,name,implied_ids/id group_note_tags,Memo / Display tags, group_note_fancy,Memo / Fancy mode, -group_note_thread,Memo / Mail thread,