From c9c5f4b7859cb414d37d99f25297f4175c7df74f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 24 Jan 2013 19:28:08 +0100 Subject: [PATCH 01/49] [FIX] res.config.installer: correct module installing bzr revid: chs@openerp.com-20130124182808-5xvdc0mqst0h2970 --- openerp/addons/base/res/res_config.py | 90 ++++++++++++++++----------- 1 file changed, 54 insertions(+), 36 deletions(-) diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index a2368a9f508..4c59180acc3 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -21,14 +21,47 @@ import logging from operator import attrgetter -import openerp -from openerp import pooler from openerp.osv import osv, fields from openerp.tools import ustr from openerp.tools.translate import _ _logger = logging.getLogger(__name__) + +class res_config_module_installation_mixin(object): + def _install_modules(self, cr, uid, modules, context): + """Install the requested modules. + return the next action to execute + + modules is a list of tuples + (mod_name, browse_record | None) + """ + ir_module = self.pool.get('ir.module.module') + to_install_ids = [] + to_install_missing_names = [] + + for name, module in modules: + if not module: + to_install_missing_names.append(name) + elif module.state == 'uninstalled': + to_install_ids.append(module.id) + + if to_install_ids: + ir_module.button_immediate_install(cr, uid, to_install_ids, context=context) + + if to_install_missing_names: + return { + 'type': 'ir.actions.client', + 'tag': 'apps', + 'params': {'modules': to_install_missing_names}, + } + + config = self.pool.get('res.config').next(cr, uid, [], context=context) or {} + if config.get('type') not in ('ir.actions.act_window_close',): + return config + + return None + class res_config_configurable(osv.osv_memory): ''' Base classes for new-style configuration items @@ -153,7 +186,7 @@ class res_config_configurable(osv.osv_memory): res_config_configurable() -class res_config_installer(osv.osv_memory): +class res_config_installer(osv.osv_memory, res_config_module_installation_mixin): """ New-style configuration base specialized for addons selection and installation. @@ -351,17 +384,18 @@ class res_config_installer(osv.osv_memory): return fields def execute(self, cr, uid, ids, context=None): - modules = self.pool.get('ir.module.module') to_install = list(self.modules_to_install( cr, uid, ids, context=context)) _logger.info('Selecting addons %s to install', to_install) - modules.state_update( - cr, uid, - modules.search(cr, uid, [('name','in',to_install)]), - 'to install', ['uninstalled'], context=context) - cr.commit() - openerp.modules.registry.RegistryManager.signal_registry_change(cr.dbname) - new_db, self.pool = pooler.restart_pool(cr.dbname, update_module=True) + + ir_module = self.pool.get('ir.module.module') + modules = [] + for name in to_install: + mod_ids = ir_module.search(cr, uid, [('name', '=', name)]) + record = ir_module.browse(cr, uid, mod_ids[0], context) if mod_ids else None + modules.append((name, record)) + + return self._install_modules(cr, uid, modules, context=context) res_config_installer() @@ -402,8 +436,7 @@ class ir_actions_configuration_wizard(osv.osv_memory): ir_actions_configuration_wizard() - -class res_config_settings(osv.osv_memory): +class res_config_settings(osv.osv_memory, res_config_module_installation_mixin): """ Base configuration wizard for application settings. It provides support for setting default values, assigning groups to employee users, and installing modules. To make such a 'settings' wizard, define a model like:: @@ -527,37 +560,22 @@ class res_config_settings(osv.osv_memory): getattr(self, method)(cr, uid, ids, context) # module fields: install/uninstall the selected modules - to_install_missing_names = [] + to_install = [] to_uninstall_ids = [] - to_install_ids = [] lm = len('module_') for name, module in classified['module']: if config[name]: - if not module: - # missing module, will be provided by apps.openerp.com - to_install_missing_names.append(name[lm:]) - elif module.state == 'uninstalled': - # local module, to be installed - to_install_ids.append(module.id) + to_install.append((name[lm:], module)) else: if module and module.state in ('installed', 'to upgrade'): to_uninstall_ids.append(module.id) if to_uninstall_ids: ir_module.button_immediate_uninstall(cr, uid, to_uninstall_ids, context=context) - if to_install_ids: - ir_module.button_immediate_install(cr, uid, to_install_ids, context=context) - if to_install_missing_names: - return { - 'type': 'ir.actions.client', - 'tag': 'apps', - 'params': {'modules': to_install_missing_names}, - } - - config = self.pool.get('res.config').next(cr, uid, [], context=context) or {} - if config.get('type') not in ('ir.actions.act_window_close',): - return config + action = self._install_modules(cr, uid, to_install, context=context) + if action: + return action # force client-side reload (update user menu and current view) return { @@ -572,17 +590,17 @@ class res_config_settings(osv.osv_memory): if action_ids: return act_window.read(cr, uid, action_ids[0], [], context=context) return {} - + def name_get(self, cr, uid, ids, context=None): """ Override name_get method to return an appropriate configuration wizard name, and not the generated name.""" - + if not ids: return [] # name_get may receive int id instead of an id list if isinstance(ids, (int, long)): ids = [ids] - + act_window = self.pool.get('ir.actions.act_window') action_ids = act_window.search(cr, uid, [('res_model', '=', self._name)], context=context) name = self._name From 4c89124778a1516cd3371347831bb4b6f1e60a74 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 24 Jan 2013 20:00:39 +0100 Subject: [PATCH 02/49] [IMP] account: installer get list of charts from apps bzr revid: chs@openerp.com-20130124190039-qhcyrnrgpue0rak5 --- addons/account/installer.py | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/addons/account/installer.py b/addons/account/installer.py index d02e7196d4d..aba88975e41 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -23,10 +23,16 @@ import datetime from dateutil.relativedelta import relativedelta import logging from operator import itemgetter -from os.path import join as opj import time +import urllib2 +import urlparse -from openerp import netsvc, tools +try: + import simplejson as json +except ImportError: + import json # noqa + +from openerp.release import serie from openerp.tools.translate import _ from openerp.osv import fields, osv @@ -38,13 +44,28 @@ class account_installer(osv.osv_memory): def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') + + # try get the list on apps server + try: + apps_server = self.pool.get('ir.config_parameter').get_value(cr, uid, 'apps.server', 'https://apps.openerp.com') + + up = urlparse.urlparse(apps_server) + url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie) + + j = urllib2.urlopen(url, timeout=3).read() + apps_charts = json.loads(j) + + charts = dict(apps_charts) + except Exception: + charts = dict() + # Looking for the module with the 'Account Charts' category category_name, category_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'module_category_localization_account_charts') ids = modules.search(cr, uid, [('category_id', '=', category_id)], context=context) - charts = list( - sorted(((m.name, m.shortdesc) - for m in modules.browse(cr, uid, ids, context=context)), - key=itemgetter(1))) + if ids: + charts.update((m.name, m.shortdesc) for m in modules.browse(cr, uid, ids, context=context)) + + charts = sorted(charts.items(), key=itemgetter(1)) charts.insert(0, ('configurable', _('Custom'))) return charts From a78531df4393b3850b718865df5b748d696975e5 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 25 Jan 2013 13:11:27 +0100 Subject: [PATCH 03/49] [FIX] account: installer: call right method bzr revid: chs@openerp.com-20130125121127-j7i3rwskqojyp8nm --- addons/account/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/installer.py b/addons/account/installer.py index aba88975e41..995e3986af4 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -47,7 +47,7 @@ class account_installer(osv.osv_memory): # try get the list on apps server try: - apps_server = self.pool.get('ir.config_parameter').get_value(cr, uid, 'apps.server', 'https://apps.openerp.com') + apps_server = self.pool.get('ir.config_parameter').get_param(cr, uid, 'apps.server', 'https://apps.openerp.com') up = urlparse.urlparse(apps_server) url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie) From 16289266c99096a1770fd6039539da26a0ce7c0f Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 25 Jan 2013 14:34:53 +0100 Subject: [PATCH 04/49] [FIX] res.config.installer: correct module installing bzr revid: chs@openerp.com-20130125133453-aqu5eotetdyb2zpj --- openerp/addons/base/res/res_config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 4c59180acc3..1ca6fd57cfa 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -56,10 +56,6 @@ class res_config_module_installation_mixin(object): 'params': {'modules': to_install_missing_names}, } - config = self.pool.get('res.config').next(cr, uid, [], context=context) or {} - if config.get('type') not in ('ir.actions.act_window_close',): - return config - return None class res_config_configurable(osv.osv_memory): @@ -577,6 +573,10 @@ class res_config_settings(osv.osv_memory, res_config_module_installation_mixin): if action: return action + config = self.pool.get('res.config').next(cr, uid, [], context=context) or {} + if config.get('type') not in ('ir.actions.act_window_close',): + return config + # force client-side reload (update user menu and current view) return { 'type': 'ir.actions.client', From eff170870451284a7317a9a0554e6e2060c9071d Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 31 Jan 2013 16:31:00 +0100 Subject: [PATCH 05/49] [IMP] web module tutorial: start adding RPC stuff bzr revid: xmo@openerp.com-20130131153100-gze86fbchz4tnrg3 --- addons/web/doc/module.rst | 30 ++++++++ addons/web/doc/module/__init__.py.1.diff | 16 +++++ .../static/src/js/first_module.js.7.diff | 71 +++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 addons/web/doc/module/__init__.py.1.diff create mode 100644 addons/web/doc/module/static/src/js/first_module.js.7.diff diff --git a/addons/web/doc/module.rst b/addons/web/doc/module.rst index 8306e885f65..df849afc54c 100644 --- a/addons/web/doc/module.rst +++ b/addons/web/doc/module.rst @@ -273,6 +273,36 @@ the button displayed in the UI. Then comes some actual logic: Starting and stopping the watch now works, and correctly tracks time since having started the watch, neatly formatted. +Burning through the skies +------------------------- + +All work so far has been "local" outside of the original impetus +provided by the client action: the widget is self-contained and, once +started, does not communicate with anything outside itself. Not only +that, but it has no persistence: if the user leaves the stopwatch +screen (to go and see his inbox, or do some well-deserved accounting, +for instance) whatever was being timed will be lost. + +To prevent this irremediable loss, we can use OpenERP's support for +storing data as a model, allowing so that we don't lose our data and +can later retrieve, query and manipulate it. First let's create a +basic OpenERP model in which our data will be stored: + +.. literalinclude:: module/__init__.py.1.diff + :language: diff + +then let's add saving times to the database every time the stopwatch +is stopped, using :js:class:`the "high-level" Model API +`: + +.. literalinclude:: module/static/src/js/first_module.js.7.diff + :language: diff + +A look at the "Network" tab of your preferred browser's developer +tools while playing with the stopwatch will show that the save +(creation) request is indeed sent (and replied to, even though we're +ignoring the response at this point). + .. [#DOM-building] they are not alternative solutions: they work very well together. Templates are used to build "just DOM", sub-widgets are used to build DOM subsections diff --git a/addons/web/doc/module/__init__.py.1.diff b/addons/web/doc/module/__init__.py.1.diff new file mode 100644 index 00000000000..6f16f0e9a08 --- /dev/null +++ b/addons/web/doc/module/__init__.py.1.diff @@ -0,0 +1,16 @@ +--- web_example/__init__.py ++++ web_example/__init__.py +@@ -1,1 +1,14 @@ ++# __init__.py ++from openerp.osv import orm, fields ++ ++ ++class Times(orm.Model): ++ _name = 'web_example.stopwatch' ++ ++ _columns = { ++ 'time': fields.integer("Time", required=True, ++ help="Measured time in milliseconds"), ++ 'user_id': fields.many2one('res.users', "User", required=True, ++ help="User who registered the measurement") ++ } diff --git a/addons/web/doc/module/static/src/js/first_module.js.7.diff b/addons/web/doc/module/static/src/js/first_module.js.7.diff new file mode 100644 index 00000000000..1d3430656fc --- /dev/null +++ b/addons/web/doc/module/static/src/js/first_module.js.7.diff @@ -0,0 +1,71 @@ +--- web_example/static/src/js/first_module.js ++++ web_example/static/src/js/first_module.js +@@ -1,52 +1,60 @@ + // static/src/js/first_module.js + openerp.web_example = function (instance) { + instance.web.client_actions.add('example.action', 'instance.web_example.Action'); + instance.web_example.Action = instance.web.Widget.extend({ + template: 'web_example.action', + events: { + 'click .oe_web_example_start button': 'watch_start', + 'click .oe_web_example_stop button': 'watch_stop' + }, + init: function () { + this._super.apply(this, arguments); + this._start = null; + this._watch = null; + }, ++ current: function () { ++ // Subtracting javascript dates returns the difference in milliseconds ++ return new Date() - this._start; ++ }, +- update_counter: function () { ++ update_counter: function (time) { + var h, m, s; +- // Subtracting javascript dates returns the difference in milliseconds +- var diff = new Date() - this._start; +- s = diff / 1000; ++ s = time / 1000; + m = Math.floor(s / 60); + s -= 60*m; + h = Math.floor(m / 60); + m -= 60*h; + this.$('.oe_web_example_timer').text( + _.str.sprintf("%02d:%02d:%02d", h, m, s)); + }, + watch_start: function () { + this.$el.addClass('oe_web_example_started') + .removeClass('oe_web_example_stopped'); + this._start = new Date(); + // Update the UI to the current time +- this.update_counter(); ++ this.update_counter(this.current()); + // Update the counter at 30 FPS (33ms/frame) +- this._watch = setInterval( +- this.proxy('update_counter'), ++ this._watch = setInterval(function () { ++ this.update_counter(this.current()); ++ }.bind(this), + 33); + }, + watch_stop: function () { + clearInterval(this._watch); ++ var time = this.current(); +- this.update_counter(); ++ this.update_counter(time); + this._start = this._watch = null; + this.$el.removeClass('oe_web_example_started') + .addClass('oe_web_example_stopped'); ++ new instance.web.Model('web_example.stopwatch').call('create', [{ ++ user_id: instance.session.uid, ++ time: time, ++ }]); + }, + destroy: function () { + if (this._watch) { + clearInterval(this._watch); + } + this._super(); + } + }); + }; From 06954ded48b0b9e9736eaf7325e89454d8be22c3 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 11 Feb 2013 08:52:00 +0100 Subject: [PATCH 06/49] [IMP] replace ad-hoc patch display by patchqueue bzr revid: xmo@openerp.com-20130211075200-lwd79pktewqf0wkk --- addons/web/doc/conf.py | 6 +- addons/web/doc/module.rst | 59 ++++++------------- addons/web/doc/module/0 | 17 ++++++ addons/web/doc/module/10 | 13 ++++ addons/web/doc/module/11 | 11 ++++ addons/web/doc/module/12 | 28 +++++++++ .../src/js/first_module.js.4.diff => 14} | 12 ++-- .../src/css/web_example.css.1.diff => 15} | 10 ++-- .../src/js/first_module.js.5.diff => 16} | 10 ++-- .../src/js/first_module.js.6.diff => 17} | 15 ++--- .../web/doc/module/{__init__.py.1.diff => 18} | 9 ++- .../src/js/first_module.js.7.diff => 19} | 37 +++--------- addons/web/doc/module/2 | 12 ++++ addons/web/doc/module/3 | 9 +++ addons/web/doc/module/4 | 11 ++++ addons/web/doc/module/5 | 11 ++++ addons/web/doc/module/6 | 29 +++++++++ .../src/js/first_module.js.2.diff => 8} | 7 ++- .../src/js/first_module.js.3.diff => 9} | 7 ++- addons/web/doc/module/__init__.py | 0 addons/web/doc/module/__openerp__.py | 7 --- addons/web/doc/module/__openerp__.py.1.diff | 11 ---- addons/web/doc/module/__openerp__.py.2.diff | 11 ---- addons/web/doc/module/__openerp__.py.3.diff | 12 ---- addons/web/doc/module/__openerp__.py.4.diff | 13 ---- addons/web/doc/module/__openerp__.py.5.diff | 14 ----- addons/web/doc/module/series | 17 ++++++ .../doc/module/static/src/css/web_example.css | 6 -- .../doc/module/static/src/js/first_module.js | 2 - .../static/src/js/first_module.js.1.diff | 8 --- .../doc/module/static/src/xml/web_example.xml | 11 ---- addons/web/doc/module/web_example.xml | 11 ---- 32 files changed, 232 insertions(+), 204 deletions(-) create mode 100644 addons/web/doc/module/0 create mode 100644 addons/web/doc/module/10 create mode 100644 addons/web/doc/module/11 create mode 100644 addons/web/doc/module/12 rename addons/web/doc/module/{static/src/js/first_module.js.4.diff => 14} (63%) rename addons/web/doc/module/{static/src/css/web_example.css.1.diff => 15} (59%) rename addons/web/doc/module/{static/src/js/first_module.js.5.diff => 16} (76%) rename addons/web/doc/module/{static/src/js/first_module.js.6.diff => 17} (80%) rename addons/web/doc/module/{__init__.py.1.diff => 18} (72%) rename addons/web/doc/module/{static/src/js/first_module.js.7.diff => 19} (65%) create mode 100644 addons/web/doc/module/2 create mode 100644 addons/web/doc/module/3 create mode 100644 addons/web/doc/module/4 create mode 100644 addons/web/doc/module/5 create mode 100644 addons/web/doc/module/6 rename addons/web/doc/module/{static/src/js/first_module.js.2.diff => 8} (61%) rename addons/web/doc/module/{static/src/js/first_module.js.3.diff => 9} (74%) delete mode 100644 addons/web/doc/module/__init__.py delete mode 100644 addons/web/doc/module/__openerp__.py delete mode 100644 addons/web/doc/module/__openerp__.py.1.diff delete mode 100644 addons/web/doc/module/__openerp__.py.2.diff delete mode 100644 addons/web/doc/module/__openerp__.py.3.diff delete mode 100644 addons/web/doc/module/__openerp__.py.4.diff delete mode 100644 addons/web/doc/module/__openerp__.py.5.diff create mode 100644 addons/web/doc/module/series delete mode 100644 addons/web/doc/module/static/src/css/web_example.css delete mode 100644 addons/web/doc/module/static/src/js/first_module.js delete mode 100644 addons/web/doc/module/static/src/js/first_module.js.1.diff delete mode 100644 addons/web/doc/module/static/src/xml/web_example.xml delete mode 100644 addons/web/doc/module/web_example.xml diff --git a/addons/web/doc/conf.py b/addons/web/doc/conf.py index 7fe38022ab1..e8ffc50d495 100644 --- a/addons/web/doc/conf.py +++ b/addons/web/doc/conf.py @@ -27,7 +27,11 @@ sys.path.insert(0, os.path.abspath('..')) # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.viewcode'] +extensions = [ + 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', 'sphinx.ext.viewcode', + 'patchqueue' +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/addons/web/doc/module.rst b/addons/web/doc/module.rst index df849afc54c..02e0f9c250a 100644 --- a/addons/web/doc/module.rst +++ b/addons/web/doc/module.rst @@ -1,5 +1,7 @@ .. _module: +.. queue:: module/series + Building an OpenERP Web module ============================== @@ -19,8 +21,7 @@ A very basic OpenERP module structure will be our starting point: ├── __init__.py └── __openerp__.py -.. literalinclude:: module/__openerp__.py - :language: python +.. patch:: This is a sufficient minimal declaration of a valid OpenERP module. @@ -41,8 +42,7 @@ module is automatically recognized as "web-enabled" if it contains a is the extent of it. You should also change the dependency to list ``web``: -.. literalinclude:: module/__openerp__.py.1.diff - :language: diff +.. patch:: .. note:: @@ -67,15 +67,13 @@ The first one is to add javascript code. It's customary to put it in ``static/src/js``, to have room for e.g. other file types, or third-party libraries. -.. literalinclude:: module/static/src/js/first_module.js - :language: javascript +.. patch:: The client won't load any file unless specified, thus the new file should be listed in the module's manifest file, under a new key ``js`` (a list of file names, or glob patterns): -.. literalinclude:: module/__openerp__.py.2.diff - :language: diff +.. patch:: At this point, if the module is installed and the client reloaded the message should appear in your browser's development console. @@ -100,8 +98,7 @@ initialized, and it can't get access to the various APIs of the web client (such as making RPC requests to the server). This is done by providing a `javascript module`_: -.. literalinclude:: module/static/src/js/first_module.js.1.diff - :language: diff +.. patch:: If you reload the client, you'll see a message in the console exactly as previously. The differences, though invisible at this point, are: @@ -122,17 +119,12 @@ To demonstrate, let's build a simple :doc:`client action First, the action declaration: -.. literalinclude:: module/__openerp__.py.3.diff - :language: diff - -.. literalinclude:: module/web_example.xml - :language: xml +.. patch:: then set up the :doc:`client action hook ` to register a function (for now): -.. literalinclude:: module/static/src/js/first_module.js.2.diff - :language: diff +.. patch:: Updating the module (in order to load the XML description) and re-starting the server should display a new menu *Example Client @@ -148,8 +140,7 @@ client action function by a :doc:`widget`. Our widget will simply use its :js:func:`~openerp.web.Widget.start` to add some content to its DOM: -.. literalinclude:: module/static/src/js/first_module.js.3.diff - :language: diff +.. patch:: after reloading the client (to update the javascript file), instead of printing to the console the menu item clears the whole screen and @@ -159,15 +150,13 @@ Since we've added a class on the widget's :ref:`DOM root ` we can now see how to add a stylesheet to a module: first create the stylesheet file: -.. literalinclude:: module/static/src/css/web_example.css - :language: css +.. patch:: then add a reference to the stylesheet in the module's manifest (which will require restarting the OpenERP Server to see the changes, as usual): -.. literalinclude:: module/__openerp__.py.4.diff - :language: diff +.. patch:: the text displayed by the menu item should now be huge, and white-on-black (instead of small and black-on-white). From there on, @@ -204,22 +193,16 @@ integration to OpenERP Web widgets. Adding a template file is similar to adding a style sheet: -.. literalinclude:: module/static/src/xml/web_example.xml - :language: xml - -.. literalinclude:: module/__openerp__.py.5.diff - :language: diff +.. patch:: The template can then easily be hooked in the widget: -.. literalinclude:: module/static/src/js/first_module.js.4.diff - :language: diff +.. patch:: And finally the CSS can be altered to style the new (and more complex) template-generated DOM, rather than the code-generated one: -.. literalinclude:: module/static/src/css/web_example.css.1.diff - :language: diff +.. patch:: .. note:: @@ -238,15 +221,13 @@ The last step (until the next one) is to add some behavior and make our stopwatch watch. First hook some events on the buttons to toggle the widget's state: -.. literalinclude:: module/static/src/js/first_module.js.5.diff - :language: diff +.. patch:: This demonstrates the use of the "events hash" and event delegation to declaratively handle events on the widget's DOM. And already changes the button displayed in the UI. Then comes some actual logic: -.. literalinclude:: module/static/src/js/first_module.js.6.diff - :language: diff +.. patch:: * An initializer (the ``init`` method) is introduced to set-up a few internal variables: ``_start`` will hold the start of the timer (as @@ -288,15 +269,13 @@ storing data as a model, allowing so that we don't lose our data and can later retrieve, query and manipulate it. First let's create a basic OpenERP model in which our data will be stored: -.. literalinclude:: module/__init__.py.1.diff - :language: diff +.. patch:: then let's add saving times to the database every time the stopwatch is stopped, using :js:class:`the "high-level" Model API `: -.. literalinclude:: module/static/src/js/first_module.js.7.diff - :language: diff +.. patch:: A look at the "Network" tab of your preferred browser's developer tools while playing with the stopwatch will show that the save diff --git a/addons/web/doc/module/0 b/addons/web/doc/module/0 new file mode 100644 index 00000000000..16762e1afd0 --- /dev/null +++ b/addons/web/doc/module/0 @@ -0,0 +1,17 @@ +# HG changeset patch +# Parent 0000000000000000000000000000000000000000 + +diff --git a/__init__.py b/__init__.py +new file mode 100644 +diff --git a/__openerp__.py b/__openerp__.py +new file mode 100644 +--- /dev/null ++++ b/__openerp__.py +@@ -0,0 +1,7 @@ ++# __openerp__.py ++{ ++ 'name': "Web Example", ++ 'description': "Basic example of a (future) web module", ++ 'category': 'Hidden', ++ 'depends': ['base'], ++} diff --git a/addons/web/doc/module/10 b/addons/web/doc/module/10 new file mode 100644 index 00000000000..dc3b670c5a0 --- /dev/null +++ b/addons/web/doc/module/10 @@ -0,0 +1,13 @@ +# HG changeset patch +# Parent 72d9d59a93fcee06ba28cf0b98a1075331dcc8f4 +diff --git a/static/src/css/web_example.css b/static/src/css/web_example.css +new file mode 100644 +--- /dev/null ++++ b/static/src/css/web_example.css +@@ -0,0 +1,6 @@ ++.openerp .oe_web_example { ++ color: white; ++ background-color: black; ++ height: 100%; ++ font-size: 400%; ++} diff --git a/addons/web/doc/module/11 b/addons/web/doc/module/11 new file mode 100644 index 00000000000..fc4225afaa6 --- /dev/null +++ b/addons/web/doc/module/11 @@ -0,0 +1,11 @@ +# HG changeset patch +# Parent 3ed382d9a8fe64fbb8e2bf4045e3fcd5c74c92bc +diff --git a/__openerp__.py b/__openerp__.py +--- a/__openerp__.py ++++ b/__openerp__.py +@@ -6,4 +6,5 @@ + 'depends': ['web'], + 'data': ['web_example.xml'], + 'js': ['static/src/js/first_module.js'], ++ 'css': ['static/src/css/web_example.css'], + } diff --git a/addons/web/doc/module/12 b/addons/web/doc/module/12 new file mode 100644 index 00000000000..9a2982e7d20 --- /dev/null +++ b/addons/web/doc/module/12 @@ -0,0 +1,28 @@ +# HG changeset patch +# Parent 43f21611dacb7c2b2f3810baeeef359ad7c329f0 + +diff --git a/__openerp__.py b/__openerp__.py +--- a/__openerp__.py ++++ b/__openerp__.py +@@ -7,4 +7,5 @@ + 'data': ['web_example.xml'], + 'js': ['static/src/js/first_module.js'], + 'css': ['static/src/css/web_example.css'], ++ 'qweb': ['static/src/xml/web_example.xml'], + } +diff --git a/static/src/xml/web_example.xml b/static/src/xml/web_example.xml +new file mode 100644 +--- /dev/null ++++ b/static/src/xml/web_example.xml +@@ -0,0 +1,11 @@ ++ ++
++

00:00:00

++

++ ++

++

++ ++

++
++
diff --git a/addons/web/doc/module/static/src/js/first_module.js.4.diff b/addons/web/doc/module/14 similarity index 63% rename from addons/web/doc/module/static/src/js/first_module.js.4.diff rename to addons/web/doc/module/14 index 78a192147e6..a908cbc61e2 100644 --- a/addons/web/doc/module/static/src/js/first_module.js.4.diff +++ b/addons/web/doc/module/14 @@ -1,15 +1,17 @@ ---- web_example/static/src/js/first_module.js -+++ web_example/static/src/js/first_module.js -@@ -1,11 +1,7 @@ - // static/src/js/first_module.js +# HG changeset patch +# Parent ae3b427c96b532794a65357b3f075129cc991276 +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +--- a/static/src/js/first_module.js ++++ b/static/src/js/first_module.js +@@ -2,10 +2,6 @@ openerp.web_example = function (instance) { instance.web.client_actions.add('example.action', 'instance.web_example.Action'); instance.web_example.Action = instance.web.Widget.extend({ -+ template: 'web_example.action' - className: 'oe_web_example', - start: function () { - this.$el.text("Hello, world!"); - return this._super(); - } ++ template: 'web_example.action' }); }; diff --git a/addons/web/doc/module/static/src/css/web_example.css.1.diff b/addons/web/doc/module/15 similarity index 59% rename from addons/web/doc/module/static/src/css/web_example.css.1.diff rename to addons/web/doc/module/15 index 442211a252b..d82abee3284 100644 --- a/addons/web/doc/module/static/src/css/web_example.css.1.diff +++ b/addons/web/doc/module/15 @@ -1,7 +1,9 @@ ---- web_example/static/src/css/web_example.css -+++ web_example/static/src/css/web_example.css -@@ -1,6 +1,13 @@ - .openerp .oe_web_example { +# HG changeset patch +# Parent e2d2e1a4cc2d2496aebeb05d94768384427c9e8b +diff --git a/static/src/css/web_example.css b/static/src/css/web_example.css +--- a/static/src/css/web_example.css ++++ b/static/src/css/web_example.css +@@ -2,5 +2,12 @@ color: white; background-color: black; height: 100%; diff --git a/addons/web/doc/module/static/src/js/first_module.js.5.diff b/addons/web/doc/module/16 similarity index 76% rename from addons/web/doc/module/static/src/js/first_module.js.5.diff rename to addons/web/doc/module/16 index f345ea319ef..816c23aa0b0 100644 --- a/addons/web/doc/module/static/src/js/first_module.js.5.diff +++ b/addons/web/doc/module/16 @@ -1,7 +1,9 @@ ---- web_example/static/src/js/first_module.js -+++ web_example/static/src/js/first_module.js -@@ -1,7 +1,19 @@ - // static/src/js/first_module.js +# HG changeset patch +# Parent 2645d7a09dcba7f6d6074a33252c16c03c56fdf3 +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +--- a/static/src/js/first_module.js ++++ b/static/src/js/first_module.js +@@ -2,6 +2,18 @@ openerp.web_example = function (instance) { instance.web.client_actions.add('example.action', 'instance.web_example.Action'); instance.web_example.Action = instance.web.Widget.extend({ diff --git a/addons/web/doc/module/static/src/js/first_module.js.6.diff b/addons/web/doc/module/17 similarity index 80% rename from addons/web/doc/module/static/src/js/first_module.js.6.diff rename to addons/web/doc/module/17 index 7dd17af0e18..d6d6ecc71e3 100644 --- a/addons/web/doc/module/static/src/js/first_module.js.6.diff +++ b/addons/web/doc/module/17 @@ -1,12 +1,9 @@ ---- web_example/static/src/js/first_module.js -+++ web_example/static/src/js/first_module.js -@@ -1,19 +1,52 @@ - // static/src/js/first_module.js - openerp.web_example = function (instance) { - instance.web.client_actions.add('example.action', 'instance.web_example.Action'); - instance.web_example.Action = instance.web.Widget.extend({ - template: 'web_example.action', - events: { +# HG changeset patch +# Parent 2921a545adc3406d3139be7951f3225e94493466 +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +--- a/static/src/js/first_module.js ++++ b/static/src/js/first_module.js +@@ -7,13 +7,46 @@ openerp.web_example = function (instance 'click .oe_web_example_start button': 'watch_start', 'click .oe_web_example_stop button': 'watch_stop' }, diff --git a/addons/web/doc/module/__init__.py.1.diff b/addons/web/doc/module/18 similarity index 72% rename from addons/web/doc/module/__init__.py.1.diff rename to addons/web/doc/module/18 index 6f16f0e9a08..6781c985239 100644 --- a/addons/web/doc/module/__init__.py.1.diff +++ b/addons/web/doc/module/18 @@ -1,6 +1,9 @@ ---- web_example/__init__.py -+++ web_example/__init__.py -@@ -1,1 +1,14 @@ +# HG changeset patch +# Parent e0cc13c2b2ec4d6f6bfdb033b189a32e44106f2e +diff --git a/__init__.py b/__init__.py +--- a/__init__.py ++++ b/__init__.py +@@ -0,0 +1,13 @@ +# __init__.py +from openerp.osv import orm, fields + diff --git a/addons/web/doc/module/static/src/js/first_module.js.7.diff b/addons/web/doc/module/19 similarity index 65% rename from addons/web/doc/module/static/src/js/first_module.js.7.diff rename to addons/web/doc/module/19 index 1d3430656fc..d95a89a3441 100644 --- a/addons/web/doc/module/static/src/js/first_module.js.7.diff +++ b/addons/web/doc/module/19 @@ -1,25 +1,17 @@ ---- web_example/static/src/js/first_module.js -+++ web_example/static/src/js/first_module.js -@@ -1,52 +1,60 @@ - // static/src/js/first_module.js - openerp.web_example = function (instance) { - instance.web.client_actions.add('example.action', 'instance.web_example.Action'); - instance.web_example.Action = instance.web.Widget.extend({ - template: 'web_example.action', - events: { - 'click .oe_web_example_start button': 'watch_start', - 'click .oe_web_example_stop button': 'watch_stop' - }, - init: function () { - this._super.apply(this, arguments); +# HG changeset patch +# Parent 05797cc75b49634e640f44b24347f2905b464022 +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +--- a/static/src/js/first_module.js ++++ b/static/src/js/first_module.js +@@ -12,11 +12,13 @@ openerp.web_example = function (instance this._start = null; this._watch = null; }, +- update_counter: function () { + current: function () { + // Subtracting javascript dates returns the difference in milliseconds + return new Date() - this._start; + }, -- update_counter: function () { + update_counter: function (time) { var h, m, s; - // Subtracting javascript dates returns the difference in milliseconds @@ -29,12 +21,7 @@ m = Math.floor(s / 60); s -= 60*m; h = Math.floor(m / 60); - m -= 60*h; - this.$('.oe_web_example_timer').text( - _.str.sprintf("%02d:%02d:%02d", h, m, s)); - }, - watch_start: function () { - this.$el.addClass('oe_web_example_started') +@@ -29,18 +31,24 @@ openerp.web_example = function (instance .removeClass('oe_web_example_stopped'); this._start = new Date(); // Update the UI to the current time @@ -50,8 +37,8 @@ }, watch_stop: function () { clearInterval(this._watch); -+ var time = this.current(); - this.update_counter(); ++ var time = this.current(); + this.update_counter(time); this._start = this._watch = null; this.$el.removeClass('oe_web_example_started') @@ -63,9 +50,3 @@ }, destroy: function () { if (this._watch) { - clearInterval(this._watch); - } - this._super(); - } - }); - }; diff --git a/addons/web/doc/module/2 b/addons/web/doc/module/2 new file mode 100644 index 00000000000..08becf41602 --- /dev/null +++ b/addons/web/doc/module/2 @@ -0,0 +1,12 @@ +# HG changeset patch +# Parent 8a986919a3e22cd7cca51210820c09d4545dc60d +diff --git a/__openerp__.py b/__openerp__.py +--- a/__openerp__.py ++++ b/__openerp__.py +@@ -3,5 +3,5 @@ + 'name': "Web Example", + 'description': "Basic example of a (future) web module", + 'category': 'Hidden', +- 'depends': ['base'], ++ 'depends': ['web'], + } diff --git a/addons/web/doc/module/3 b/addons/web/doc/module/3 new file mode 100644 index 00000000000..c09925f93d4 --- /dev/null +++ b/addons/web/doc/module/3 @@ -0,0 +1,9 @@ +# HG changeset patch +# Parent dcf661a5eef8f82503831bdb8e6c9d2f9beb285e +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +new file mode 100644 +--- /dev/null ++++ b/static/src/js/first_module.js +@@ -0,0 +1,2 @@ ++// static/src/js/first_module.js ++console.log("Debug statement: file loaded"); diff --git a/addons/web/doc/module/4 b/addons/web/doc/module/4 new file mode 100644 index 00000000000..55535fe57da --- /dev/null +++ b/addons/web/doc/module/4 @@ -0,0 +1,11 @@ +# HG changeset patch +# Parent 139dae60de67efa0017f5032f71ab774685c5507 +diff --git a/__openerp__.py b/__openerp__.py +--- a/__openerp__.py ++++ b/__openerp__.py +@@ -4,4 +4,5 @@ + 'description': "Basic example of a (future) web module", + 'category': 'Hidden', + 'depends': ['web'], ++ 'js': ['static/src/js/first_module.js'], + } diff --git a/addons/web/doc/module/5 b/addons/web/doc/module/5 new file mode 100644 index 00000000000..49acad9cd52 --- /dev/null +++ b/addons/web/doc/module/5 @@ -0,0 +1,11 @@ +# HG changeset patch +# Parent c8ae7646cce3f271698c844eb2d67f9a8719650d +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +--- a/static/src/js/first_module.js ++++ b/static/src/js/first_module.js +@@ -1,2 +1,4 @@ + // static/src/js/first_module.js +-console.log("Debug statement: file loaded"); ++openerp.web_example = function (instance) { ++ console.log("Module loaded"); ++}; diff --git a/addons/web/doc/module/6 b/addons/web/doc/module/6 new file mode 100644 index 00000000000..f2c6a8762e7 --- /dev/null +++ b/addons/web/doc/module/6 @@ -0,0 +1,29 @@ +# HG changeset patch +# Parent 0026cb80097a724db8d36371bc00da993a51a06f + +diff --git a/__openerp__.py b/__openerp__.py +--- a/__openerp__.py ++++ b/__openerp__.py +@@ -4,5 +4,6 @@ + 'description': "Basic example of a (future) web module", + 'category': 'Hidden', + 'depends': ['web'], ++ 'data': ['web_example.xml'], + 'js': ['static/src/js/first_module.js'], + } +diff --git a/web_example.xml b/web_example.xml +new file mode 100644 +--- /dev/null ++++ b/web_example.xml +@@ -0,0 +1,11 @@ ++ ++ ++ ++ ++ Example Client Action ++ example.action ++ ++ ++ ++ diff --git a/addons/web/doc/module/static/src/js/first_module.js.2.diff b/addons/web/doc/module/8 similarity index 61% rename from addons/web/doc/module/static/src/js/first_module.js.2.diff rename to addons/web/doc/module/8 index 88a80f50fff..83e6c371bb3 100644 --- a/addons/web/doc/module/static/src/js/first_module.js.2.diff +++ b/addons/web/doc/module/8 @@ -1,5 +1,8 @@ ---- web_example/static/src/js/first_module.js -+++ web_example/static/src/js/first_module.js +# HG changeset patch +# Parent d987c9edd884de1de30f2ceb70d2e554474b8dd1 +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +--- a/static/src/js/first_module.js ++++ b/static/src/js/first_module.js @@ -1,4 +1,7 @@ // static/src/js/first_module.js openerp.web_example = function (instance) { diff --git a/addons/web/doc/module/static/src/js/first_module.js.3.diff b/addons/web/doc/module/9 similarity index 74% rename from addons/web/doc/module/static/src/js/first_module.js.3.diff rename to addons/web/doc/module/9 index 295e90b6840..9113f914e7c 100644 --- a/addons/web/doc/module/static/src/js/first_module.js.3.diff +++ b/addons/web/doc/module/9 @@ -1,5 +1,8 @@ ---- web_example/static/src/js/first_module.js -+++ web_example/static/src/js/first_module.js +# HG changeset patch +# Parent 6a1a7240ea0e63182f60abb1eb5c631089d56dbe +diff --git a/static/src/js/first_module.js b/static/src/js/first_module.js +--- a/static/src/js/first_module.js ++++ b/static/src/js/first_module.js @@ -1,7 +1,11 @@ // static/src/js/first_module.js openerp.web_example = function (instance) { diff --git a/addons/web/doc/module/__init__.py b/addons/web/doc/module/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/addons/web/doc/module/__openerp__.py b/addons/web/doc/module/__openerp__.py deleted file mode 100644 index d8c23c34f10..00000000000 --- a/addons/web/doc/module/__openerp__.py +++ /dev/null @@ -1,7 +0,0 @@ -# __openerp__.py -{ - 'name': "Web Example", - 'description': "Basic example of a (future) web module", - 'category': 'Hidden', - 'depends': ['base'], -} diff --git a/addons/web/doc/module/__openerp__.py.1.diff b/addons/web/doc/module/__openerp__.py.1.diff deleted file mode 100644 index dbab2e65437..00000000000 --- a/addons/web/doc/module/__openerp__.py.1.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- web_example/__openerp__.py -+++ web_example/__openerp__.py -@@ -1,7 +1,7 @@ - # __openerp__.py - { - 'name': "Web Example", - 'description': "Basic example of a (future) web module", - 'category': 'Hidden', -- 'depends': ['base'], -+ 'depends': ['web'], - } diff --git a/addons/web/doc/module/__openerp__.py.2.diff b/addons/web/doc/module/__openerp__.py.2.diff deleted file mode 100644 index 77025f11512..00000000000 --- a/addons/web/doc/module/__openerp__.py.2.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- web_example/__openerp__.py -+++ web_example/__openerp__.py -@@ -1,7 +1,8 @@ - # __openerp__.py - { - 'name': "Web Example", - 'description': "Basic example of a (future) web module", - 'category': 'Hidden', - 'depends': ['web'], -+ 'js': ['static/src/js/first_module.js'], - } diff --git a/addons/web/doc/module/__openerp__.py.3.diff b/addons/web/doc/module/__openerp__.py.3.diff deleted file mode 100644 index e100098bce9..00000000000 --- a/addons/web/doc/module/__openerp__.py.3.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- web_example/__openerp__.py -+++ web_example/__openerp__.py -@@ -1,8 +1,9 @@ - # __openerp__.py - { - 'name': "Web Example", - 'description': "Basic example of a (future) web module", - 'category': 'Hidden', - 'depends': ['web'], -+ 'data': ['web_example.xml'], - 'js': ['static/src/js/first_module.js'], - } diff --git a/addons/web/doc/module/__openerp__.py.4.diff b/addons/web/doc/module/__openerp__.py.4.diff deleted file mode 100644 index 78fc90c4b1c..00000000000 --- a/addons/web/doc/module/__openerp__.py.4.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- web_example/__openerp__.py -+++ web_example/__openerp__.py -@@ -1,9 +1,10 @@ - # __openerp__.py - { - 'name': "Web Example", - 'description': "Basic example of a (future) web module", - 'category': 'Hidden', - 'depends': ['web'], - 'data': ['web_example.xml'], - 'js': ['static/src/js/first_module.js'], -+ 'css': ['static/src/css/web_example.css'], - } diff --git a/addons/web/doc/module/__openerp__.py.5.diff b/addons/web/doc/module/__openerp__.py.5.diff deleted file mode 100644 index c9492420ee8..00000000000 --- a/addons/web/doc/module/__openerp__.py.5.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- web_example/__openerp__.py -+++ web_example/__openerp__.py -@@ -1,10 +1,11 @@ - # __openerp__.py - { - 'name': "Web Example", - 'description': "Basic example of a (future) web module", - 'category': 'Hidden', - 'depends': ['web'], - 'data': ['web_example.xml'], - 'js': ['static/src/js/first_module.js'], - 'css': ['static/src/css/web_example.css'], -+ 'qweb': ['static/src/xml/web_example.xml'], - } diff --git a/addons/web/doc/module/series b/addons/web/doc/module/series new file mode 100644 index 00000000000..119e58801de --- /dev/null +++ b/addons/web/doc/module/series @@ -0,0 +1,17 @@ +0 +2 +3 +4 +5 +6 +8 +9 +10 +11 +12 +14 +15 +16 +17 +18 +19 diff --git a/addons/web/doc/module/static/src/css/web_example.css b/addons/web/doc/module/static/src/css/web_example.css deleted file mode 100644 index b861af8d517..00000000000 --- a/addons/web/doc/module/static/src/css/web_example.css +++ /dev/null @@ -1,6 +0,0 @@ -.openerp .oe_web_example { - color: white; - background-color: black; - height: 100%; - font-size: 400%; -} diff --git a/addons/web/doc/module/static/src/js/first_module.js b/addons/web/doc/module/static/src/js/first_module.js deleted file mode 100644 index 74580d1c0ca..00000000000 --- a/addons/web/doc/module/static/src/js/first_module.js +++ /dev/null @@ -1,2 +0,0 @@ -// static/src/js/first_module.js -console.log("Debug statement: file loaded"); diff --git a/addons/web/doc/module/static/src/js/first_module.js.1.diff b/addons/web/doc/module/static/src/js/first_module.js.1.diff deleted file mode 100644 index 53c153e1971..00000000000 --- a/addons/web/doc/module/static/src/js/first_module.js.1.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- web_example/static/src/js/first_module.js -+++ web_example/static/src/js/first_module.js -@@ -1,2 +1,4 @@ - // static/src/js/first_module.js --console.log("Debug statement: file loaded"); -+openerp.web_example = function (instance) { -+ console.log("Module loaded"); -+}; diff --git a/addons/web/doc/module/static/src/xml/web_example.xml b/addons/web/doc/module/static/src/xml/web_example.xml deleted file mode 100644 index b5a9918f2f0..00000000000 --- a/addons/web/doc/module/static/src/xml/web_example.xml +++ /dev/null @@ -1,11 +0,0 @@ - -
-

00:00:00

-

- -

-

- -

-
-
diff --git a/addons/web/doc/module/web_example.xml b/addons/web/doc/module/web_example.xml deleted file mode 100644 index dfcc1614df4..00000000000 --- a/addons/web/doc/module/web_example.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Example Client Action - example.action - - - - From c290a184588bf00f189f0a20feb2f5d4d15fc130 Mon Sep 17 00:00:00 2001 From: ggh-openerp Date: Fri, 15 Feb 2013 17:16:04 +0530 Subject: [PATCH 07/49] [IMP] hr.expense list view, there is not total under the list now add a total Expenses bzr revid: ggh@tinyerp.com-20130215114604-nlvk1x9rv8131rbd --- addons/hr_expense/hr_expense_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index 0324388786f..d8ef5006f96 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -32,7 +32,7 @@ - + From 0c56cfab8316f5397f9c0330127c86f319a95d6a Mon Sep 17 00:00:00 2001 From: Vishmita Date: Fri, 15 Feb 2013 18:46:10 +0530 Subject: [PATCH 08/49] [IMP]Improve the related actions on the partner bzr revid: vja@tinyerp.com-20130215131610-urfy8svmr05k4t02 --- addons/account/account_invoice_view.xml | 2 -- addons/account/account_view.xml | 25 +++++++------------------ addons/account/partner_view.xml | 12 ------------ addons/crm/res_partner_view.xml | 9 +++++++++ 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 6cca8e0ce46..c37dc708a53 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -622,8 +622,6 @@ - - - + + {'search_default_partner_id': [active_id], 'default_partner_id': active_id} + Journal Items + account.move.line + + tree,form + account.move.line @@ -1769,23 +1775,6 @@ - - - - - - - - - - diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml index 00a071fa954..42d57eca56c 100644 --- a/addons/crm/res_partner_view.xml +++ b/addons/crm/res_partner_view.xml @@ -96,6 +96,15 @@ + +

++
    + + diff --git a/addons/web/doc/module/21 b/addons/web/doc/module/21 new file mode 100644 index 00000000000..0acfac9001d --- /dev/null +++ b/addons/web/doc/module/21 @@ -0,0 +1,27 @@ +Index: web_example/static/src/js/first_module.js +=================================================================== +--- web_example.orig/static/src/js/first_module.js ++++ web_example/static/src/js/first_module.js +@@ -55,16 +55,20 @@ openerp.web_example = function (instance + 33); + }, + watch_stop: function () { ++ var self = this; + clearInterval(this._watch); + var time = this.current(); + this.update_counter(time); + this._start = this._watch = null; + this.$el.removeClass('oe_web_example_started') + .addClass('oe_web_example_stopped'); +- this.model.call('create', [{ ++ var record = { + user_id: instance.session.uid, + time: time, +- }]); ++ }; ++ this.model.call('create', [record]).done(function () { ++ self.display_record(record); ++ }); + }, + destroy: function () { + if (this._watch) { diff --git a/addons/web/doc/module/series b/addons/web/doc/module/series index 119e58801de..6271f474f0b 100644 --- a/addons/web/doc/module/series +++ b/addons/web/doc/module/series @@ -15,3 +15,5 @@ 17 18 19 +20 +21 From 259c84ed1f109fa0535895f4a21c1f6beccf0c86 Mon Sep 17 00:00:00 2001 From: Vishmita Date: Mon, 18 Feb 2013 11:40:32 +0530 Subject: [PATCH 10/49] [FIX]change sequence bzr revid: vja@tinyerp.com-20130218061032-kpp06g1k64tl17sz --- addons/crm/res_partner_view.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml index 42d57eca56c..d0d4fafb9c8 100644 --- a/addons/crm/res_partner_view.xml +++ b/addons/crm/res_partner_view.xml @@ -96,15 +96,6 @@ -