From 7736b371d04d0ca36d91cd61ce83d815406d1f92 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 14 Dec 2010 17:33:20 +0200 Subject: [PATCH 01/12] users_ldap: replace tools.debug() with logging.debug() bzr revid: p_christ@hol.gr-20101214153320-5cz87zmxpfb6rntv --- addons/users_ldap/users_ldap.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/addons/users_ldap/users_ldap.py b/addons/users_ldap/users_ldap.py index df4528107cc..bf59b1b62e9 100644 --- a/addons/users_ldap/users_ldap.py +++ b/addons/users_ldap/users_ldap.py @@ -21,6 +21,7 @@ from osv import fields, osv import pooler import tools +import logging from service import security import ldap from ldap.filter import filter_format @@ -66,9 +67,9 @@ class users(osv.osv): _inherit = "res.users" def login(self, db, login, password): ret = super(users,self).login(db, login, password) - tools.debug(ret) if ret: return ret + logger = logging.getLogger('orm.ldap') pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() action_obj = pool.get('ir.actions.actions') @@ -78,7 +79,7 @@ class users(osv.osv): FROM res_company_ldap WHERE ldap_server != '' and ldap_binddn != '' ORDER BY sequence""") for res_company_ldap in cr.dictfetchall(): - tools.debug(res_company_ldap) + logger.debug(res_company_ldap) try: l = ldap.open(res_company_ldap['ldap_server'], res_company_ldap['ldap_server_port']) if l.simple_bind_s(res_company_ldap['ldap_binddn'], res_company_ldap['ldap_password']): @@ -93,13 +94,13 @@ class users(osv.osv): continue if result_type == ldap.RES_SEARCH_RESULT and len(result_data) == 1: dn = result_data[0][0] - tools.debug(dn) + logger.debug(dn) name = result_data[0][1]['cn'][0] if l.bind_s(dn, password): l.unbind() cr.execute("SELECT id FROM res_users WHERE login=%s",(tools.ustr(login),)) res = cr.fetchone() - tools.debug(res) + logger.debug(res) if res: cr.close() return res[0] @@ -127,7 +128,7 @@ class users(osv.osv): return res l.unbind() except Exception, e: - tools.debug(e) + logger.warning("Cannot auth", exc_info=True) continue cr.close() return False @@ -135,10 +136,11 @@ class users(osv.osv): def check(self, db, uid, passwd): try: return super(users,self).check(db, uid, passwd) - except: # AccessDenied + except ExceptionNoTb: # AccessDenied pass cr = pooler.get_db(db).cursor() user = self.browse(cr, 1, uid) + logger = logging.getLogger('orm.ldap') if user and user.company_id.ldaps: for res_company_ldap in user.company_id.ldaps: try: @@ -161,7 +163,7 @@ class users(osv.osv): return True l.unbind() except Exception, e: - tools.debug(e) + logger.warning('cannot check', exc_info=True) pass cr.close() raise security.ExceptionNoTb('AccessDenied') From bb8533edc6ed45ecb4996f1f7951b5ccbaccd9c0 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 14 Dec 2010 17:33:48 +0200 Subject: [PATCH 02/12] users_ldap: trivial fix in referenced exception. bzr revid: p_christ@hol.gr-20101214153348-2s3zpv7v710z5h13 --- addons/users_ldap/users_ldap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/users_ldap/users_ldap.py b/addons/users_ldap/users_ldap.py index bf59b1b62e9..2c590242889 100644 --- a/addons/users_ldap/users_ldap.py +++ b/addons/users_ldap/users_ldap.py @@ -136,7 +136,7 @@ class users(osv.osv): def check(self, db, uid, passwd): try: return super(users,self).check(db, uid, passwd) - except ExceptionNoTb: # AccessDenied + except security.ExceptionNoTb: # AccessDenied pass cr = pooler.get_db(db).cursor() user = self.browse(cr, 1, uid) From 56d65e54feb930e7bc90576c0b65e668fe6d1ced Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 14 Dec 2010 17:35:58 +0200 Subject: [PATCH 03/12] account: fix invoice report, second page header must be in partner's lang The PTO header for the second+ pages was rendered before the setting of partner's language, which meant that it would be translated to the user's lang. Move the xml block to fix that. bzr revid: p_christ@hol.gr-20101214153558-b93h81ys6fhad5w1 --- .../account/report/account_print_invoice.rml | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/addons/account/report/account_print_invoice.rml b/addons/account/report/account_print_invoice.rml index 6e67879d81c..80ccd2aabae 100644 --- a/addons/account/report/account_print_invoice.rml +++ b/addons/account/report/account_print_invoice.rml @@ -131,32 +131,20 @@ - - - - - Description - - - Taxes - - - Quantity - - - Unit Price - - - Disc.(%) - - - Price - - - - [[ repeatIn(objects,'o') ]] [[ setLang(o.partner_id.lang) ]] + + + + Description + Taxes + Quantity + Unit Price + Disc.(%) + Price + + + From 7583a7da0435dfddcf8cf2c81b9046ecd3688783 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 14 Dec 2010 17:36:08 +0200 Subject: [PATCH 04/12] account report: fix read_group() API mismatch read_group() of account entries and followup reports didn't match that of server. We'd better use generic references to positional and keyword arguments instead. bzr revid: p_christ@hol.gr-20101214153608-mbcjfzu26wolyip9 --- addons/account/report/account_entries_report.py | 4 ++-- addons/account_followup/report/account_followup_report.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py index 80065880ad9..e80cb290889 100644 --- a/addons/account/report/account_entries_report.py +++ b/addons/account/report/account_entries_report.py @@ -94,7 +94,7 @@ class account_entries_report(osv.osv): return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order, context=context, count=count) - def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): + def read_group(self, cr, uid, domain, *args, **kwargs): todel=[] fiscalyear_obj = self.pool.get('account.fiscalyear') period_obj = self.pool.get('account.period') @@ -112,7 +112,7 @@ class account_entries_report(osv.osv): for a in [['period_id','in','current_year'], ['period_id','in','current_period']]: if a in domain: domain.remove(a) - return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context) + return super(account_entries_report, self).read_group(cr, uid, domain, *args, **kwargs) def init(self, cr): tools.drop_view_if_exists(cr, 'account_entries_report') diff --git a/addons/account_followup/report/account_followup_report.py b/addons/account_followup/report/account_followup_report.py index ba0756f5c49..878f44ced30 100644 --- a/addons/account_followup/report/account_followup_report.py +++ b/addons/account_followup/report/account_followup_report.py @@ -55,14 +55,14 @@ class account_followup_stat(osv.osv): return super(account_followup_stat, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order, context=context, count=count) - def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): + def read_group(self, cr, uid, domain, *args, **kwargs): for arg in domain: if arg[0] == 'period_id' and arg[2] == 'current_year': current_year = self.pool.get('account.fiscalyear').find(cr, uid) ids = self.pool.get('account.fiscalyear').read(cr, uid, [current_year], ['period_ids'])[0]['period_ids'] domain.append(['period_id','in',ids]) domain.remove(arg) - return super(account_followup_stat, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context) + return super(account_followup_stat, self).read_group(cr, uid, domain, *args, **kwargs) def init(self, cr): tools.drop_view_if_exists(cr, 'account_followup_stat') From d33f6f290323a0eaf259817e840a8a8b45e0bb27 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 16 Dec 2010 11:07:49 +0100 Subject: [PATCH 05/12] [FIX] report_sxw: workaround to prevent crash of reports launched from wizards that pass invalid IDs bzr revid: odo@openerp.com-20101216100749-z06fv08n4u5rhwl0 --- bin/report/report_sxw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index eb6fad169d6..fe04ca6b680 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -366,8 +366,10 @@ class rml_parse(object): else: self.localcontext.update({'name_space' :common.sxw_namespace}) + # WARNING: the object[0].exists() call below is slow but necessary because + # some broken reporting wizards pass incorrect IDs (e.g. ir.ui.menu ids) if objects and len(objects) == 1 and \ - 'company_id' in objects[0] and objects[0].company_id: + objects[0].exists() and 'company_id' in objects[0] and objects[0].company_id: # When we print only one record, we can auto-set the correct # company in the localcontext. For other cases the report # will have to call setCompany() inside the main repeatIn loop. From 8a57904105147441fdc459f6b838ed58e50a637e Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 16 Dec 2010 12:27:52 +0100 Subject: [PATCH 06/12] [IMP] web_livechat: better icons & text bzr revid: chs@openerp.com-20101216112752-9xg4i9ompw1bi81v --- addons/web_livechat/publisher_warranty.py | 2 +- addons/web_livechat/web/editors.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web_livechat/publisher_warranty.py b/addons/web_livechat/publisher_warranty.py index 737ad6d29d9..b4825febcf6 100644 --- a/addons/web_livechat/publisher_warranty.py +++ b/addons/web_livechat/publisher_warranty.py @@ -32,7 +32,7 @@ class publisher_warranty_contract(osv.osv): @cache(skiparg=3) def get_default_livechat_text(self, cr, uid): - return 'OpenERP Publisher\'s Warranty' + return 'Online Support' publisher_warranty_contract() diff --git a/addons/web_livechat/web/editors.py b/addons/web_livechat/web/editors.py index e5d94cb57ba..9b653312415 100644 --- a/addons/web_livechat/web/editors.py +++ b/addons/web_livechat/web/editors.py @@ -82,8 +82,8 @@ class HeaderTemplateEditor(openobject.templating.TemplateEditor): skill: '0', type: 'text', labels: { - online: 'Need Help?', - offline: 'Leave us a message' + online: 'Online Support', + offline: 'Online Support' } }); From a86a432edf0382fa33b8333024b0924c69fa0546 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 16 Dec 2010 16:04:30 +0100 Subject: [PATCH 07/12] [FIX] res_config: made strings in compatibility install wizard translatable bzr revid: odo@openerp.com-20101216150430-8tg06fpfubdac4py --- bin/addons/base/i18n/base.pot | 18 ++++++++++++++++-- bin/addons/base/res/res_config.py | 6 +++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/bin/addons/base/i18n/base.pot b/bin/addons/base/i18n/base.pot index 43790e6f8a4..c3383537db3 100644 --- a/bin/addons/base/i18n/base.pot +++ b/bin/addons/base/i18n/base.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.0.0-rc1\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2010-12-15 15:05:00+0000\n" -"PO-Revision-Date: 2010-12-15 15:05:00+0000\n" +"POT-Creation-Date: 2010-12-16 15:02:56+0000\n" +"PO-Revision-Date: 2010-12-16 15:02:56+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -2629,6 +2629,14 @@ msgstr "" msgid "%c - Appropriate date and time representation." msgstr "" +#. module: base +#: code:addons/base/res/res_config.py:0 +#, python-format +msgid "Your database is now fully configured.\n" +"\n" +"Click 'Continue' and enjoy your OpenERP experience..." +msgstr "" + #. module: base #: selection:base.language.install,lang:0 msgid "Hebrew / עִבְרִי" @@ -5207,6 +5215,12 @@ msgstr "" msgid "View type: set to 'tree' for a hierarchical tree view, or 'form' for other views" msgstr "" +#. module: base +#: code:addons/base/res/res_config.py:0 +#, python-format +msgid "Click 'Continue' to configure the next addon..." +msgstr "" + #. module: base #: field:ir.actions.server,record_id:0 msgid "Create Id" diff --git a/bin/addons/base/res/res_config.py b/bin/addons/base/res/res_config.py index 83b4c2b68d3..a3d7e97026d 100644 --- a/bin/addons/base/res/res_config.py +++ b/bin/addons/base/res/res_config.py @@ -418,9 +418,9 @@ class ir_actions_configuration_wizard(osv.osv_memory): # if the next one is also an old-style extension, you never know... if next.note: return next.note - return "Click 'Continue' to configure the next addon..." - return "Your database is now fully configured.\n\n"\ - "Click 'Continue' and enjoy your OpenERP experience..." + return _("Click 'Continue' to configure the next addon...") + return _("Your database is now fully configured.\n\n"\ + "Click 'Continue' and enjoy your OpenERP experience...") _columns = { 'note': fields.text('Next Wizard', readonly=True), From 10868c2eb50437d6e1ad0917791792e4e5cccc00 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Thu, 16 Dec 2010 17:30:25 +0100 Subject: [PATCH 08/12] [IMP] sale_margin: replaced tabs with 4 spaces in view and removed the button 'create invoice' in order to reuse the one defined in the first tab bzr revid: qdp-launchpad@tinyerp.com-20101216163025-x1rbfsd4bcrxgdu9 --- addons/sale_margin/sale_margin.py | 10 +- addons/sale_margin/sale_margin_view.xml | 152 ++++++++++++------------ 2 files changed, 79 insertions(+), 83 deletions(-) diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index fdf7eaf69e4..cd327834185 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -76,16 +76,16 @@ class stock_picking(osv.osv): 'invoice_ids': fields.many2many('account.invoice', 'picking_invoice_rel', 'picking_id', 'invoice_id', 'Invoices', domain=[('type', '=', 'out_invoice')]), } - def create_invoice(self, cr, uid, ids, *args): + def action_invoice_create(self, cr, uid, ids, journal_id=False, + group=False, type='out_invoice', context=None): # need to carify with new requirement invoice_ids = [] - margin_deduce = 0.0 picking_obj = self.pool.get('stock.picking') - picking_obj.write(cr, uid, ids, {'invoice_state': '2binvoiced'}) - res = picking_obj.action_invoice_create(cr, uid, ids, type='out_invoice', context={}) + res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=False, + group=False, type='out_invoice', context=None) invoice_ids = res.values() picking_obj.write(cr, uid, ids, {'invoice_ids': [[6, 0, invoice_ids]]}) - return True + return res stock_picking() diff --git a/addons/sale_margin/sale_margin_view.xml b/addons/sale_margin/sale_margin_view.xml index 47cbe4c2878..201dd12d7a0 100644 --- a/addons/sale_margin/sale_margin_view.xml +++ b/addons/sale_margin/sale_margin_view.xml @@ -2,84 +2,80 @@ - - sale.order.margin.view.form - form - sale.order - - - - - - - - - - sale.order.line.margin.view.form - form - sale.order - - - - - - - - - - sale.order.line.tree.margin.view.form - form - sale.order - - - - - - - - - - sale.order.margin.view.tree - tree - sale.order - - - - - - - - - - sale.order.margin.line.view.tree - tree - sale.order.line - - - - - - - - + + sale.order.margin.view.form + form + sale.order + + + + + + + + + + sale.order.line.margin.view.form + form + sale.order + + + + + + + + + + sale.order.line.tree.margin.view.form + form + sale.order + + + + + + + + + + sale.order.margin.view.tree + tree + sale.order + + + + + + + + + + sale.order.margin.line.view.tree + tree + sale.order.line + + + + + + + + + + + picking.margin.view.form + form + stock.picking + + + + + + + + + - - picking.margin.view.form - form - stock.picking - - - - - - -