From 44e02f756b0066f61e1bbea648f92ea23a0aac02 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Wed, 8 Feb 2012 16:33:04 +0100 Subject: [PATCH 01/90] =?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/90] [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 3bd4660e92f57d1bd1a8b985f2590e13db31f710 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Wed, 8 Aug 2012 12:36:12 +0530 Subject: [PATCH 03/90] [IMP] account : Convert invoice line to editable list and call the onchange method to set all the information. bzr revid: mdi@tinyerp.com-20120808070612-20q3wyqkevgtjnx6 --- addons/account/account_invoice.py | 6 ++++++ addons/account/account_invoice_view.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index b1c5db23df6..7000ca189dc 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1361,10 +1361,16 @@ class account_invoice_line(osv.osv): 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True), 'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True) } + + def default_account_id(self, cr, uid, ids, context=None): + prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context) + return prop and prop.id or False + _defaults = { 'quantity': 1, 'discount': 0.0, 'price_unit': _price_unit_default, + 'account_id': default_account_id, } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 501a50b96c2..8fbd85f2599 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -347,7 +347,7 @@ - + Date: Thu, 9 Aug 2012 10:57:30 +0530 Subject: [PATCH 04/90] [FIX]purchase :set a po line editable bzr revid: mma@tinyerp.com-20120809052730-4c0ykb7k54v6ju44 --- addons/purchase/purchase_view.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 47216a11cac..9c8b508553d 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -218,11 +218,12 @@ - + + - - + + From 1a36733f5be49a3de6d45548cf5b4f41caad7ceb Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Thu, 9 Aug 2012 14:14:30 +0530 Subject: [PATCH 05/90] [IMP]hr_expense : made expense line editable bzr revid: cha@tinyerp.com-20120809084430-fvhy9nfph9xiwwna --- addons/hr_expense/hr_expense.py | 29 ++++++++++++++++++++++----- addons/hr_expense/hr_expense_view.xml | 16 +++++++++++++-- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index b1192701dfb..74eac5d99c2 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -253,15 +253,23 @@ class hr_expense_line(osv.osv): res = dict(cr.fetchall()) return res + def _get_uom_id(self, cr, uid, context=None): + try: + proxy = self.pool.get('ir.model.data') + result = proxy.get_object_reference(cr, uid, 'product', 'product_uom_unit') + return result[1] + except Exception, ex: + return False + _columns = { 'name': fields.char('Expense Note', size=128, required=True), 'date_value': fields.date('Date', required=True), 'expense_id': fields.many2one('hr.expense.expense', 'Expense', ondelete='cascade', select=True), 'total_amount': fields.function(_amount, string='Total', digits_compute=dp.get_precision('Account')), 'unit_amount': fields.float('Unit Price', digits_compute=dp.get_precision('Account')), - 'unit_quantity': fields.float('Quantities' ), + 'unit_quantity': fields.float('Quantities'), 'product_id': fields.many2one('product.product', 'Product', domain=[('hr_expense_ok','=',True)]), - 'uom_id': fields.many2one('product.uom', 'Unit of Measure'), + 'uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True), 'description': fields.text('Description'), 'analytic_account': fields.many2one('account.analytic.account','Analytic account'), 'ref': fields.char('Reference', size=32), @@ -270,20 +278,31 @@ class hr_expense_line(osv.osv): _defaults = { 'unit_quantity': 1, 'date_value': lambda *a: time.strftime('%Y-%m-%d'), + 'uom_id': _get_uom_id, } _order = "sequence, date_value desc" - def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None): + def onchange_product_id(self, cr, uid, ids, product_id, context=None): res = {} if product_id: product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) res['name'] = product.name amount_unit = product.price_get('standard_price')[product.id] res['unit_amount'] = amount_unit - if not uom_id: - res['uom_id'] = product.uom_id.id + res['uom_id'] = product.uom_id.id return {'value': res} + def onchange_uom(self, cr, uid, ids, product_id, uom_id, context=None): + res = {'value':{}} + if product_id: + product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) + if uom.category_id.id != product.uom_id.category_id.id: + res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} + uom_id = product.uom_id.id + res['value'].update({'uom_id': uom_id}) + return res + hr_expense_line() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index 67c08ee8a65..57b7a4cc37f 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -92,7 +92,7 @@
- + @@ -102,12 +102,24 @@
+ + + + + + + + + + + +
From 4cc8dce4ec176928cf7d092f587f9c1b6ec9db75 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Thu, 9 Aug 2012 16:21:03 +0530 Subject: [PATCH 06/90] [IMP] hr_expense : added condition to function bzr revid: cha@tinyerp.com-20120809105103-tm0m7g854zglxfrg --- addons/hr_expense/hr_expense.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 74eac5d99c2..d822d466901 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -294,13 +294,14 @@ class hr_expense_line(osv.osv): def onchange_uom(self, cr, uid, ids, product_id, uom_id, context=None): res = {'value':{}} - if product_id: - product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) - uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) - if uom.category_id.id != product.uom_id.category_id.id: - res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} - uom_id = product.uom_id.id - res['value'].update({'uom_id': uom_id}) + if uom_id: + if product_id: + product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) + if uom.category_id.id != product.uom_id.category_id.id: + res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} + uom_id = product.uom_id.id + res['value'].update({'uom_id': uom_id}) return res hr_expense_line() From 87c4a3a3b7406cd8bba071846e230f48d7c03da8 Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Mon, 13 Aug 2012 19:04:29 +0200 Subject: [PATCH 07/90] 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 08/90] 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 09/90] 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 10/90] [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 cfa66e42f8e99609aaddd09a612884a4c373c1fe Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Thu, 16 Aug 2012 18:06:17 +0530 Subject: [PATCH 11/90] [IMP] hr_expense: improve code as per suggestion bzr revid: cha@tinyerp.com-20120816123617-afade73y5wqune2r --- addons/hr_expense/hr_expense.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 3683eff9f1d..fca62261814 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -254,12 +254,8 @@ class hr_expense_line(osv.osv): return res def _get_uom_id(self, cr, uid, context=None): - try: - proxy = self.pool.get('ir.model.data') - result = proxy.get_object_reference(cr, uid, 'product', 'product_uom_unit') - return result[1] - except Exception, ex: - return False + result = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_unit') + return result and result[1] or False _columns = { 'name': fields.char('Expense Note', size=128, required=True), @@ -294,14 +290,15 @@ class hr_expense_line(osv.osv): def onchange_uom(self, cr, uid, ids, product_id, uom_id, context=None): res = {'value':{}} - if uom_id: - if product_id: - product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) - uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) - if uom.category_id.id != product.uom_id.category_id.id: - res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} - uom_id = product.uom_id.id - res['value'].update({'uom_id': uom_id}) + if not uom_id: + return res + if product_id: + product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) + if uom.category_id.id != product.uom_id.category_id.id: + res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} + uom_id = product.uom_id.id + res['value'].update({'uom_id': uom_id}) return res hr_expense_line() From b478264bded10e59ef4ff83997fe03757dcd9d75 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Thu, 16 Aug 2012 19:11:49 +0530 Subject: [PATCH 12/90] [IMP] hr_expense: made change in condition bzr revid: cha@tinyerp.com-20120816134149-wjumyv73z72sh6w5 --- addons/hr_expense/hr_expense.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index fca62261814..44ecef2ebba 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -290,15 +290,14 @@ class hr_expense_line(osv.osv): def onchange_uom(self, cr, uid, ids, product_id, uom_id, context=None): res = {'value':{}} - if not uom_id: + if not uom_id or not product_id: return res - if product_id: - product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) - uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) - if uom.category_id.id != product.uom_id.category_id.id: - res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} - uom_id = product.uom_id.id - res['value'].update({'uom_id': uom_id}) + product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) + if uom.category_id.id != product.uom_id.category_id.id: + res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} + uom_id = product.uom_id.id + res['value'].update({'uom_id': uom_id}) return res hr_expense_line() From 811466be2faef29b9a0f53f4ae5126a8a8134bba Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 17 Aug 2012 11:21:34 +0530 Subject: [PATCH 13/90] [IMP] account : Improved the onchange uos_id method. bzr revid: mdi@tinyerp.com-20120817055134-4p4gcsgusmyk34wd --- addons/account/account_invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 225904f28b7..f0d2f2d8360 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1479,10 +1479,11 @@ class account_invoice_line(osv.osv): prod = self.pool.get('product.product').browse(cr, uid, product, context=context) prod_uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context) if prod.uom_id.category_id.id != prod_uom.category_id.id: - warning = { + warning = { 'title': _('Warning!'), 'message': _('The selected unit of measure is not compatible with the unit of measure of the product.') - } + } + res['value'].update({'uos_id': prod.uom_id.id}) return {'value': res['value'], 'warning': warning} return res From 32201e28604f119a0c59f6aee8fe4b511f637c6f Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 17 Aug 2012 11:26:39 +0530 Subject: [PATCH 14/90] [IMP] account : Improved the code. bzr revid: mdi@tinyerp.com-20120817055639-sc5c9awb2h8d59zl --- addons/account/account_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index f0d2f2d8360..44531a1a266 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1362,7 +1362,7 @@ class account_invoice_line(osv.osv): 'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True) } - def default_account_id(self, cr, uid, ids, context=None): + def _default_account_id(self, cr, uid, ids, context=None): prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context) return prop and prop.id or False @@ -1370,7 +1370,7 @@ class account_invoice_line(osv.osv): 'quantity': 1, 'discount': 0.0, 'price_unit': _price_unit_default, - 'account_id': default_account_id, + 'account_id': _default_account_id, } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): From 5458cc1d9239c51b2dc1c0eb97d5f0258e1effdb Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Fri, 17 Aug 2012 14:12:42 +0530 Subject: [PATCH 15/90] [IMP] hr_expense: made little changes in code bzr revid: cha@tinyerp.com-20120817084242-79xf2pa2souihp8d --- addons/hr_expense/hr_expense.py | 3 +-- addons/hr_expense/hr_expense_view.xml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 44ecef2ebba..2df0deb6fc4 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -296,8 +296,7 @@ class hr_expense_line(osv.osv): uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context) if uom.category_id.id != product.uom_id.category_id.id: res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')} - uom_id = product.uom_id.id - res['value'].update({'uom_id': uom_id}) + res['value'].update({'uom_id': product.uom_id.id}) return res hr_expense_line() diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index c9224d43932..8917588daf5 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -108,7 +108,7 @@ - + From 4b364238c3ee93130b2918d481a0296e34cd234a Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Fri, 17 Aug 2012 15:17:27 +0530 Subject: [PATCH 16/90] [IMP] hr_expense: made little changes in demo data bzr revid: cha@tinyerp.com-20120817094727-8u7dt2djaawz4lc0 --- addons/hr_expense/hr_expense_demo.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml index e1d6b0a00b0..eddaf03ad38 100644 --- a/addons/hr_expense/hr_expense_demo.xml +++ b/addons/hr_expense/hr_expense_demo.xml @@ -11,6 +11,8 @@ service Car Travel Expenses CarTRA + + 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 From 2045fa1bbc297105f754c058c82f769806414153 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 17 Aug 2012 15:27:38 +0200 Subject: [PATCH 17/90] [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 18/90] [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 19/90] [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 20/90] [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 21/90] [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 22/90] [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 23/90] [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 24/90] [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 25/90] [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 26/90] [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 27/90] [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 28/90] [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 29/90] [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 30/90] [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 31/90] [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 32/90] [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 33/90] [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 34/90] [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 004a1a64ee3e0ba79cf8460df13799e27f282365 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Wed, 29 Aug 2012 11:23:33 +0530 Subject: [PATCH 35/90] [ADD] Added 'groups_id' field into 'ir_ui_view' model. bzr revid: mdi@tinyerp.com-20120829055333-6iw12tthxeidkkus --- openerp/addons/base/ir/ir.xml | 11 +++++++++-- openerp/addons/base/ir/ir_ui_view.py | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/ir/ir.xml b/openerp/addons/base/ir/ir.xml index 49bb719bad7..9cfb4c3b8bf 100644 --- a/openerp/addons/base/ir/ir.xml +++ b/openerp/addons/base/ir/ir.xml @@ -599,8 +599,15 @@ - - + + + + + + + + + diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index b2805884f18..7b8165ec694 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -63,6 +63,9 @@ class view(osv.osv): 'name': fields.char('View Name',size=64, required=True), 'model': fields.char('Object', size=64, required=True, select=True), 'priority': fields.integer('Sequence', required=True), + 'groups_id': fields.many2many('res.groups', 'ir_ui_view_group_rel', + 'view_id', 'group_id', 'Groups', help="If you have groups, the visibility of this view will be based on these groups. "\ + "If this field is empty, OpenERP will compute visibility based on the related object's read access."), 'type': fields.function(_type_field, type='selection', selection=[ ('tree','Tree'), ('form','Form'), From 3b2423c5dae204fa262d41dff4f40c35accc6d1e Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 29 Aug 2012 15:37:32 +0200 Subject: [PATCH 36/90] [IMP] ir.ui.view: filter inheriting views based on groups bzr revid: rco@openerp.com-20120829133732-ijyy3y05mlbazgya --- openerp/addons/base/ir/ir_ui_view.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index 3caacfc1494..bad2c3d85af 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -169,20 +169,25 @@ class view(osv.osv): :rtype: list of tuples :return: [(view_arch,view_id), ...] """ + user_groups = frozenset(self.pool.get('res.users').browse(cr, 1, uid, context).groups_id) if self.pool._init: # Module init currently in progress, only consider views from modules whose code was already loaded - query = """SELECT v.arch, v.id FROM ir_ui_view v LEFT JOIN ir_model_data md ON (md.model = 'ir.ui.view' AND md.res_id = v.id) + query = """SELECT v.id FROM ir_ui_view v LEFT JOIN ir_model_data md ON (md.model = 'ir.ui.view' AND md.res_id = v.id) WHERE v.inherit_id=%s AND v.model=%s AND md.module in %s ORDER BY priority""" query_params = (view_id, model, tuple(self.pool._init_modules)) else: # Modules fully loaded, consider all views - query = """SELECT v.arch, v.id FROM ir_ui_view v + query = """SELECT v.id FROM ir_ui_view v WHERE v.inherit_id=%s AND v.model=%s ORDER BY priority""" query_params = (view_id, model) cr.execute(query, query_params) - return cr.fetchall() + view_ids = [v[0] for v in cr.fetchall()] + # filter views based on user groups + return [(view.arch, view.id) + for view in self.browse(cr, 1, view_ids, context) + if not (view.groups_id and user_groups.isdisjoint(view.groups_id))] def write(self, cr, uid, ids, vals, context=None): if not isinstance(ids, (list, tuple)): From 6ee4afd62bab7b7aa956fc18a48c877077d11ebe Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Thu, 30 Aug 2012 15:40:50 +0530 Subject: [PATCH 37/90] [MERGE] sale: merge the changes of lp:~openerp-dev/openobject-addons/trunk-editable_list_sale-rco bzr revid: psi@tinyerp.com-20120830101050-xa4z1xz6knhpatkc --- addons/sale/sale_view.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index c4edc162f08..ea6de33f8ba 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -357,6 +357,20 @@ + + + sale.order.form.editable.list + sale.order + + + + + + + + + sale.order.list.select sale.order From a652cc9ef0e78692b2c37e992acf7463580ab490 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 31 Aug 2012 11:54:00 +0200 Subject: [PATCH 38/90] [IMP] sale, sale_analytic_plans: add missing fields in sale order lines, and make list non-editable for group analytic accounting bzr revid: rco@openerp.com-20120831095400-gaztg6293sz43pd1 --- addons/sale/sale_view.xml | 4 ++-- addons/sale_analytic_plans/sale_analytic_plans_view.xml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 8e964fb5b88..922c3d90d8b 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -262,8 +262,6 @@ - - + @@ -281,6 +280,7 @@ + diff --git a/addons/sale_analytic_plans/sale_analytic_plans_view.xml b/addons/sale_analytic_plans/sale_analytic_plans_view.xml index 6701ede5ae5..6c788866520 100644 --- a/addons/sale_analytic_plans/sale_analytic_plans_view.xml +++ b/addons/sale_analytic_plans/sale_analytic_plans_view.xml @@ -22,6 +22,11 @@ + + + + + sale.order.line.form2.inherit sale.order.line From 5426eb7508768f954ac1d1e78ef20a9c0d8fd736 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 31 Aug 2012 12:05:35 +0200 Subject: [PATCH 39/90] [FIX] sale order: fix order lines in form bzr revid: rco@openerp.com-20120831100535-1awx1kj0ezrzw38d --- addons/sale/sale_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 922c3d90d8b..a2f44034db3 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -280,7 +280,7 @@ - + From a2aa1dfdce68b3ef0ec41ad085b506fd8735c6b1 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 31 Aug 2012 12:12:13 +0200 Subject: [PATCH 40/90] [IMP] purchase: add missing fields in purchase order lines bzr revid: rco@openerp.com-20120831101213-cueqapr741v9ntzo --- addons/purchase/purchase_view.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index dfa4c5a0651..35882574619 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -216,11 +216,14 @@ - + + + + From beb8a590e55bfc978112f7e2497c2d8212ece4cc Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 31 Aug 2012 15:50:10 +0200 Subject: [PATCH 41/90] [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 @@