From 44e02f756b0066f61e1bbea648f92ea23a0aac02 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Wed, 8 Feb 2012 16:33:04 +0100 Subject: [PATCH 01/69] =?UTF-8?q?[FIX]=C2=A0file=5Fopen=20should=20not=20s?= =?UTF-8?q?earch=20zip=20files=20outside=20its=20root=20directory.=20=20Fi?= =?UTF-8?q?x=20the=20returned=20value=20with=20pathinfo=3DTrue.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lp bug: https://launchpad.net/bugs/928507 fixed lp bug: https://launchpad.net/bugs/928376 fixed bzr revid: florent.xicluna@gmail.com-20120208153304-9443zx2z09bws10x --- openerp/tools/misc.py | 89 ++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index a5c72900fc7..3c9210214b1 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -134,7 +134,7 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False): @param name name of the file @param mode file open mode @param subdir subdirectory - @param pathinfo if True returns tupple (fileobject, filepath) + @param pathinfo if True returns tuple (fileobject, filepath) @return fileobject if pathinfo is False else (fileobject, filepath) """ @@ -142,44 +142,51 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False): adps = addons.module.ad_paths rtp = os.path.normcase(os.path.abspath(config['root_path'])) - if name.replace(os.path.sep, '/').startswith('addons/'): + if os.path.isabs(name): + # It is an absolute path + # Is it below 'addons_path' or 'root_path'? + name = os.path.normcase(os.path.normpath(name)) + for root in adps + [rtp]: + if name.startswith(root): + base = root.rstrip(os.sep) + name = name[len(base) + 1:] + break + else: + # It is outside the OpenERP root: skip zipfile lookup. + base, name = os.path.split(name) + return _fileopen(name, mode=mode, basedir=base, pathinfo=pathinfo) + + if name.replace(os.sep, '/').startswith('addons/'): subdir = 'addons' - name = name[7:] + name2 = name[7:] + elif subdir: + name = os.path.join(subdir, name) + if name.replace(os.sep, '/').startswith('addons/'): + subdir = 'addons' + name2 = name[7:] + else: + name2 = name - # First try to locate in addons_path + # First, try to locate in addons_path if subdir: - subdir2 = subdir - if subdir2.replace(os.path.sep, '/').startswith('addons/'): - subdir2 = subdir2[7:] - - subdir2 = (subdir2 != 'addons' or None) and subdir2 - for adp in adps: try: - if subdir2: - fn = os.path.join(adp, subdir2, name) - else: - fn = os.path.join(adp, name) - fn = os.path.normpath(fn) - fo = file_open(fn, mode=mode, subdir=None, pathinfo=pathinfo) - if pathinfo: - return fo, fn - return fo + return _fileopen(name2, mode=mode, basedir=adp, + pathinfo=pathinfo) except IOError: pass - if subdir: - name = os.path.join(rtp, subdir, name) - else: - name = os.path.join(rtp, name) + # Second, try to locate in root_path + return _fileopen(name, mode=mode, basedir=rtp, pathinfo=pathinfo) - name = os.path.normpath(name) - # Check for a zipfile in the path - head = name - zipname = False +def _fileopen(path, mode, basedir, pathinfo): + head = os.path.normpath(path) + name = os.path.normpath(os.path.join(basedir, path)) name2 = False - while True: + zipname = False + # Check for a zipfile in the path, but stop at the 'basedir' level + while os.sep in head: head, tail = os.path.split(head) if not tail: break @@ -187,9 +194,10 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False): zipname = os.path.join(tail, zipname) else: zipname = tail - if zipfile.is_zipfile(head+'.zip'): + zpath = os.path.join(basedir, head + '.zip') + if zipfile.is_zipfile(zpath): from cStringIO import StringIO - zfile = zipfile.ZipFile(head+'.zip') + zfile = zipfile.ZipFile(zpath) try: fo = StringIO() fo.write(zfile.read(os.path.join( @@ -197,20 +205,21 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False): os.sep, '/'))) fo.seek(0) if pathinfo: - return fo, name + return (fo, name) return fo except Exception: - name2 = os.path.normpath(os.path.join(head + '.zip', zipname)) - pass - for i in (name2, name): - if i and os.path.isfile(i): - fo = file(i, mode) + name2 = os.path.normpath(os.path.join(zpath, zipname)) + # Look for a normal file + for fname in (name2, name): + if fname and os.path.isfile(fname): + fo = open(fname, mode) if pathinfo: - return fo, i + return (fo, fname) return fo - if os.path.splitext(name)[1] == '.rml': - raise IOError, 'Report %s doesn\'t exist or deleted : ' %str(name) - raise IOError, 'File not found : %s' % name + # Not found + if name.endswith('.rml'): + raise IOError('Report %r doesn\'t exist or deleted' % name) + raise IOError('File not found: %s' % name) #---------------------------------------------------------- From 69a5eca5b48740c44e35ac5b0285e22a17c5dd8d Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 8 Feb 2012 18:39:32 +0100 Subject: [PATCH 02/69] [IMP] Give precedence to module directories instead of zips while locating resources The previous behavior gave the precedence to zipped modules, without any apparent reason, and this is sub-optimal for several reasons: 1. The default is to have regular modules, not zipped modules, so looking first for a regular module is more efficient. 2. Keeping a zipped module next to a regular module with the same name is not a documented or supported feature. 3. Even if you were relying on this behavior having the extracted module take precedence is more practical: you could simply extract the zipped module to test a quick fix. We have another issue related to this feature because the code looking for zipped modules escapes the addons paths chroot and goes up to the filesystem root looking for a zip module at each step. This is described in bug 928376 and a fix for it should follow. lp bug: https://launchpad.net/bugs/928376 fixed bzr revid: odo@openerp.com-20120208173932-pwhz53vxxdzbo8ja --- openerp/modules/module.py | 25 ++++++++++++++----------- openerp/tools/misc.py | 24 +++++++++++++++--------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index 58a4547ff07..3d3bc0d9adf 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -280,25 +280,28 @@ def get_module_as_zip(modulename, b64enc=True, src=True): def get_module_resource(module, *args): """Return the full path of a resource of the given module. - @param module: the module - @param args: the resource path components + :param module: module name + :param list(str) args: resource path components within module - @return: absolute path to the resource + :rtype: str + :return: absolute path to the resource TODO name it get_resource_path TODO make it available inside on osv object (self.get_resource_path) """ - a = get_module_path(module) - if not a: return False - resource_path = opj(a, *args) - if zipfile.is_zipfile( a +'.zip') : - zip = zipfile.ZipFile( a + ".zip") + mod_path = get_module_path(module) + if not mod_path: return False + resource_path = opj(mod_path, *args) + if os.path.isdir(mod_path): + # the module is a directory - ignore zip behavior + if os.path.exists(resource_path): + return resource_path + elif zipfile.is_zipfile(mod_path + '.zip'): + zip = zipfile.ZipFile( mod_path + ".zip") files = ['/'.join(f.split('/')[1:]) for f in zip.namelist()] resource_path = '/'.join(args) if resource_path in files: - return opj(a, resource_path) - elif os.path.exists(resource_path): - return resource_path + return opj(mod_path, resource_path) return False def get_module_icon(module): diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py index a5c72900fc7..e0be5ffaef9 100644 --- a/openerp/tools/misc.py +++ b/openerp/tools/misc.py @@ -175,10 +175,22 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False): name = os.path.normpath(name) - # Check for a zipfile in the path + # Give higher priority to module directories, which is + # a more common case than zipped modules. + if os.path.isfile(name): + fo = file(name, mode) + if pathinfo: + return fo, name + return fo + + # Support for loading modules in zipped form. + # This will not work for zipped modules that are sitting + # outside of known addons paths. head = name zipname = False - name2 = False + # FIXME: implement chrooting inside addons paths and fix + # for incorrect path_info behavior. Work in progress by + # Florent X linked to bug 928376 while True: head, tail = os.path.split(head) if not tail: @@ -200,14 +212,8 @@ def file_open(name, mode="r", subdir='addons', pathinfo=False): return fo, name return fo except Exception: - name2 = os.path.normpath(os.path.join(head + '.zip', zipname)) pass - for i in (name2, name): - if i and os.path.isfile(i): - fo = file(i, mode) - if pathinfo: - return fo, i - return fo + if os.path.splitext(name)[1] == '.rml': raise IOError, 'Report %s doesn\'t exist or deleted : ' %str(name) raise IOError, 'File not found : %s' % name From 87c4a3a3b7406cd8bba071846e230f48d7c03da8 Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Mon, 13 Aug 2012 19:04:29 +0200 Subject: [PATCH 03/69] initial note push bzr revid: acl@openerp.com-20120813170429-91dibb1dpe32j6w2 --- addons/crm_todo/crm_todo_view.xml | 2 +- addons/note/__init__.py | 23 ++++ addons/note/__openerp__.py | 59 +++++++++ addons/note/note.py | 134 +++++++++++++++++++ addons/note/note_view.xml | 158 +++++++++++++++++++++++ addons/note/security/ir.model.access.csv | 3 + addons/note/security/note_security.xml | 12 ++ addons/note/static/src/css/note.css | 58 +++++++++ 8 files changed, 448 insertions(+), 1 deletion(-) create mode 100644 addons/note/__init__.py create mode 100644 addons/note/__openerp__.py create mode 100644 addons/note/note.py create mode 100644 addons/note/note_view.xml create mode 100644 addons/note/security/ir.model.access.csv create mode 100644 addons/note/security/note_security.xml create mode 100644 addons/note/static/src/css/note.css diff --git a/addons/crm_todo/crm_todo_view.xml b/addons/crm_todo/crm_todo_view.xml index c959f1722e6..47b0655ac99 100644 --- a/addons/crm_todo/crm_todo_view.xml +++ b/addons/crm_todo/crm_todo_view.xml @@ -59,7 +59,7 @@ parent="base.menu_sales" action="crm_todo_action" sequence="6"/> - + diff --git a/addons/note/__init__.py b/addons/note/__init__.py new file mode 100644 index 00000000000..9bf064877b5 --- /dev/null +++ b/addons/note/__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 + diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py new file mode 100644 index 00000000000..96938f56ef1 --- /dev/null +++ b/addons/note/__openerp__.py @@ -0,0 +1,59 @@ +# -*- 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', + 'version': '0.1', + 'category': 'Tools', + 'description': """ +This module allows users to create their own notes inside OpenERP +============================================================================== + +With this module you can allow users to take notes inside OpenERP. +These notes can be shared with OpenERP or external users. +They also can be organized following user dependant categories. +Notes can be found in the 'Home' main menu, under 'Tool' submenu. +""", + 'author': 'OpenERP SA', + 'website': 'http://openerp.com', + 'depends': ['base_tools','mail','pad'], + 'init_xml': [], + 'update_xml': [ + 'security/note_security.xml', + 'security/ir.model.access.csv', + 'note_view.xml', + #'note_workflow.xml', + ], + 'demo_xml': [ + #"note_data.xml" + ], + 'test':[ + ], + 'css': [ + 'static/src/css/note.css', + ], + 'installable': True, + 'application': True, + 'category': 'Tools', + 'images': [], +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/note/note.py b/addons/note/note.py new file mode 100644 index 00000000000..a9afad770c4 --- /dev/null +++ b/addons/note/note.py @@ -0,0 +1,134 @@ +# -*- 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 _ + +# +# Todo : + + +# ** fix editable when in form view ** not atm +# fix search +# fix design +# rights + + +class note_stage(osv.Model): + """ Category of Note """ + + _name = "note.stage" + _description = "Note 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), + 'fold': fields.boolean('Folded'), + + } + _sql_constraints = [ + ] + + _order = 'sequence asc' + + _defaults = { + 'fold': 0, + 'user_id': lambda self, cr, uid, ctx: uid, + 'sequence' : 1, + } + + def __init__(self, pool, cr): + osv.Model.__init__(self,pool, cr) + + +# class many2many_filter(fields.many2many) + +# grep many2many_mod dans le code + + + +class note_note(osv.Model): + """ Note """ + _name = 'note.note' + _inherit = ['mail.thread','pad.common'] + _pad_fields = ['note_pad'] + _description = "Note" + + 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.split('\n')[0] + return res + + def _set_note_first_line(self, cr, uid, id, name, value, args, context=None): + # + # todo should set the pad first line (as title) + # + return self.write(cr, uid, [id], {'name': value}, context=context) + + _columns = { + 'name': fields.function(_get_note_first_line,_fnct_inv=_set_note_first_line, string='Note Summary', type="text", store=True), + 'note': fields.text('Pad Content'), + 'note_pad': fields.char('Pad Url', size=250), + 'sequence': fields.integer('Sequence'), + 'stage_id': fields.many2one('note.stage', 'Stage'), + 'active': fields.boolean('Active'), + 'color': fields.integer('Color Index'), + #'follower_ids': fields.one2many('mail.subscription', 'res_id', 'Followers', domain=[('res_model','=', 'note.note')]) + 'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers', join_filter="mail_subscription.res_model='note.note'") + } + + _sql_constraints = [ + ] + + + def _get_default_stage_id(self,cr,uid,context=None): + id = self.pool.get('note.stage').search(cr,uid,[('sequence','=','1')]) + return id[0] + + _defaults = { + 'active' : 1, + 'stage_id' : _get_default_stage_id, + 'note_pad': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), + } + + + _order = 'sequence asc' + + + + 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 + + _group_by_full = { + 'stage_id' : _read_group_stage_ids, + } + + def stage_set(self,cr,uid,ids,stage_id,context=None): + self.write(cr,uid,ids,{'stage_id': stage_id}) diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml new file mode 100644 index 00000000000..9f8c91e9c62 --- /dev/null +++ b/addons/note/note_view.xml @@ -0,0 +1,158 @@ + + + + + + + note.stage.form + note.stage + form + +
+ + + +
+
+
+ + + + + + note.stage.tree + note.stage + tree + + + + + + + + + + + + + + Stages + note.stage + form + tree,form + [('user_id','=',uid)] + + + + + + + + + note.note.kanban + note.note + kanban + + + + + + + + + + + +
+ +
+ í +
+ + +
+ + + + +
+ +
+ + + +
+ +
+
+
+
+
+
+
+ + + + + + note.note.form + note.note + form + +
+
+ + +
+ +
+ +
+ +
+
+ + + + note.note.search + note.note + search + + + + + + + + + + + + + + + + note.note.tree + note.note + tree + + + + + Notes + note.note + form + kanban,tree,form + + + + + +
+
diff --git a/addons/note/security/ir.model.access.csv b/addons/note/security/ir.model.access.csv new file mode 100644 index 00000000000..fdd6030ca51 --- /dev/null +++ b/addons/note/security/ir.model.access.csv @@ -0,0 +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 diff --git a/addons/note/security/note_security.xml b/addons/note/security/note_security.xml new file mode 100644 index 00000000000..46eebee629c --- /dev/null +++ b/addons/note/security/note_security.xml @@ -0,0 +1,12 @@ + + + + + My notes + + + [('follower_ids','=',user.id)] + + + + diff --git a/addons/note/static/src/css/note.css b/addons/note/static/src/css/note.css new file mode 100644 index 00000000000..a6b097ece88 --- /dev/null +++ b/addons/note/static/src/css/note.css @@ -0,0 +1,58 @@ + + +.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .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); +} + + +.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { + -webkit-transform: rotate(-3deg); + -o-transform: rotate(-3deg); + -moz-transform:rotate(-3deg); +} + +.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups:nth-child(even) .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { + -o-transform:rotate(1deg); + -webkit-transform:rotate(1deg); + -moz-transform:rotate(1deg); + position:relative; + top:3px; +} + +.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups:nth-child(2n) .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { + -o-transform:rotate(-2deg); + -webkit-transform:rotate(-2deg); + -moz-transform:rotate(-2deg); + position:relative; + top:-3px; +} + +.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups:nth-child(2n) .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { + -o-transform:rotate(2deg); + -webkit-transform:rotate(2deg); + -moz-transform:rotate(2deg); + position:relative; + top:-5px; +} + +.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card:hover, +.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .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: scale(1.25); + -moz-transform: scale(1.25); + -o-transform: scale(1.25); + position:relative; + z-index:5; +} From 876dc272424e78cf45db33dddd23ce994da1ba5e Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Tue, 14 Aug 2012 16:21:51 +0200 Subject: [PATCH 04/69] wip bzr revid: acl@openerp.com-20120814142151-uwi6xkdamv623pos --- addons/note/__openerp__.py | 3 +- addons/note/note.py | 2 +- addons/note/note_data.xml | 224 +++++++++++++++++++++++++++ addons/note/note_view.xml | 4 +- addons/note/static/src/css/Makefile | 3 + addons/note/static/src/css/note.css | 79 +++++++--- addons/note/static/src/css/note.sass | 137 ++++++++++++++++ 7 files changed, 427 insertions(+), 25 deletions(-) create mode 100644 addons/note/note_data.xml create mode 100644 addons/note/static/src/css/Makefile create mode 100644 addons/note/static/src/css/note.sass diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 96938f56ef1..c9200324bb7 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -41,10 +41,9 @@ Notes can be found in the 'Home' main menu, under 'Tool' submenu. 'security/note_security.xml', 'security/ir.model.access.csv', 'note_view.xml', - #'note_workflow.xml', ], 'demo_xml': [ - #"note_data.xml" + "note_data.xml" ], 'test':[ ], diff --git a/addons/note/note.py b/addons/note/note.py index a9afad770c4..89049bf6ec8 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -93,7 +93,7 @@ class note_note(osv.Model): 'active': fields.boolean('Active'), 'color': fields.integer('Color Index'), #'follower_ids': fields.one2many('mail.subscription', 'res_id', 'Followers', domain=[('res_model','=', 'note.note')]) - 'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers', join_filter="mail_subscription.res_model='note.note'") + #'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers', join_filter="mail_subscription.res_model='note.note'") } _sql_constraints = [ diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml new file mode 100644 index 00000000000..15226bd48b0 --- /dev/null +++ b/addons/note/note_data.xml @@ -0,0 +1,224 @@ + + + + + Today + 1 + + + + Tomorrow + 2 + + + + This week + 3 + + + + This month + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 9f8c91e9c62..ded45474f2f 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -84,9 +84,11 @@
- +
diff --git a/addons/note/static/src/css/Makefile b/addons/note/static/src/css/Makefile new file mode 100644 index 00000000000..d6019f4ed4a --- /dev/null +++ b/addons/note/static/src/css/Makefile @@ -0,0 +1,3 @@ +note.css: note.sass + sass -t expanded note.sass note.css + diff --git a/addons/note/static/src/css/note.css b/addons/note/static/src/css/note.css index a6b097ece88..4b3c7e0e57d 100644 --- a/addons/note/static/src/css/note.css +++ b/addons/note/static/src/css/note.css @@ -1,6 +1,6 @@ -.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { +.openerp .oe_fold_column .oe_kanban_card { text-decoration:none; color:#000; display:block; @@ -14,35 +14,72 @@ } -.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { + +.oe_kanban_record .oe_kanban_card { + -webkit-transform: rotate(-2deg); + -o-transform: rotate(-2deg); + -moz-transform:rotate(-2deg); +} + +.oe_kanban_record:nth-of-type(even) .oe_kanban_card { + -webkit-transform: rotate(-1deg); + -o-transform: rotate(-1deg); + -moz-transform:rotate(-1deg); +} + + +.oe_kanban_record:nth-of-type(3n) .oe_kanban_card { + -webkit-transform: rotate(4deg); + -o-transform: rotate(4deg); + -moz-transform:rotate(4deg); +} + +.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_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_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups:nth-child(even) .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { - -o-transform:rotate(1deg); - -webkit-transform:rotate(1deg); +.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); - position:relative; - top:3px; } +/* .openerp .oe_fold_column:nth-child(even) .oe_kanban_card { */ +/* -webkit-transform: rotate(-3deg); */ +/* -o-transform: rotate(-3deg); */ +/* -moz-transform:rotate(-3deg); */ +/* } */ -.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups:nth-child(2n) .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { - -o-transform:rotate(-2deg); - -webkit-transform:rotate(-2deg); - -moz-transform:rotate(-2deg); - position:relative; - top:-3px; -} +/* .openerp .oe_kanban_groups_records .oe_kanban_column .oe_fold_column:nth-child(even) .oe_kanban_card { */ +/* -o-transform:rotate(1deg); */ +/* -webkit-transform:rotate(1deg); */ +/* -moz-transform:rotate(1deg); */ +/* position:relative; */ +/* top:3px; */ +/* } */ -.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups:nth-child(2n) .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card { - -o-transform:rotate(2deg); - -webkit-transform:rotate(2deg); - -moz-transform:rotate(2deg); - position:relative; - top:-5px; -} +/* .openerp .oe_fold_column:nth-child(3n) .oe_kanban_card { */ +/* -o-transform:rotate(-2deg); */ +/* -webkit-transform:rotate(-2deg); */ +/* -moz-transform:rotate(-2deg); */ +/* position:relative; */ +/* top:-3px; */ +/* } */ + +/* .openerp.oe_fold_column:nth-child(5n) .oe_kanban_card { */ +/* -o-transform:rotate(2deg); */ +/* -webkit-transform:rotate(2deg); */ +/* -moz-transform:rotate(2deg); */ +/* position:relative; */ +/* top:-5px; */ +/* } */ .openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card:hover, .openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card:focus diff --git a/addons/note/static/src/css/note.sass b/addons/note/static/src/css/note.sass new file mode 100644 index 00000000000..cd04015dcbb --- /dev/null +++ b/addons/note/static/src/css/note.sass @@ -0,0 +1,137 @@ +@charset "utf-8" + +// Variables {{{ +$section-title-color: #8786b7 +$tag-bg-light: #f0f0fa +$tag-bg-dark: #8786b7 +$tag-border: #afafb6 +$tag-border-selected: #a6a6fe +$hover-background: #f0f0fa +$link-color: #8a89ba +$sheet-max-width: 860px +// }}} +// Mixins {{{ +@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 + +@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 + +@mixin reset() + border: none + padding: 0 + margin: 0 + background: none + @include radius(none) + @include box-shadow(none) + +@mixin vertical-gradient($startColor: #555, $endColor: #333) + 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) + +@mixin radial-gradient($gradient) + background-position: center center + background-image: -webkit-radial-gradient(circle, $gradient) + background-image: -moz-radial-gradient($gradient) + background-image: -ms-radial-gradient($gradient) + background-image: radial-gradient($gradient) + +@mixin radius($radius: 5px) + -moz-border-radius: $radius + -webkit-border-radius: $radius + border-radius: $radius + +@mixin box-shadow($bsval: 0px 1px 4px #777) + -moz-box-shadow: $bsval + -webkit-box-shadow: $bsval + box-shadow: $bsval + +@mixin transition($transval: (border linear 0.2s, box-shadow linear 0.2s)) + -webkit-transition: $transval + -moz-transition: $transval + -ms-transition: $transval + -o-transition: $transval + transition: $transval + +@mixin opacity($opacity: .5) + filter: alpha(opacity=$opacity * 100) + opacity: $opacity + +@mixin background-clip($clip: padding-box) + -webkit-background-clip: $clip + -moz-background-clip: $clip + background-clip: $clip + +@mixin box-sizing($type: content) + // type = border || content || padding + -webkit-box-sizing: #{$type}-box + -moz-box-sizing: #{$type}-box + -ms-box-sizing: #{$type}-box + box-sizing: #{$type}-box + +// Transforms the (readable) text of an inline element into an mmlicons icon, +// allows for actual readable text in-code (and in readers?) with iconic looks +@mixin text-to-icon($icon-name, $color: #404040) + font-size: 1px + letter-spacing: -1px + color: transparent + &:before + font: 21px "mnmliconsRegular" + content: $icon-name + color: $color + +// }}} +// CSS animation bounces {{{ +@-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 + +@-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 +// }}} + + +.oe_kanban_color_2 + background-color:red + +// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" + From 56666953b38e7ea2c6e8e8bc8391bd6da9b64276 Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Tue, 14 Aug 2012 17:18:00 +0200 Subject: [PATCH 05/69] Some fixes bzr revid: acl@openerp.com-20120814151800-e0adyvny6v17c3qr --- addons/note/note.py | 15 +------- addons/note/note_view.xml | 16 ++------- addons/note/static/src/css/note.css | 54 +++++++++++------------------ 3 files changed, 24 insertions(+), 61 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index 89049bf6ec8..7d0ff170d79 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -22,16 +22,6 @@ from openerp.osv import osv, fields from tools.translate import _ -# -# Todo : - - -# ** fix editable when in form view ** not atm -# fix search -# fix design -# rights - - class note_stage(osv.Model): """ Category of Note """ @@ -55,9 +45,6 @@ class note_stage(osv.Model): 'sequence' : 1, } - def __init__(self, pool, cr): - osv.Model.__init__(self,pool, cr) - # class many2many_filter(fields.many2many) @@ -93,7 +80,7 @@ class note_note(osv.Model): 'active': fields.boolean('Active'), 'color': fields.integer('Color Index'), #'follower_ids': fields.one2many('mail.subscription', 'res_id', 'Followers', domain=[('res_model','=', 'note.note')]) - #'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers', join_filter="mail_subscription.res_model='note.note'") + 'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers', join_filter="mail_subscription.res_model='note.note'") } _sql_constraints = [ diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index ded45474f2f..39dca553c39 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -16,8 +16,6 @@ - - note.stage.tree @@ -77,18 +75,14 @@
- -
- +
@@ -99,8 +93,6 @@
- - note.note.form @@ -112,7 +104,7 @@ - +
@@ -137,7 +129,6 @@
- note.note.tree @@ -145,7 +136,6 @@ tree - Notes note.note diff --git a/addons/note/static/src/css/note.css b/addons/note/static/src/css/note.css index 4b3c7e0e57d..39800834417 100644 --- a/addons/note/static/src/css/note.css +++ b/addons/note/static/src/css/note.css @@ -13,8 +13,6 @@ box-shadow: 5px 5px 7px rgba(33,33,33,.7); } - - .oe_kanban_record .oe_kanban_card { -webkit-transform: rotate(-2deg); -o-transform: rotate(-2deg); @@ -22,12 +20,11 @@ } .oe_kanban_record:nth-of-type(even) .oe_kanban_card { - -webkit-transform: rotate(-1deg); - -o-transform: rotate(-1deg); - -moz-transform:rotate(-1deg); + -webkit-transform: rotate(1deg); + -o-transform: rotate(1deg); + -moz-transform:rotate(1deg); } - .oe_kanban_record:nth-of-type(3n) .oe_kanban_card { -webkit-transform: rotate(4deg); -o-transform: rotate(4deg); @@ -51,38 +48,27 @@ -o-transform: rotate(1deg); -moz-transform:rotate(1deg); } -/* .openerp .oe_fold_column:nth-child(even) .oe_kanban_card { */ -/* -webkit-transform: rotate(-3deg); */ -/* -o-transform: rotate(-3deg); */ -/* -moz-transform:rotate(-3deg); */ -/* } */ -/* .openerp .oe_kanban_groups_records .oe_kanban_column .oe_fold_column:nth-child(even) .oe_kanban_card { */ -/* -o-transform:rotate(1deg); */ -/* -webkit-transform:rotate(1deg); */ -/* -moz-transform:rotate(1deg); */ -/* position:relative; */ -/* top:3px; */ -/* } */ +.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_fold_column:nth-child(3n) .oe_kanban_card { */ -/* -o-transform:rotate(-2deg); */ -/* -webkit-transform:rotate(-2deg); */ -/* -moz-transform:rotate(-2deg); */ -/* position:relative; */ -/* top:-3px; */ -/* } */ +.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_fold_column:nth-child(5n) .oe_kanban_card { */ -/* -o-transform:rotate(2deg); */ -/* -webkit-transform:rotate(2deg); */ -/* -moz-transform:rotate(2deg); */ -/* position:relative; */ -/* top:-5px; */ -/* } */ +.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_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card:hover, -.openerp .oe_webclient .oe_application .oe_view_manager .oe_view_manager_body .oe_view_manager_view_kanban .oe_kanban_view .oe_kanban_groups .oe_kanban_groups_records .oe_kanban_column .oe_fold_column .oe_kanban_card:focus +.openerp .oe_kanban_column .oe_fold_column .oe_kanban_card:hover, +.openerp .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); From 531e077f1bcbbb4d3e45fe1985e6f246132b468e Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Tue, 14 Aug 2012 17:42:40 +0200 Subject: [PATCH 06/69] [FIX] some misc fixes bzr revid: acl@openerp.com-20120814154240-on30lw5qfp66xj7q --- addons/note/note.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index 7d0ff170d79..05c5ea6eadf 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -32,8 +32,8 @@ class note_stage(osv.Model): '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), 'fold': fields.boolean('Folded'), - } + _sql_constraints = [ ] @@ -64,13 +64,13 @@ class note_note(osv.Model): for note in self.browse(cr, uid, ids, context=context): res[note.id] = note.note.split('\n')[0] return res - + def _set_note_first_line(self, cr, uid, id, name, value, args, context=None): # # todo should set the pad first line (as title) # return self.write(cr, uid, [id], {'name': value}, context=context) - + _columns = { 'name': fields.function(_get_note_first_line,_fnct_inv=_set_note_first_line, string='Note Summary', type="text", store=True), 'note': fields.text('Pad Content'), @@ -79,8 +79,7 @@ class note_note(osv.Model): 'stage_id': fields.many2one('note.stage', 'Stage'), 'active': fields.boolean('Active'), 'color': fields.integer('Color Index'), - #'follower_ids': fields.one2many('mail.subscription', 'res_id', 'Followers', domain=[('res_model','=', 'note.note')]) - 'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers', join_filter="mail_subscription.res_model='note.note'") + 'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers', join_filter="mail_subscription.res_model='note.note'") } _sql_constraints = [ @@ -97,18 +96,15 @@ class note_note(osv.Model): 'note_pad': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), } - _order = 'sequence asc' - - 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 From 2045fa1bbc297105f754c058c82f769806414153 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 17 Aug 2012 15:27:38 +0200 Subject: [PATCH 07/69] [IMP] note: update the module's descriptor bzr revid: abo@openerp.com-20120817132738-dgvgd3in70ylthwm --- addons/note/__openerp__.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index c9200324bb7..576d2b82f46 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -19,34 +19,30 @@ # ############################################################################## - { 'name': 'Notes', 'version': '0.1', 'category': 'Tools', 'description': """ This module allows users to create their own notes inside OpenERP -============================================================================== +================================================================= With this module you can allow users to take notes inside OpenERP. These notes can be shared with OpenERP or external users. -They also can be organized following user dependant categories. +They also can be organized following user dependant categories. Notes can be found in the 'Home' main menu, under 'Tool' submenu. """, 'author': 'OpenERP SA', 'website': 'http://openerp.com', 'depends': ['base_tools','mail','pad'], - 'init_xml': [], - 'update_xml': [ + 'data': [ 'security/note_security.xml', 'security/ir.model.access.csv', 'note_view.xml', ], - 'demo_xml': [ + 'demo': [ "note_data.xml" ], - 'test':[ - ], 'css': [ 'static/src/css/note.css', ], @@ -55,4 +51,5 @@ Notes can be found in the 'Home' main menu, under 'Tool' submenu. 'category': 'Tools', 'images': [], } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 9c811fb481a8df3cea8f9788afe222ef7bea709c Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 17 Aug 2012 15:52:49 +0200 Subject: [PATCH 08/69] [FIX] note: extract demo data in note_demo.xml bzr revid: abo@openerp.com-20120817135249-mg1eovpwt3u4lli2 --- addons/note/__openerp__.py | 3 +- addons/note/note_data.xml | 209 ++---------------------------------- addons/note/note_demo.xml | 214 +++++++++++++++++++++++++++++++++++++ 3 files changed, 223 insertions(+), 203 deletions(-) create mode 100644 addons/note/note_demo.xml diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 576d2b82f46..2241e7bd980 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -41,7 +41,7 @@ Notes can be found in the 'Home' main menu, under 'Tool' submenu. 'note_view.xml', ], 'demo': [ - "note_data.xml" + "note_demo.xml", ], 'css': [ 'static/src/css/note.css', @@ -49,7 +49,6 @@ Notes can be found in the 'Home' main menu, under 'Tool' submenu. 'installable': True, 'application': True, 'category': 'Tools', - 'images': [], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml index 15226bd48b0..2a40923b0f4 100644 --- a/addons/note/note_data.xml +++ b/addons/note/note_data.xml @@ -1,224 +1,31 @@ + Today 1 - + + Tomorrow 2 - + + This week 3 - + + This month 4 - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/addons/note/note_demo.xml b/addons/note/note_demo.xml new file mode 100644 index 00000000000..3e960638de0 --- /dev/null +++ b/addons/note/note_demo.xml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9a7cc1436dba539d1ca1e16343700dabe9227a48 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 17 Aug 2012 15:57:49 +0200 Subject: [PATCH 09/69] [IMP] note: rename the to level menu 'Feeds' into 'Home' bzr revid: abo@openerp.com-20120817135749-yr9pg3hc2u5mo62q --- addons/note/note_data.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml index 2a40923b0f4..8d8516b895f 100644 --- a/addons/note/note_data.xml +++ b/addons/note/note_data.xml @@ -2,6 +2,11 @@ + + + + Today 1 @@ -28,4 +33,3 @@ - From b34138bbeb72312816676546251a57e2951995cf Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 17 Aug 2012 17:13:12 +0200 Subject: [PATCH 10/69] [FIX] note: forgot to add note_data.xml to the descriptor bzr revid: abo@openerp.com-20120817151312-4y2mdrimw8xu4uhy --- addons/note/__openerp__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 2241e7bd980..1410ff10d9e 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -34,20 +34,24 @@ Notes can be found in the 'Home' main menu, under 'Tool' submenu. """, 'author': 'OpenERP SA', 'website': 'http://openerp.com', - 'depends': ['base_tools','mail','pad'], + 'depends': [ + 'base_tools', + 'mail', + 'pad', + ], 'data': [ 'security/note_security.xml', 'security/ir.model.access.csv', + 'note_data.xml', 'note_view.xml', ], 'demo': [ - "note_demo.xml", + 'note_demo.xml', ], 'css': [ 'static/src/css/note.css', ], 'installable': True, - 'application': True, 'category': 'Tools', } From 92b32aa7672c31619f2b44c17933d27acaf4ead7 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 17 Aug 2012 18:39:53 +0200 Subject: [PATCH 11/69] [FIX] note: properly override the 'Feeds' top level item with 'Home'. also add a menu section and sub menuitems with temporary actions bzr revid: abo@openerp.com-20120817163953-3aaoe31xlxdnn7vd --- addons/note/note_data.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml index 8d8516b895f..8e896e19783 100644 --- a/addons/note/note_data.xml +++ b/addons/note/note_data.xml @@ -2,10 +2,21 @@ + + News Feed + mail.wall + + + + id="mail.mail_feeds_main"/> + + + + + Today From 9a2f884e1c8efe85ed29f02b11e0e03aa9d6fdf2 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 13:14:17 +0200 Subject: [PATCH 12/69] [IMP] indentation bzr revid: abo@openerp.com-20120820111417-2spnfk02v2t2zarc --- addons/note/note_data.xml | 18 +----- addons/note/note_view.xml | 112 ++++++++++++++++++++++---------------- 2 files changed, 65 insertions(+), 65 deletions(-) diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml index 8e896e19783..11eecc94b1b 100644 --- a/addons/note/note_data.xml +++ b/addons/note/note_data.xml @@ -1,22 +1,6 @@ - - - - News Feed - mail.wall - - - - - - - - - - - + Today diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 39dca553c39..1c4cc2f58c2 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -2,6 +2,22 @@ + + News Feed + mail.wall + + + + + + + + + + + + note.stage.form @@ -25,9 +41,9 @@ - - - + + + @@ -44,7 +60,7 @@ + id="menu_notes_stage" action="action_note_stage" sequence="2"/> @@ -52,44 +68,44 @@ note.note kanban - - - - - - - - - - -
- -
- í -
+ + + + + + + + + + +
+ +
+ í +
- -
- - -
- -
- - - -
- -
-
-
-
-
+ +
+ + +
+ +
+ + + +
+ +
+
+
+
+
@@ -100,11 +116,11 @@ form
-
- - -
- +
+ + +
+
@@ -129,7 +145,7 @@
- + note.note.tree note.note @@ -143,7 +159,7 @@ kanban,tree,form - + From 2f228383abd2105c712c39136ef12a69e40cef74 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 14:32:11 +0200 Subject: [PATCH 13/69] [IMP] indentation bzr revid: abo@openerp.com-20120820123211-4bqf7dajj33767vm --- addons/crm/crm_meeting_view.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index d7f59267a30..1133dc17b37 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -3,16 +3,15 @@ - - calendar.attendee.form.inherit - calendar.attendee - - - - - + calendar.attendee.form.inherit + calendar.attendee + + + + + From d28f95ea85cd9f82eb031dbef8cfa9f1f6c63d7b Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 16:11:58 +0200 Subject: [PATCH 14/69] [IMP] mail: rename 'Feeds' into 'Home' bzr revid: abo@openerp.com-20120820141158-q7hkgolr07kkw0b1 --- addons/mail/mail_thread_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml index 68727832e53..35acad57bc2 100644 --- a/addons/mail/mail_thread_view.xml +++ b/addons/mail/mail_thread_view.xml @@ -3,7 +3,7 @@ - From ad16f2e48cc98cd6ea52bb5f7b7f91aa096e56ba Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 16:12:21 +0200 Subject: [PATCH 15/69] [IMP] note: add proper actions to Calendar, Notes and Contacts menu items bzr revid: abo@openerp.com-20120820141221-si82z13n05h5lkt1 --- addons/note/note_view.xml | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 1c4cc2f58c2..21d67309492 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -2,21 +2,9 @@ - - News Feed - mail.wall - - - - - - - - - - - + + + @@ -38,7 +26,6 @@ note.stage tree - @@ -47,7 +34,6 @@ - Stages @@ -57,10 +43,8 @@ [('user_id','=',uid)] - - - + @@ -160,7 +144,7 @@ - + From aa5a055c6d10d60b70abdd365eb6e52f51764555 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 16:51:38 +0200 Subject: [PATCH 16/69] [IMP] note: reorganize code bzr revid: abo@openerp.com-20120820145138-l7a4985im5nua3xq --- addons/note/note.py | 48 +++++++++++++++++---------------------- addons/note/note_view.xml | 41 +++++++++++++++++---------------- 2 files changed, 42 insertions(+), 47 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index 05c5ea6eadf..96c7cea9602 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -22,7 +22,7 @@ from openerp.osv import osv, fields from tools.translate import _ -class note_stage(osv.Model): +class note_stage(osv.osv): """ Category of Note """ _name = "note.stage" @@ -46,13 +46,7 @@ class note_stage(osv.Model): } -# class many2many_filter(fields.many2many) - -# grep many2many_mod dans le code - - - -class note_note(osv.Model): +class note_note(osv.osv): """ Note """ _name = 'note.note' _inherit = ['mail.thread','pad.common'] @@ -71,6 +65,25 @@ class note_note(osv.Model): # return self.write(cr, uid, [id], {'name': value}, context=context) + + def _get_default_stage_id(self,cr,uid,context=None): + id = self.pool.get('note.stage').search(cr,uid,[('sequence','=','1')]) + return id[0] + + 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 + + def stage_set(self,cr,uid,ids,stage_id,context=None): + self.write(cr,uid,ids,{'stage_id': stage_id}) + _columns = { 'name': fields.function(_get_note_first_line,_fnct_inv=_set_note_first_line, string='Note Summary', type="text", store=True), 'note': fields.text('Pad Content'), @@ -85,11 +98,6 @@ class note_note(osv.Model): _sql_constraints = [ ] - - def _get_default_stage_id(self,cr,uid,context=None): - id = self.pool.get('note.stage').search(cr,uid,[('sequence','=','1')]) - return id[0] - _defaults = { 'active' : 1, 'stage_id' : _get_default_stage_id, @@ -98,20 +106,6 @@ class note_note(osv.Model): _order = 'sequence asc' - 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 - _group_by_full = { 'stage_id' : _read_group_stage_ids, } - - def stage_set(self,cr,uid,ids,stage_id,context=None): - self.write(cr,uid,ids,{'stage_id': stage_id}) diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 21d67309492..fd35e32de42 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -34,6 +34,7 @@
+ Stages @@ -63,28 +64,27 @@
- -
- í -
+ +
+ í +
- -
- - -
- -
- - - -
+ +
+ + +
+
+ + + +
@@ -136,6 +136,7 @@ tree
+ Notes note.note From c23bd0cf0102aee6cd9270e3cff0619b4257e4df Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 18:26:24 +0200 Subject: [PATCH 17/69] [FIX] project: remove useless dummy method (made useless by RCO review - revno 6692.2.175) bzr revid: abo@openerp.com-20120820162624-l6q3sinwedkyvlbe --- addons/project/project.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 1a8f8c8bfe5..ab1c3c47dfe 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -250,9 +250,6 @@ class project(osv.osv): type='many2many', relation='res.users', string='Followers'), } - def dummy(self, cr, uid, ids, context): - return True - def _get_type_common(self, cr, uid, context): ids = self.pool.get('project.task.type').search(cr, uid, [('case_default','=',1)], context=context) return ids @@ -526,7 +523,7 @@ def Project(): mail_alias = self.pool.get('mail.alias') if not vals.get('alias_id'): vals.pop('alias_name', None) # prevent errors during copy() - alias_id = mail_alias.create_unique_alias(cr, uid, + alias_id = mail_alias.create_unique_alias(cr, uid, # Using '+' allows using subaddressing for those who don't # have a catchall domain setup. {'alias_name': "project+"+short_name(vals['name'])}, From 1fec472ce18ea1ffc644e059e3e815a43bf7ee7e Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 18:27:16 +0200 Subject: [PATCH 18/69] [FIX] note: add dependance to base_calendar bzr revid: abo@openerp.com-20120820162716-wfczdudtaa03uh79 --- addons/note/__openerp__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/note/__openerp__.py b/addons/note/__openerp__.py index 1410ff10d9e..0f9e0860e8d 100644 --- a/addons/note/__openerp__.py +++ b/addons/note/__openerp__.py @@ -35,6 +35,7 @@ Notes can be found in the 'Home' main menu, under 'Tool' submenu. 'author': 'OpenERP SA', 'website': 'http://openerp.com', 'depends': [ + 'base_calendar', 'base_tools', 'mail', 'pad', @@ -52,7 +53,8 @@ Notes can be found in the 'Home' main menu, under 'Tool' submenu. 'static/src/css/note.css', ], 'installable': True, - 'category': 'Tools', + 'application': True, + 'auto_install': False, } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 6de8c4b8e4f037f5297741e08ab643eada09728d Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 18:27:48 +0200 Subject: [PATCH 19/69] [IMP] note: rename the field 'note_pad' into 'note_pad_url' bzr revid: abo@openerp.com-20120820162748-f92eq99kywwq7vz7 --- addons/note/note.py | 4 ++-- addons/note/note_view.xml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/note/note.py b/addons/note/note.py index 96c7cea9602..25f6c170f42 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -87,7 +87,7 @@ class note_note(osv.osv): _columns = { 'name': fields.function(_get_note_first_line,_fnct_inv=_set_note_first_line, string='Note Summary', type="text", store=True), 'note': fields.text('Pad Content'), - 'note_pad': fields.char('Pad Url', size=250), + 'note_pad_url': fields.char('Pad Url', size=250), 'sequence': fields.integer('Sequence'), 'stage_id': fields.many2one('note.stage', 'Stage'), 'active': fields.boolean('Active'), @@ -101,7 +101,7 @@ class note_note(osv.osv): _defaults = { 'active' : 1, 'stage_id' : _get_default_stage_id, - 'note_pad': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), + 'note_pad_url': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context), } _order = 'sequence asc' diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index fd35e32de42..4a025a45b23 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -104,7 +104,8 @@ - + +
From ae7a429e345cd685aa74175a05e48e78367869a4 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 19:23:16 +0200 Subject: [PATCH 20/69] [IMP] remove rotation while hovering notes bzr revid: abo@openerp.com-20120820172316-fv3dt5q8gc24y7ty --- addons/note/static/src/css/note.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/note/static/src/css/note.css b/addons/note/static/src/css/note.css index 39800834417..e5a3d1455c2 100644 --- a/addons/note/static/src/css/note.css +++ b/addons/note/static/src/css/note.css @@ -7,7 +7,7 @@ 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); @@ -67,15 +67,15 @@ -moz-transform:rotate(-1deg); } -.openerp .oe_kanban_column .oe_fold_column .oe_kanban_card:hover, +.openerp .oe_kanban_column .oe_fold_column .oe_kanban_card:hover, .openerp .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: scale(1.25); - -moz-transform: scale(1.25); - -o-transform: scale(1.25); + -webkit-transform: rotate(0); + -moz-transform: rotate(0); + -o-transform: rotate(0); position:relative; z-index:5; } From 6dd74a31b0f6087faeaba155cd861a5a4f03343b Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 19:23:48 +0200 Subject: [PATCH 21/69] [IMP] rename some of the mail menuitems bzr revid: abo@openerp.com-20120820172348-t1i0r9lwkid0796v --- addons/mail/mail_group_view.xml | 8 ++++---- addons/mail/mail_thread_view.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/mail/mail_group_view.xml b/addons/mail/mail_group_view.xml index a71ec972326..4ef54da2611 100644 --- a/addons/mail/mail_group_view.xml +++ b/addons/mail/mail_group_view.xml @@ -61,8 +61,8 @@
-
+

@@ -123,7 +123,7 @@ - Groups + Join a group mail.group form kanban,tree,form @@ -132,6 +132,6 @@ - + diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml index 35acad57bc2..302d28f5509 100644 --- a/addons/mail/mail_thread_view.xml +++ b/addons/mail/mail_thread_view.xml @@ -12,13 +12,13 @@ - News Feed + My Feeds - My Feeds + My Posts From 39421ebddbd61343ec2d404b57ef4213d12aa251 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 19:24:21 +0200 Subject: [PATCH 22/69] [IMP] notes data and demo data bzr revid: abo@openerp.com-20120820172421-5eh0fe1bw2pl5gxb --- addons/note/note_data.xml | 18 +++---- addons/note/note_demo.xml | 110 +++++++++----------------------------- addons/note/note_view.xml | 2 +- 3 files changed, 31 insertions(+), 99 deletions(-) diff --git a/addons/note/note_data.xml b/addons/note/note_data.xml index 11eecc94b1b..29bd78d5223 100644 --- a/addons/note/note_data.xml +++ b/addons/note/note_data.xml @@ -2,29 +2,23 @@ - - Today + + Todo today 1 - - Tomorrow + + Todo later 2 - - This week + + For information 3 - - This month - 4 - - - diff --git a/addons/note/note_demo.xml b/addons/note/note_demo.xml index 3e960638de0..76f525b88ca 100644 --- a/addons/note/note_demo.xml +++ b/addons/note/note_demo.xml @@ -2,7 +2,7 @@ - + - + + 2 - + - + - + - + - + - + - + - + + 3 - + - + - + - + - + - + + 5 - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + 7 diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 4a025a45b23..2086794bb04 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -2,7 +2,7 @@ - + From 5fd1c3f9f213bf09c483322063a90e454af5f055 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 20 Aug 2012 19:33:27 +0200 Subject: [PATCH 23/69] [IMP] override original actions to modify their name and/or context bzr revid: abo@openerp.com-20120820173327-zb3o37yrid3khf7k --- addons/note/note_view.xml | 42 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/addons/note/note_view.xml b/addons/note/note_view.xml index 2086794bb04..c31850d1a65 100644 --- a/addons/note/note_view.xml +++ b/addons/note/note_view.xml @@ -3,8 +3,46 @@ - - + + + + Calendar + crm.meeting + calendar,tree,form,gantt + + + {"calendar_default_user_id": uid} + +

+ Click to schedule a new meeting. +

+ The agenda is shared between employees and fully integrated with + other applications such as the employee holidays or the business + opportunities. +

+
+
+ + + + + Contacts + ir.actions.act_window + res.partner + form + kanban,tree,form + + +

+ Click to add a contact in your address book. +

+ OpenERP helps you easily track all activities related to + a customer; discussions, history of business opportunities, + documents, etc. +

+
+
+ From 4ac5de0d505f4d93ff2ad578068750554f0cc83d Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Tue, 21 Aug 2012 15:29:15 +0200 Subject: [PATCH 24/69] [IMP] demo data bzr revid: abo@openerp.com-20120821132915-2fi83q3wsw29exzf --- addons/note/note_demo.xml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/note/note_demo.xml b/addons/note/note_demo.xml index 76f525b88ca..e322f362ef5 100644 --- a/addons/note/note_demo.xml +++ b/addons/note/note_demo.xml @@ -12,7 +12,7 @@
- + 2
@@ -24,8 +24,8 @@ ]]>
- - + + @@ -53,18 +53,18 @@ - + - - + @@ -87,7 +87,7 @@ - + 3 @@ -99,18 +99,18 @@ - + - - - + + @@ -120,20 +120,21 @@ ]]> - - + + 5 - - + + 7 @@ -144,8 +145,7 @@ - - 7 + From 1eedcaedad3a528c6eea48571b9eb215b5a5d225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Wed, 29 Aug 2012 14:56:40 +0200 Subject: [PATCH 25/69] [IMP] point_of_sale: TODO changes bzr revid: fva@openerp.com-20120829125640-5bml13zupja3w30b --- addons/point_of_sale/static/src/js/TODO.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/TODO.txt b/addons/point_of_sale/static/src/js/TODO.txt index edadbe188ea..5eeb4c2606a 100644 --- a/addons/point_of_sale/static/src/js/TODO.txt +++ b/addons/point_of_sale/static/src/js/TODO.txt @@ -49,9 +49,9 @@ TODO AUG 20 v L'impression est foireuse * CLIENT - - create a new branch + v create a new branch - Self-checkout welcome screen - - removal of products for the root category + ~ removal of products for the root category - Terminal de payement - Code à barres - Vidanges From beb8a590e55bfc978112f7e2497c2d8212ece4cc Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 31 Aug 2012 15:50:10 +0200 Subject: [PATCH 26/69] [IMP] product view improvements bzr revid: fp@tinyerp.com-20120831135010-zo37jb6nyngvqfpy --- addons/event_sale/event_sale_view.xml | 3 +- addons/product/product.py | 6 +- addons/product/product_view.xml | 81 ++++++++------ addons/product_expiry/product_expiry_view.xml | 8 +- .../product_manufacturer_view.xml | 32 +++--- addons/purchase/purchase_view.xml | 9 +- .../purchase_requisition_view.xml | 2 - addons/stock/product_view.xml | 65 +++++------ addons/stock_location/stock_location_view.xml | 101 +++++++++--------- addons/warning/warning_view.xml | 14 ++- 10 files changed, 158 insertions(+), 163 deletions(-) diff --git a/addons/event_sale/event_sale_view.xml b/addons/event_sale/event_sale_view.xml index 53e8a4cc18f..c39cff04bd9 100644 --- a/addons/event_sale/event_sale_view.xml +++ b/addons/event_sale/event_sale_view.xml @@ -8,8 +8,9 @@ + - + diff --git a/addons/product/product.py b/addons/product/product.py index 214445204bb..699fa66dd8f 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -288,7 +288,7 @@ class product_template(osv.osv): 'rental': fields.boolean('Can be Rent'), 'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]" ,help="Select category for the current product"), 'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Product Price'), help="Base price for computing the customer price. Sometimes called the catalog price."), - 'standard_price': fields.float('Cost Price', required=True, digits_compute=dp.get_precision('Product Price'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price.", groups="base.group_user"), + 'standard_price': fields.float('Cost', required=True, digits_compute=dp.get_precision('Product Price'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price.", groups="base.group_user"), 'volume': fields.float('Volume', help="The volume in m3."), 'weight': fields.float('Gross Weight', digits_compute=dp.get_precision('Stock Weight'), help="The gross weight in Kg."), 'weight_net': fields.float('Net Weight', digits_compute=dp.get_precision('Stock Weight'), help="The net weight in Kg."), @@ -535,9 +535,9 @@ class product_product(osv.osv): 'outgoing_qty': fields.function(_product_outgoing_qty, type='float', string='Outgoing'), 'price': fields.function(_product_price, type='float', string='Pricelist', digits_compute=dp.get_precision('Product Price')), 'lst_price' : fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Product Price')), - 'code': fields.function(_product_code, type='char', string='Reference'), + 'code': fields.function(_product_code, type='char', string='Internal Reference'), 'partner_ref' : fields.function(_product_partner_ref, type='char', string='Customer ref'), - 'default_code' : fields.char('Reference', size=64, select=True), + 'default_code' : fields.char('Internal Reference', size=64, select=True), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the product without removing it."), 'variants': fields.char('Variants', size=64), 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"), diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index d341b5883d6..cc0b7073a58 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -71,6 +71,12 @@
@@ -78,57 +84,60 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + @@ -150,6 +159,8 @@ + @@ -534,7 +545,7 @@ product.packaging - + @@ -606,7 +617,7 @@ product.supplierinfo - + diff --git a/addons/product_expiry/product_expiry_view.xml b/addons/product_expiry/product_expiry_view.xml index f883ca55fe0..88ea6f365e8 100644 --- a/addons/product_expiry/product_expiry_view.xml +++ b/addons/product_expiry/product_expiry_view.xml @@ -21,14 +21,14 @@ product.product - - + + - - + +
diff --git a/addons/product_manufacturer/product_manufacturer_view.xml b/addons/product_manufacturer/product_manufacturer_view.xml index 5f620747d64..88f528693df 100644 --- a/addons/product_manufacturer/product_manufacturer_view.xml +++ b/addons/product_manufacturer/product_manufacturer_view.xml @@ -7,23 +7,21 @@ product.product - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index f513e2a60e8..2dee145145b 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -562,11 +562,10 @@ product.product - - - - - + +
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml index a1b270934e2..d4e8e3e20a9 100644 --- a/addons/purchase_requisition/purchase_requisition_view.xml +++ b/addons/purchase_requisition/purchase_requisition_view.xml @@ -183,9 +183,7 @@ - -
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index 477c458da02..d146d5fa0fb 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -50,38 +50,33 @@ - + product.normal.procurement.locations.inherit product.product - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -93,8 +88,8 @@