From 6036184f115188ca3bcd093743f78d1376f74113 Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Tue, 29 Nov 2011 14:58:17 +0530 Subject: [PATCH 01/72] [FIX]: missleading help text lp bug: https://launchpad.net/bugs/897556 fixed bzr revid: ksa@tinyerp.com-20111129092817-m8xcsixxofqh2nhf --- addons/portal/portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/portal.py b/addons/portal/portal.py index de39944e69f..3966e193c10 100644 --- a/addons/portal/portal.py +++ b/addons/portal/portal.py @@ -36,7 +36,7 @@ class portal(osv.osv): _columns = { 'group_id': fields.many2one('res.groups', required=True, ondelete='cascade', string='Group', - help='The group extended by this portal'), + help='The group connected to this portal'), 'url': fields.char('URL', size=64, help="The url where portal users can connect to the server"), 'menu_action_id': fields.many2one('ir.actions.act_window', readonly=True, From 9def2e0169ebd23e9b053ff6b0ae16031cb03f88 Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Tue, 20 Dec 2011 11:42:28 +0530 Subject: [PATCH 02/72] [IMP]: change in po file bzr revid: ksa@tinyerp.com-20111220061228-dtgf8vob8g0z2htu --- addons/portal/i18n/ar.po | 2 +- addons/portal/i18n/bg.po | 2 +- addons/portal/i18n/bs.po | 2 +- addons/portal/i18n/ca.po | 2 +- addons/portal/i18n/de.po | 2 +- addons/portal/i18n/en_US.po | 2 +- addons/portal/i18n/es.po | 2 +- addons/portal/i18n/es_MX.po | 2 +- addons/portal/i18n/es_VE.po | 2 +- addons/portal/i18n/et.po | 2 +- addons/portal/i18n/fi.po | 2 +- addons/portal/i18n/fr.po | 2 +- addons/portal/i18n/hr.po | 2 +- addons/portal/i18n/hu.po | 2 +- addons/portal/i18n/id.po | 2 +- addons/portal/i18n/it.po | 2 +- addons/portal/i18n/lt.po | 2 +- addons/portal/i18n/nl.po | 2 +- addons/portal/i18n/pl.po | 2 +- addons/portal/i18n/pt.po | 2 +- addons/portal/i18n/pt_BR.po | 2 +- addons/portal/i18n/ro.po | 2 +- addons/portal/i18n/ru.po | 2 +- addons/portal/i18n/sl.po | 2 +- addons/portal/i18n/sv.po | 2 +- addons/portal/i18n/tr.po | 2 +- addons/portal/i18n/uk.po | 2 +- addons/portal/i18n/zh_CN.po | 2 +- addons/portal/i18n/zh_TW.po | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/addons/portal/i18n/ar.po b/addons/portal/i18n/ar.po index 56e8e4a0880..048183767f1 100644 --- a/addons/portal/i18n/ar.po +++ b/addons/portal/i18n/ar.po @@ -294,7 +294,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/bg.po b/addons/portal/i18n/bg.po index 5a41a942eab..6104b7d5898 100644 --- a/addons/portal/i18n/bg.po +++ b/addons/portal/i18n/bg.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/bs.po b/addons/portal/i18n/bs.po index 13ab4e3efa4..0488d6dab9b 100644 --- a/addons/portal/i18n/bs.po +++ b/addons/portal/i18n/bs.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/ca.po b/addons/portal/i18n/ca.po index 71faf20e85f..406e3381a52 100644 --- a/addons/portal/i18n/ca.po +++ b/addons/portal/i18n/ca.po @@ -318,7 +318,7 @@ msgstr "ir.ui.menú" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "El grup ampliat per aquest portal" #. module: portal diff --git a/addons/portal/i18n/de.po b/addons/portal/i18n/de.po index 8fbe9e1e388..ca282a28b38 100644 --- a/addons/portal/i18n/de.po +++ b/addons/portal/i18n/de.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/en_US.po b/addons/portal/i18n/en_US.po index ffc18da1f14..79eae8cc9d0 100644 --- a/addons/portal/i18n/en_US.po +++ b/addons/portal/i18n/en_US.po @@ -281,7 +281,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/es.po b/addons/portal/i18n/es.po index d73378f4150..029408ef2b4 100644 --- a/addons/portal/i18n/es.po +++ b/addons/portal/i18n/es.po @@ -294,7 +294,7 @@ msgstr "ir.ui.menu" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/es_MX.po b/addons/portal/i18n/es_MX.po index f4fca48ead1..22dc0db022f 100644 --- a/addons/portal/i18n/es_MX.po +++ b/addons/portal/i18n/es_MX.po @@ -294,7 +294,7 @@ msgstr "ir.ui.menu" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/es_VE.po b/addons/portal/i18n/es_VE.po index f4fca48ead1..22dc0db022f 100644 --- a/addons/portal/i18n/es_VE.po +++ b/addons/portal/i18n/es_VE.po @@ -294,7 +294,7 @@ msgstr "ir.ui.menu" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/et.po b/addons/portal/i18n/et.po index 41824c3ed1c..7e6fac6789e 100644 --- a/addons/portal/i18n/et.po +++ b/addons/portal/i18n/et.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/fi.po b/addons/portal/i18n/fi.po index 31c44509b96..7a0f682b07b 100644 --- a/addons/portal/i18n/fi.po +++ b/addons/portal/i18n/fi.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/fr.po b/addons/portal/i18n/fr.po index 4ba51b3d9be..e5a980b0f16 100644 --- a/addons/portal/i18n/fr.po +++ b/addons/portal/i18n/fr.po @@ -292,7 +292,7 @@ msgstr "ir.ui.menu" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/hr.po b/addons/portal/i18n/hr.po index 737a6990153..fa9dad14f04 100644 --- a/addons/portal/i18n/hr.po +++ b/addons/portal/i18n/hr.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/hu.po b/addons/portal/i18n/hu.po index 94a05d71a30..e3f579f358a 100644 --- a/addons/portal/i18n/hu.po +++ b/addons/portal/i18n/hu.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/id.po b/addons/portal/i18n/id.po index 3eb9b26b75b..0c3db0c1af0 100644 --- a/addons/portal/i18n/id.po +++ b/addons/portal/i18n/id.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/it.po b/addons/portal/i18n/it.po index c74fe28664a..aabc5f8d135 100644 --- a/addons/portal/i18n/it.po +++ b/addons/portal/i18n/it.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/lt.po b/addons/portal/i18n/lt.po index 5c8cb2d31df..42a5a138957 100644 --- a/addons/portal/i18n/lt.po +++ b/addons/portal/i18n/lt.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/nl.po b/addons/portal/i18n/nl.po index 6c6fde8b34e..a872165e552 100644 --- a/addons/portal/i18n/nl.po +++ b/addons/portal/i18n/nl.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/pl.po b/addons/portal/i18n/pl.po index b740c2c9c15..519f21ecb54 100644 --- a/addons/portal/i18n/pl.po +++ b/addons/portal/i18n/pl.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/pt.po b/addons/portal/i18n/pt.po index 499f6c07a0a..75f675b71df 100644 --- a/addons/portal/i18n/pt.po +++ b/addons/portal/i18n/pt.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/pt_BR.po b/addons/portal/i18n/pt_BR.po index 7de00b8d68a..be6f48379a1 100644 --- a/addons/portal/i18n/pt_BR.po +++ b/addons/portal/i18n/pt_BR.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/ro.po b/addons/portal/i18n/ro.po index ee31cd287ab..32a4ffa4d2b 100644 --- a/addons/portal/i18n/ro.po +++ b/addons/portal/i18n/ro.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/ru.po b/addons/portal/i18n/ru.po index 58ea572e3da..0c1d8a7c101 100644 --- a/addons/portal/i18n/ru.po +++ b/addons/portal/i18n/ru.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/sl.po b/addons/portal/i18n/sl.po index e996f6b2470..97e65852420 100644 --- a/addons/portal/i18n/sl.po +++ b/addons/portal/i18n/sl.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/sv.po b/addons/portal/i18n/sv.po index 13c18c6b339..3226875c189 100644 --- a/addons/portal/i18n/sv.po +++ b/addons/portal/i18n/sv.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/tr.po b/addons/portal/i18n/tr.po index b64d3a452b1..3e57de7d87b 100644 --- a/addons/portal/i18n/tr.po +++ b/addons/portal/i18n/tr.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/uk.po b/addons/portal/i18n/uk.po index 8f83ec52772..39951976c0f 100644 --- a/addons/portal/i18n/uk.po +++ b/addons/portal/i18n/uk.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/zh_CN.po b/addons/portal/i18n/zh_CN.po index f420ee74856..094ed3c7167 100644 --- a/addons/portal/i18n/zh_CN.po +++ b/addons/portal/i18n/zh_CN.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal diff --git a/addons/portal/i18n/zh_TW.po b/addons/portal/i18n/zh_TW.po index 2ea5e8f808a..c149e0ad675 100644 --- a/addons/portal/i18n/zh_TW.po +++ b/addons/portal/i18n/zh_TW.po @@ -292,7 +292,7 @@ msgstr "" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "" #. module: portal From fd63c3c6d7e6b72481bfb50570861ffd46759dff Mon Sep 17 00:00:00 2001 From: "Kirti Savalia (OpenERP)" Date: Thu, 22 Dec 2011 17:03:41 +0530 Subject: [PATCH 03/72] [IMP]:chnage in po file bzr revid: ksa@tinyerp.com-20111222113341-lr2pfvhpbbqv3qjb --- addons/portal/i18n/cs.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/i18n/cs.po b/addons/portal/i18n/cs.po index 3be439be9b6..794150cdf86 100644 --- a/addons/portal/i18n/cs.po +++ b/addons/portal/i18n/cs.po @@ -313,7 +313,7 @@ msgstr "ir.ui.menu" #. module: portal #: help:res.portal,group_id:0 -msgid "The group extended by this portal" +msgid "The group connected to this portal" msgstr "Skupina rozšířená tímto portálem" #. module: portal From 664de510ad8e29951bd7a19e8e5b4cdd25f6214a Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 13 Jan 2012 12:17:36 +0100 Subject: [PATCH 04/72] [IMP] edi: remove debug in edi url bzr revid: chs@openerp.com-20120113111736-w542872mwozrhbpp --- addons/edi/models/edi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/edi/models/edi.py b/addons/edi/models/edi.py index c573115618e..589922ff178 100644 --- a/addons/edi/models/edi.py +++ b/addons/edi/models/edi.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Business Applications -# Copyright (c) 2011 OpenERP S.A. +# Copyright (c) 2011-2012 OpenERP S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ from tools.translate import _ from tools.safe_eval import safe_eval as eval EXTERNAL_ID_PATTERN = re.compile(r'^([^.:]+)(?::([^.]+))?\.(\S+)$') -EDI_VIEW_WEB_URL = '%s/edi/view?debug=1&db=%s&token=%s' +EDI_VIEW_WEB_URL = '%s/edi/view?db=%s&token=%s' EDI_PROTOCOL_VERSION = 1 # arbitrary ever-increasing version number EDI_GENERATOR = 'OpenERP ' + release.major_version EDI_GENERATOR_VERSION = release.version_info @@ -682,4 +682,4 @@ class EDIMixin(object): return record_id -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From fb2e5f04c00d492b6edfab0c73b230ab6c0ef591 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 13 Jan 2012 12:20:34 +0100 Subject: [PATCH 05/72] [FIX] edi: correct design bzr revid: chs@openerp.com-20120113112034-zr1v1qsvwn6ya0x7 --- addons/edi/static/src/js/edi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js index 73bcfa267e5..352177156e1 100644 --- a/addons/edi/static/src/js/edi.js +++ b/addons/edi/static/src/js/edi.js @@ -109,7 +109,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({ openerp.edi.edi_view = function (db, token) { openerp.connection.bind().then(function () { - new openerp.edi.EdiView(null,db,token).appendTo($("body")); + new openerp.edi.EdiView(null,db,token).appendTo($("body").addClass('openerp')); }); } @@ -172,7 +172,7 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({ openerp.edi.edi_import = function (url) { openerp.connection.bind().then(function () { - new openerp.edi.EdiImport(null,url).appendTo($("body")); + new openerp.edi.EdiImport(null,url).appendTo($("body").addClass('openerp')); }); } From db1ffb561b704d76a6ee80faf94fbce906df82e5 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 13 Jan 2012 12:21:21 +0100 Subject: [PATCH 06/72] [FIX] edi: ask login before import bzr revid: chs@openerp.com-20120113112121-5tlnb2he9sw8cbe0 --- addons/edi/static/src/js/edi.js | 47 +++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js index 352177156e1..d62a4c3b780 100644 --- a/addons/edi/static/src/js/edi.js +++ b/addons/edi/static/src/js/edi.js @@ -114,30 +114,49 @@ openerp.edi.edi_view = function (db, token) { } openerp.edi.EdiImport = openerp.web.Widget.extend({ - init: function(parent,url) { - this._super(); - this.url = url; - var params = {}; + template: "EdiImport", - this.template = "EdiImport"; - this.session = openerp.connection; - this.login = new openerp.web.Login(this); - this.header = new openerp.web.Header(this); + init: function(parent, url) { + this._super(parent); + this.url = url; }, start: function() { - // TODO fix by explicitly asking login if needed - //this.session.on_session_invalid.add_last(this.do_ask_login); - this.header.appendTo($("#oe_header")); - this.login.appendTo($('#oe_login')); + if (!this.session.session_is_valid()) { + this.show_login(); + this.session.on_session_valid.add({ + callback: this.proxy('show_import'), + unique: true, + }); + } else { + this.show_import(); + } + }, + + show_import: function() { + this.destroy_content(); this.do_import(); }, + + show_login: function() { + this.destroy_content(); + this.login = new openerp.web.Login(this); + this.login.appendTo(this.$element); + }, + + destroy_content: function() { + _.each(_.clone(this.widget_children), function(el) { + el.stop(); + }); + this.$element.children().remove(); + }, + do_import: function() { this.rpc('/edi/import_edi_url', {url: this.url}, this.on_imported, this.on_imported_error); }, on_imported: function(response) { if ('action' in response) { this.rpc("/web/session/save_session_action", {the_action: response.action}, function(key) { - window.location = "/web/webclient/home?debug=1&s_action="+encodeURIComponent(key); + window.location = "/web/webclient/home#sa="+encodeURIComponent(key); }); } else { @@ -147,7 +166,7 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({ buttons: { Ok: function() { $(this).dialog("close"); - window.location = "/web/webclient/home"; + window.location = "/"; } } }).html('The document has been successfully imported!'); From b84f9fe2d7937b023a79bea30b05fc93671c21be Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 13 Jan 2012 12:36:08 +0100 Subject: [PATCH 07/72] [IMP] handle session actions bzr revid: chs@openerp.com-20120113113608-am1cbzs6z0urfh4k --- addons/web/static/src/js/views.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index f8bdd58bc3e..87e3861fc87 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -80,6 +80,16 @@ session.web.ActionManager = session.web.Widget.extend({ }; action_loaded = this.do_action(action); } + else if (state.sa) { + // load session action + var self = this; + this.null_action(); + action_loaded = this.rpc('/web/session/get_session_action', {key: state.sa}).pipe(function(action) { + if (action) { + return self.do_action(action); + } + }); + } else if (state.client_action) { this.null_action(); this.ir_actions_client(state.client_action); From c01dba098a207dea9ba73863dbe2bf4243702d01 Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Fri, 20 Jan 2012 15:17:53 +0530 Subject: [PATCH 08/72] [IMP] improved the format of Annual Listing of Vat Subjected Customers wizard of l10n_be module bzr revid: bde@tinyerp.com-20120120094753-2uhoavhyq9tzfgtb --- .../wizard/l10n_be_partner_vat_listing.py | 65 ++++++++++++++----- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index e43dbfecf2b..d6d56ac653c 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -28,6 +28,32 @@ import base64 from tools.translate import _ from osv import fields, osv +class vat_listing_clients(osv.osv_memory): + + _name = 'vat.listing.clients' + _columns = { + 'name': fields.char('Client Name', size=64), + 'vat': fields.char('VAT', size=64), + 'country': fields.char('Country', size=64), + 'amount': fields.float('Amount'), + 'turnover': fields.float('Turnover'), + } + + def name_get(self, cr, uid, ids, context=None): + if not len(ids): + return [] + return [(r['id'], r['name'] or '' + ' - ' + r['vat'] or '') \ + for r in self.read(cr, uid, ids, ['name', 'vat'], + context, load='_classic_write')] + + def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100): + client = self.search(cr, uid, [('vat', '=', name)]+args, limit=limit, context=context) + if not client: + client = self.search(cr, uid, [('name', 'ilike', '%%%s%%' % name)]+args, limit=limit, context=context) + return self.name_get(cr, uid, client, context=context) + +vat_listing_clients() + class partner_vat_13(osv.osv_memory): """ Vat Listing """ _name = "partner.vat_13" @@ -118,7 +144,7 @@ class partner_vat_list_13(osv.osv_memory): _name = "partner.vat.list_13" _columns = { # TODO the referenced model has been deleted at revno 4672.1.2. - #'partner_ids': fields.many2many('vat.listing.clients', 'vat_partner_rel', 'vat_id', 'partner_id', 'Clients', required=False, help='You can remove clients/partners which you do not want to show in xml file'), + 'partner_ids': fields.many2many('vat.listing.clients', 'vat_partner_rel', 'vat_id', 'partner_id', 'Clients', required=False, help='You can remove clients/partners which you do not want to show in xml file'), 'name': fields.char('File Name', size=32), 'msg': fields.text('File created', size=64, readonly=True), 'file_save' : fields.binary('Save File', readonly=True), @@ -154,16 +180,20 @@ class partner_vat_list_13(osv.osv_memory): cref = SenderId + seq_controlref dnum = cref + seq_declarantnum #obj_year= obj_fyear.browse(cursor, user, context['fyear'], context=context) - street = zip_city = country = '' + street = city = country = '' addr = obj_partner.address_get(cursor, user, [obj_cmpny.partner_id.id], ['invoice']) if addr.get('invoice',False): ads = obj_addr.browse(cursor, user, [addr['invoice']], context=context)[0] + phone = ads.phone or '' + email = ads.email or '' + name = ads.name or '' - zip_city = obj_addr.get_city(cursor, user, ads.id) - if not zip_city: - zip_city = '' + city = obj_addr.get_city(cursor, user, ads.id) + zip = obj_addr.browse(cursor, user, ads.id, context=context).zip + if not city: + city = '' if ads.street: - street = ads.street + street = ads.street + ' ' if ads.street2: street += ads.street2 if ads.country_id: @@ -171,13 +201,11 @@ class partner_vat_list_13(osv.osv_memory): sender_date = time.strftime('%Y-%m-%d') comp_name = obj_cmpny.name - data_file = '\n\n\t\t'+ comp_name +'\n\t\t'+ street +'\n\t\t'+ zip_city +'' - data_file += '\n\t\t'+ country +'\n\t\n' - data_comp = '\n\n\t'+SenderId+'\n\t'+ comp_name +'\n\t'+ street +'\n\t'+ zip_city +'\n\t'+ country +'\n' - data_period = '\n' + context['year'] +'' + data_file += '\n'+comp_name+'\n' + data_comp = '\n\n\t'+SenderId+'\n\t'+ name +'\n\t'+ street +'\n\t'+ zip +'\n\t'+ city +'\n\t'+ country +'\n\t'+ email +'\n\t'+ phone +'\n' + data_period = '\n' + context['year'] +' \n\n' error_message = [] data = self.read(cursor, user, ids)[0] for partner in data['partner_ids']: @@ -193,6 +221,11 @@ class partner_vat_list_13(osv.osv_memory): if len(error_message): return 'Exception : \n' +'-'*50+'\n'+ '\n'.join(error_message) for line in datas: + vat_issued = line['vat'][:2] + if vat_issued == 'BE': + vat_issued = '' + else: + vat_issued = vat_issued if not line: continue if line['turnover'] < context['limit_amount']: @@ -200,10 +233,10 @@ class partner_vat_list_13(osv.osv_memory): seq += 1 sum_tax += line['amount'] sum_turnover += line['turnover'] - data_clientinfo += '\n\n\t\n\t\t'+line['vat'].replace(' ','').upper()[2:] +'\n\t\t' + line['country'] +'\n\t\n\t'+str(int(round(line['amount'] * 100))) +'\n\t'+str(int(round(line['turnover'] * 100))) +'\n' - - data_decl ='\n' - data_file += data_decl + data_comp + str(data_period) + data_clientinfo + '\n\n' + data_clientinfo += '\n\n\t'+line['vat'].replace(' ','').upper()[2:] +'\n\t'+str(int(round(line['turnover'] * 100))) +'\n\t'+str(int(round(line['amount'] * 100))) +'\n' + data_decl ='\n' + data_decl +='\n\t' + data_file += data_decl + data_comp + str(data_period) + data_clientinfo + '\n\t\n\t\n\n' msg = 'Save the File with '".xml"' extension.' file_save = base64.encodestring(data_file.encode('utf8')) self.write(cursor, user, ids, {'file_save':file_save, 'msg':msg, 'name':'vat_list.xml'}, context=context) From ad26754a66ffc9b61ee78010ea8f353abaafe527 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Tue, 24 Jan 2012 18:09:37 +0530 Subject: [PATCH 09/72] [FIX] l10n_fr : New VAT rate in France lp bug: https://launchpad.net/bugs/917213 fixed bzr revid: mdi@tinyerp.com-20120124123937-sak7sexgig5bz40u --- addons/l10n_fr/fr_pcg_taxes_demo.xml | 135 +++++++++++++++++++++++++++ addons/l10n_fr/fr_tax_demo.xml | 132 +++++++++++++++++++++----- 2 files changed, 246 insertions(+), 21 deletions(-) diff --git a/addons/l10n_fr/fr_pcg_taxes_demo.xml b/addons/l10n_fr/fr_pcg_taxes_demo.xml index 54a8d2d7444..8b0a95456af 100644 --- a/addons/l10n_fr/fr_pcg_taxes_demo.xml +++ b/addons/l10n_fr/fr_pcg_taxes_demo.xml @@ -33,6 +33,12 @@ 1.00 + + Base H.T. 7.0% + TVA collectée à 7.0% (Base H.T.) + + 1.00 + Base H.T. 5.5% TVA collectée à 5.5% (Base H.T.) @@ -64,6 +70,12 @@ 1.00 + + TVA 7.0% + TVA collectée à 7.0% + + 1.00 + TVA 5.5% TVA collectée à 5.5% @@ -97,6 +109,12 @@ 1.00 + + Base H.T. 7.0% + TVA acquittée à 7.0% (Base H.T.) + + 1.00 + Base H.T. 5.5% TVA acquittée à 5.5% (Base H.T.) @@ -128,6 +146,12 @@ 1.00 + + TVA 7.0% + TVA acquittée à 7.0% + + 1.00 + TVA 5.5% TVA acquittée à 5.5% @@ -161,6 +185,12 @@ 1.00 + + Base H.T. 7.0% + TVA acquittée sur immobilisations à 7.0% (Base H.T.) + + 1.00 + Base H.T. 5.5% TVA acquittée sur immobilisations à 5.5% (Base H.T.) @@ -193,6 +223,12 @@ 1.00 + + TVA 7.0% + TVA acquittée sur immobilisations à 7.0% + + 1.00 + TVA 5.5% TVA acquittée sur immobilisations à 5.5% @@ -224,6 +260,12 @@ 1.00 + + Base H.T. 7.0% + TVA due intracommunautaire 7.0% (Base H.T.) + + 1.00 + Base H.T. 5.5% TVA due intracommunautaire 5.5% (Base H.T.) @@ -255,6 +297,12 @@ 1.00 + + TVA 7.0% + TVA due intracommunautaire 7.0% + + 1.00 + TVA 5.5% TVA due intracommunautaire 5.5% @@ -287,6 +335,12 @@ 1.00 + + Base H.T. 7.0% + TVA déductible intracommunautaire 7.0% (Base H.T.) + + 1.00 + Base H.T. 5.5% TVA déductible intracommunautaire 5.5% (Base H.T.) @@ -318,6 +372,12 @@ 1.00 + + TVA 7.0% + TVA déductible intracommunautaire 7.0% + + 1.00 + TVA 5.5% TVA déductible intracommunautaire 5.5% @@ -402,6 +462,21 @@ + + + + + TVA collectée (vente) 7,0% + + percent + + + + + + + + @@ -463,6 +538,21 @@ + + + + TVA acquittée (achat) 7,0% + + percent + + + + + + + + + @@ -523,6 +613,21 @@ + + + + TVA immobilisation (achat) 7,0% + + percent + + + + + + + + + @@ -583,6 +688,21 @@ + + + + TVA due intracommunautaire 7,0% + + percent + + + + + + + + + @@ -643,6 +763,21 @@ + + + + TVA déductible intracommunautaire 7,0% + + percent + + + + + + + + + diff --git a/addons/l10n_fr/fr_tax_demo.xml b/addons/l10n_fr/fr_tax_demo.xml index 37ff4157c99..1afd1afd956 100644 --- a/addons/l10n_fr/fr_tax_demo.xml +++ b/addons/l10n_fr/fr_tax_demo.xml @@ -45,9 +45,27 @@ sale + + TVA collectée (vente) 7,0% + 3 + + percent + + + + + + + + + + + sale + + TVA collectée (vente) 5,5% - 3 + 4 percent @@ -65,7 +83,7 @@ TVA collectée (vente) 2,1% - 4 + 5 percent @@ -85,7 +103,7 @@ TVA acquittée (achat) 19,6% - 5 + 6 percent @@ -103,7 +121,7 @@ TVA acquittée (achat) 8,5% - 6 + 7 percent @@ -119,9 +137,27 @@ purchase + + TVA acquittée (achat) 7,0% + 8 + + percent + + + + + + + + + + + purchase + + TVA acquittée (achat) 5,5% - 7 + 9 percent @@ -139,7 +175,7 @@ TVA acquittée (achat) 2,1% - 8 + 10 percent @@ -159,7 +195,7 @@ TVA immobilisation (achat) 19,6% - 9 + 11 percent @@ -177,7 +213,7 @@ TVA immobilisation (achat) 8,5% - 10 + 12 percent @@ -193,9 +229,27 @@ purchase + + TVA immobilisation (achat) 7,0% + 13 + + percent + + + + + + + + + + + purchase + + TVA immobilisation (achat) 5,5% - 11 + 14 percent @@ -213,7 +267,7 @@ TVA immobilisation (achat) 2,1% - 12 + 15 percent @@ -233,7 +287,7 @@ TVA due intracommunautaire 19,6% - 13 + 16 percent @@ -251,7 +305,7 @@ TVA due intracommunautaire 8,5% - 14 + 17 percent @@ -267,9 +321,27 @@ sale + + TVA due intracommunautaire 7,0% + 18 + + percent + + + + + + + + + + + sale + + TVA due intracommunautaire 5,5% - 15 + 19 percent @@ -287,7 +359,7 @@ TVA due intracommunautaire 2,1% - 16 + 20 percent @@ -307,7 +379,7 @@ TVA déductible intracommunautaire 19,6% - 17 + 21 percent @@ -325,7 +397,7 @@ TVA déductible intracommunautaire 8,5% - 18 + 22 percent @@ -341,9 +413,27 @@ purchase + + TVA déductible intracommunautaire 7,0% + 23 + + percent + + + + + + + + + + + purchase + + TVA déductible intracommunautaire 5,5% - 19 + 24 percent @@ -361,7 +451,7 @@ TVA déductible intracommunautaire 2,1% - 20 + 25 percent @@ -381,7 +471,7 @@ TVA 0% - 21 + 26 percent @@ -396,7 +486,7 @@ TVA 0% exportation - 22 + 27 percent @@ -411,7 +501,7 @@ TVA 0% livraisons intracommunautaires - 23 + 28 percent From ed62109fe260883599b1064fdb82e7139a7880da Mon Sep 17 00:00:00 2001 From: "Bharat Devnani (OpenERP)" Date: Fri, 27 Jan 2012 11:28:00 +0530 Subject: [PATCH 10/72] [IMP] converted the wizard according to new format bzr revid: bde@tinyerp.com-20120127055800-lzeiu5uqvm58lg8w --- .../wizard/l10n_be_partner_vat_listing.py | 41 ++++-- .../wizard/l10n_be_partner_vat_listing.xml | 127 ++++++++++-------- 2 files changed, 97 insertions(+), 71 deletions(-) diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index d6d56ac653c..516fa7cfb4c 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -148,6 +148,9 @@ class partner_vat_list_13(osv.osv_memory): 'name': fields.char('File Name', size=32), 'msg': fields.text('File created', size=64, readonly=True), 'file_save' : fields.binary('Save File', readonly=True), + 'identification_type': fields.selection([('tin','TIN'), ('nvat','NVAT'), ('other','Other')], 'Identification Type', required=True), + 'other': fields.char('Other Qlf', size=16, help="Description of a Identification Type"), + 'comments': fields.text('Comments'), } def _get_partners(self, cursor, user, context=None): @@ -156,6 +159,7 @@ class partner_vat_list_13(osv.osv_memory): _defaults={ # TODO the referenced model has been deleted at revno 4672.1.2. # 'partner_ids': _get_partners + 'identification_type' : 'tin' } def create_xml(self, cursor, user, ids, context=None): @@ -166,7 +170,7 @@ class partner_vat_list_13(osv.osv_memory): obj_fyear = self.pool.get('account.fiscalyear') obj_addr = self.pool.get('res.partner.address') obj_vat_lclient = self.pool.get('vat.listing.clients') - + seq_controlref = obj_sequence.get(cursor, user, 'controlref') seq_declarantnum = obj_sequence.get(cursor, user, 'declarantnum') obj_cmpny = obj_users.browse(cursor, user, user, context=context).company_id @@ -177,6 +181,7 @@ class partner_vat_list_13(osv.osv_memory): company_vat = company_vat.replace(' ','').upper() SenderId = company_vat[2:] + issued_by = company_vat[:2] cref = SenderId + seq_controlref dnum = cref + seq_declarantnum #obj_year= obj_fyear.browse(cursor, user, context['fyear'], context=context) @@ -189,7 +194,7 @@ class partner_vat_list_13(osv.osv_memory): name = ads.name or '' city = obj_addr.get_city(cursor, user, ads.id) - zip = obj_addr.browse(cursor, user, ads.id, context=context).zip + zip = obj_addr.browse(cursor, user, ads.id, context=context).zip or '' if not city: city = '' if ads.street: @@ -198,16 +203,27 @@ class partner_vat_list_13(osv.osv_memory): street += ads.street2 if ads.country_id: country = ads.country_id.code - + + data = self.read(cursor, user, ids)[0] + other = data['other'] or '' sender_date = time.strftime('%Y-%m-%d') comp_name = obj_cmpny.name - data_file = '\n\n' - data_comp = '\n\n\t'+SenderId+'\n\t'+ name +'\n\t'+ street +'\n\t'+ zip +'\n\t'+ city +'\n\t'+ country +'\n\t'+ email +'\n\t'+ phone +'\n' - data_period = '\n' + context['year'] +' \n\n' + data_file = '\n' + data_file += '\n\t' + data_file += '\n\t\t'+company_vat+'' + data_file += '\n\t\t'+ comp_name +'' + data_file += '\n\t\t'+ street +'' + data_file += '\n\t\t'+ zip +'' + data_file += '\n\t\t'+ city +'' + data_file += '\n\t\t'+ country +'' + data_file += '\n\t\t'+ email +'' + data_file += '\n\t\t'+ phone +'' + data_file += '\n\t' + data_file += '\n\t' + data_comp = '\n\t\t \n\t\t\n\t\t\t'+SenderId+' \n\t\t\t'+ comp_name +' \n\t\t\t'+ street +' \n\t\t\t'+ zip +' \n\t\t\t'+ city +' \n\t\t\t'+ country +' \n\t\t\t'+ email +' \n\t\t\t'+ phone +' \n\t\t' + data_period = '\n\t\t' + context['year'] +'' error_message = [] - data = self.read(cursor, user, ids)[0] + for partner in data['partner_ids']: if isinstance(partner, list) and partner: datas.append(partner[2]) @@ -233,10 +249,9 @@ class partner_vat_list_13(osv.osv_memory): seq += 1 sum_tax += line['amount'] sum_turnover += line['turnover'] - data_clientinfo += '\n\n\t'+line['vat'].replace(' ','').upper()[2:] +'\n\t'+str(int(round(line['turnover'] * 100))) +'\n\t'+str(int(round(line['amount'] * 100))) +'\n' - data_decl ='\n' - data_decl +='\n\t' - data_file += data_decl + data_comp + str(data_period) + data_clientinfo + '\n\t\n\t\n\n' + data_clientinfo += '\n\t\t\n\t\t\t'+line['vat'].replace(' ','').upper()[2:] +'\n\t\t\t'+str(int(round(line['turnover'] * 100))) +'\n\t\t\t'+str(int(round(line['amount'] * 100))) +'\n\t\t' + data_decl ='\n\t' + data_file += data_decl + data_comp + str(data_period) + data_clientinfo + '\n\t\t \n\t\t'+data['comments']+'\n\t\n' msg = 'Save the File with '".xml"' extension.' file_save = base64.encodestring(data_file.encode('utf8')) self.write(cursor, user, ids, {'file_save':file_save, 'msg':msg, 'name':'vat_list.xml'}, context=context) diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml index ff05e5ecefb..3b6679b9d61 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.xml @@ -1,63 +1,74 @@ - + + + Partner VAT Listing + partner.vat_13 + form + +
+
+ + Partner Bank Accounts - Add currency on tree + res.partner.bank + tree + + + + + + + + + Setup your Bank Accounts res.partner.bank From 7d8e648eaf895fb57012770fc3d3a179f3b0711b Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 1 Feb 2012 12:19:08 +0100 Subject: [PATCH 36/72] [IMP] edi: exclude sample code in EDI web template from being translated bzr revid: odo@openerp.com-20120201111908-ewah9yl2acre5a9h --- addons/edi/static/src/xml/edi.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/edi/static/src/xml/edi.xml b/addons/edi/static/src/xml/edi.xml index 1e662a2b2cc..9378e12525c 100644 --- a/addons/edi/static/src/xml/edi.xml +++ b/addons/edi/static/src/xml/edi.xml @@ -61,7 +61,7 @@
To get started immediately, see is all it takes to use this EDI document in Python.

-
+
  1. import urllib2, simplejson
  2. edi_document = urllib2.urlopen('').read()
  3. document_data = simplejson.loads(edi_document)[0]
  4. From 0c71b22f810609c30f83f48c683f77abd50877ea Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 1 Feb 2012 12:37:24 +0100 Subject: [PATCH 37/72] [FIX] purchase: remove incorrect PO-based stock move valuation for incoming shipments As discussed on bug 923191, the current override is incorrect because it will silently replace the cost of incoming stock moves with PO prices for products w/ standard costing - this should only concern products with average costing for which no cost was manually provided. And in fact we can completely remove this override because even for products with average costing, the PO prices are already provided as default cost prices in the picking/move reception wizard, so the PO price is already taken into account and the cost will never be missing. Thanks to Graeme Gellatly for the excellent analysis! lp bug: https://launchpad.net/bugs/923191 fixed bzr revid: odo@openerp.com-20120201113724-y18fna1v7z6kxka4 --- addons/purchase/stock.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index 5cfcafcce9e..34579d2a7d9 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -29,20 +29,6 @@ class stock_move(osv.osv): readonly=True), } - def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None): - """ - Overrides the default stock valuation to take into account the currency that was specified - on the purchase order in case the valuation data was not directly specified during picking - confirmation. - """ - reference_amount, reference_currency_id = super(stock_move, self)._get_reference_accounting_values_for_valuation(cr, uid, move, context=context) - if move.product_id.cost_method != 'average' or not move.price_unit: - # no average price costing or cost not specified during picking validation, we will - # plug the purchase line values if they are found. - if move.purchase_line_id and move.picking_id.purchase_id.pricelist_id: - reference_amount, reference_currency_id = move.purchase_line_id.price_unit * move.product_qty, move.picking_id.purchase_id.pricelist_id.currency_id.id - return reference_amount, reference_currency_id - stock_move() # From 64773ba35712463883b29eaa56e3c3a7cbf4b358 Mon Sep 17 00:00:00 2001 From: Ronald Portier Date: Wed, 1 Feb 2012 12:37:59 +0100 Subject: [PATCH 38/72] [FIX] drop database fails when done before connecting to server. lp bug: https://launchpad.net/bugs/924783 fixed bzr revid: ronald@therp.nl-20120201113759-wi2kogl2x1lsxk7g --- .bzrignore | 2 ++ openerp/sql_db.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index 62f8a05c90f..57c55e1a728 100644 --- a/.bzrignore +++ b/.bzrignore @@ -21,3 +21,5 @@ bin/pil*.py .project .pydevproject .settings +profiledata +*.moved diff --git a/openerp/sql_db.py b/openerp/sql_db.py index 45460bebe43..9eb2a88ada2 100644 --- a/openerp/sql_db.py +++ b/openerp/sql_db.py @@ -509,8 +509,10 @@ def db_connect(db_name): return Connection(_Pool, db_name) def close_db(db_name): + global _Pool """ You might want to call openerp.modules.registry.RegistryManager.delete(db_name) along this function.""" - _Pool.close_all(dsn(db_name)) + if _Pool: + _Pool.close_all(dsn(db_name)) ct = currentThread() if hasattr(ct, 'dbname'): delattr(ct, 'dbname') From 0839b0e4eeed05c3f6d69cd5bebec580876ca2bf Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 1 Feb 2012 13:29:26 +0100 Subject: [PATCH 39/72] [FIX] QWeb template inheritance done right bzr revid: fme@openerp.com-20120201122926-poh3q2157ra9tzjd --- addons/web/static/lib/qweb/qweb2.js | 30 ++++------------------------- addons/web/static/src/xml/base.xml | 7 +++---- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 7d58b2492f7..076a658dce9 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -276,10 +276,6 @@ QWeb2.Engine = (function() { if (xDoc.documentElement.nodeName == "parsererror") { return this.tools.exception(xDoc.documentElement.childNodes[0].nodeValue); } - if (xDoc.xml !== undefined) { - // MSIE - return this.convert_xml_to_html(xDoc.documentElement); - } return xDoc; } else { return this.load_xml_string(req.responseText); @@ -307,25 +303,7 @@ QWeb2.Engine = (function() { xDoc.async = false; xDoc.preserveWhiteSpace = true; xDoc.loadXML(s); - return this.convert_xml_to_html(xDoc.documentElement); - }, - convert_xml_to_html: function (node) { - switch (node.nodeType) { - case 3: - case 4: - return document.createTextNode(node.data); - case 8: return document.createComment(node.data); - } - - var hnode = document.createElement(node.nodeName); - for(var i=0, alen=node.attributes.length; i < alen; ++i) { - var attr = node.attributes[i]; - hnode.setAttribute(attr.name, attr.value); - } - for(var j=0, clen=node.childNodes.length; j < clen; ++j) { - hnode.appendChild(this.convert_xml_to_html(node.childNodes[j])); - } - return hnode; + return xDoc; }, has_template : function(template) { return !!this.templates[template]; @@ -431,15 +409,15 @@ QWeb2.Engine = (function() { this.tools.exception(error_msg + "Invalid operation : '" + operation + "'"); } operation = {'replace' : 'replaceWith', 'inner' : 'html'}[operation] || operation; - target[operation](this.jQuery(inner)); + target[operation](child.cloneNode(true)); } else { try { - var f = new Function(['$'], inner); + var f = new Function(['$', 'document'], inner); } catch(error) { return this.tools.exception("Parse " + error_msg + error); } try { - f.apply(target, [this.jQuery]); + f.apply(target, [this.jQuery, template_dest.ownerDocument]); } catch(error) { return this.tools.exception("Runtime " + error_msg + error); } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 550f930e3d1..8a8e39e0b7e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -680,10 +680,9 @@ this.removeAttr('t-if'); - var $title = $(document.createElement('h3')).addClass('oe_view_title'); - $title.append($(document.createElement('t')).attr( - 't-esc', 'fields_view.arch.attrs.string')); - this.prepend($title); + + +

    Date: Wed, 1 Feb 2012 13:48:22 +0100 Subject: [PATCH 40/72] [FIX] Use childnodes and not the whole extend node bzr revid: fme@openerp.com-20120201124822-xo1msj0ou09o73uh --- addons/web/static/lib/qweb/qweb2.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 076a658dce9..5a8a193a867 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -402,17 +402,16 @@ QWeb2.Engine = (function() { this.tools.exception(error_msg + "No expression given"); } error_msg += "' (expression='" + (jquery || xpath) + "') : "; - var inner = this.tools.xml_node_to_string(child, true); if (operation) { var allowed_operations = "append,prepend,before,after,replace,inner".split(','); if (this.tools.arrayIndexOf(allowed_operations, operation) == -1) { this.tools.exception(error_msg + "Invalid operation : '" + operation + "'"); } operation = {'replace' : 'replaceWith', 'inner' : 'html'}[operation] || operation; - target[operation](child.cloneNode(true)); + target[operation](child.cloneNode(true).childNodes); } else { try { - var f = new Function(['$', 'document'], inner); + var f = new Function(['$', 'document'], this.tools.xml_node_to_string(child, true)); } catch(error) { return this.tools.exception("Parse " + error_msg + error); } From 309dccbc1f5cc9605480a56b1048dd8fe4486dce Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 1 Feb 2012 14:18:48 +0100 Subject: [PATCH 41/72] [FIX] if no list limit is specified anywhere, default to 80 on listview initialization lp bug: https://launchpad.net/bugs/923805 fixed bzr revid: xmo@openerp.com-20120201131848-b0a0ity490s548c3 --- addons/web/static/src/js/view_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index f9f845f889c..94933d5064a 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -97,7 +97,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# this._limit = (this.options.limit || this.defaults.limit || (this.widget_parent.action || {}).limit - || null); + || 80); } return this._limit; }, From 8abe9402e267b57947bcb1c87fbd59daf7cec188 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 1 Feb 2012 14:22:17 +0100 Subject: [PATCH 42/72] [REM] QWeb: removed xpath support bzr revid: fme@openerp.com-20120201132217-h2i9a3g082i9ui9y --- addons/web/static/lib/qweb/qweb2.js | 31 ++--------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 5a8a193a867..1ec2a37c02d 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -106,26 +106,6 @@ var QWeb2 = { } } }, - xpath_selectNodes : function(node, expr) { - if (node.selectNodes !== undefined) { - return node.selectNodes(expr); - } else { - var xpath = new XPathEvaluator(); - try { - var result = xpath.evaluate(expr, node, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); - } catch(error) { - this.exception("Error with XPath expression '" + expr + "' : " + error); - } - var r = []; - if (result != null) { - var element; - while (element = result.iterateNext()) { - r.push(element); - } - } - return r - } - }, call: function(context, template, old_dict, _import, callback) { var new_dict = this.extend({}, old_dict); new_dict['__caller__'] = old_dict['__template__']; @@ -385,23 +365,16 @@ QWeb2.Engine = (function() { for (var i = 0, ilen = extend_node.childNodes.length; i < ilen; i++) { var child = extend_node.childNodes[i]; if (child.nodeType === 1) { - var xpath = child.getAttribute(this.prefix + '-xpath'), - jquery = child.getAttribute(this.prefix + '-jquery'), + var jquery = child.getAttribute(this.prefix + '-jquery'), operation = child.getAttribute(this.prefix + '-operation'), target, error_msg = "Error while extending template '" + template; if (jquery) { target = this.jQuery(jquery, template_dest); - } else if (xpath) { - // NOTE: due to the XPath implementation, extending a template will only work once - // when using XPath because XPathResult won't match objects with other constructor than 'Element' - // As jQuery will create HTMLElements, xpath will ignore them then causing problems when a - // template has already been extended. XPath selectors will probably be removed in QWeb. - target = this.jQuery(this.tools.xpath_selectNodes(this.templates[template], xpath)); } else { this.tools.exception(error_msg + "No expression given"); } - error_msg += "' (expression='" + (jquery || xpath) + "') : "; + error_msg += "' (expression='" + jquery + "') : "; if (operation) { var allowed_operations = "append,prepend,before,after,replace,inner".split(','); if (this.tools.arrayIndexOf(allowed_operations, operation) == -1) { From c40a0d9234c3af63d24dc1a4ebda00753b889542 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 1 Feb 2012 15:12:44 +0100 Subject: [PATCH 43/72] [IMP] account_bank_statement_extensions: fix warning in data bzr revid: rco@openerp.com-20120201141244-z10oko61nx27901y --- .../wizard/cancel_statement_line_wizard.xml | 1 - .../wizard/confirm_statement_line_wizard.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/addons/account_bank_statement_extensions/wizard/cancel_statement_line_wizard.xml b/addons/account_bank_statement_extensions/wizard/cancel_statement_line_wizard.xml index a0bff7a4874..23a28440d54 100644 --- a/addons/account_bank_statement_extensions/wizard/cancel_statement_line_wizard.xml +++ b/addons/account_bank_statement_extensions/wizard/cancel_statement_line_wizard.xml @@ -34,7 +34,6 @@ - Cancel selected statement lines client_action_multi diff --git a/addons/account_bank_statement_extensions/wizard/confirm_statement_line_wizard.xml b/addons/account_bank_statement_extensions/wizard/confirm_statement_line_wizard.xml index 77ddc861658..c44e58e340d 100644 --- a/addons/account_bank_statement_extensions/wizard/confirm_statement_line_wizard.xml +++ b/addons/account_bank_statement_extensions/wizard/confirm_statement_line_wizard.xml @@ -35,7 +35,6 @@ - Confirm selected statement lines client_action_multi From 3da9e717110dcbb07c5ae4c4aa1d0a80e63350f0 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 1 Feb 2012 15:16:33 +0100 Subject: [PATCH 44/72] [FIX] account, invoice: removed the default value of currency_id field, as it should be given by the onchange of journal_id (which has a default value) bzr revid: qdp-launchpad@openerp.com-20120201141633-mclcw5n7v9c5789h --- addons/account/account_invoice.py | 23 ++--------------------- addons/account/account_invoice_view.xml | 2 +- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index edab8f90b3f..f83de4d9bf4 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -57,12 +57,6 @@ class account_invoice(osv.osv): limit=1) return res and res[0] or False - def _get_currency(self, cr, uid, context=None): - user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, [uid], context=context)[0] - if user.company_id: - return user.company_id.currency_id.id - return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=', 1.0)])[0] - def _get_journal_analytic(self, cr, uid, type_inv, context=None): type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'} tt = type2journal.get(type_inv, 'sale') @@ -279,7 +273,6 @@ class account_invoice(osv.osv): 'type': _get_type, 'state': 'draft', 'journal_id': _get_journal, - 'currency_id': _get_currency, 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.invoice', context=c), 'reference_type': 'none', 'check_total': 0.0, @@ -464,10 +457,10 @@ class account_invoice(osv.osv): result['value'].update(to_update['value']) return result - def onchange_journal_id(self, cr, uid, ids, journal_id=False): + def onchange_journal_id(self, cr, uid, ids, journal_id=False, context=None): result = {} if journal_id: - journal = self.pool.get('account.journal').browse(cr, uid, journal_id) + journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context) currency_id = journal.currency and journal.currency.id or journal.company_id.currency_id.id result = {'value': { 'currency_id': currency_id, @@ -572,18 +565,6 @@ class account_invoice(osv.osv): else: journal_ids = obj_journal.search(cr, uid, []) - if currency_id and company_id: - currency = self.pool.get('res.currency').browse(cr, uid, currency_id) - if currency.company_id and currency.company_id.id != company_id: - val['currency_id'] = False - else: - val['currency_id'] = currency.id - if company_id: - company = self.pool.get('res.company').browse(cr, uid, company_id) - if company.currency_id.company_id and company.currency_id.company_id.id != company_id: - val['currency_id'] = False - else: - val['currency_id'] = company.currency_id.id return {'value': val, 'domain': dom} # go from canceled state to draft state diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 986f21c27fa..12a34975dd6 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -256,7 +256,7 @@ - + From 228c817c330583a246bca7905fa903eacdea278d Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Wed, 1 Feb 2012 15:30:32 +0100 Subject: [PATCH 45/72] [IMP] faster implementation for Root.find_handler. bzr revid: florent.xicluna@gmail.com-20120201143032-pshpu4uhvl61nr9z --- addons/web/common/http.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 016aff3754e..eb3f6093691 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -541,17 +541,17 @@ class Root(object): :returns: a callable matching the path sections, or ``None`` :rtype: ``Controller | None`` """ - if len(l): - for i in range(len(l), 0, -1): - ps = "/" + "/".join(l[0:i]) - if ps in controllers_path: - c = controllers_path[ps] - rest = l[i:] or ['index'] - meth = rest[0] + if l: + ps = '/' + '/'.join(l) + meth = 'index' + while ps: + c = controllers_path.get(ps) + if c: m = getattr(c, meth) if getattr(m, 'exposed', False): _logger.debug("Dispatching to %s %s %s", ps, c, meth) return m + ps, _slash, meth = ps.rpartition('/') return None class LibException(Exception): From 616cea7a6d2b55672a381a5ee5f2fc79ddbcd1e5 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Wed, 1 Feb 2012 15:38:21 +0100 Subject: [PATCH 46/72] [FIX] account: removed unknown 'filter' key used in domain and required modifiers bzr revid: qdp-launchpad@openerp.com-20120201143821-krd014pyh3ix5k0s --- addons/account/wizard/account_vat_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/account_vat_view.xml b/addons/account/wizard/account_vat_view.xml index 5cb68563352..f0e5dcb1c13 100644 --- a/addons/account/wizard/account_vat_view.xml +++ b/addons/account/wizard/account_vat_view.xml @@ -15,8 +15,8 @@ - - + +