odoo/openerp/addons/base/ir
Xavier Morel 9cefa76988 [ADD] hasclass() xpath function
Server-side, view extension is done via xpath. This includes "template" views
full of HTML.

HTML elements often have a bunch of classes, sometimes even semantic
(!). XPath is generally great, but specifically lousy at dealing with
space-separated values: in standard XPath 1.0 to know if an element has a
class 'foo' the predicate is:

    contains(concat(' ', normalize-space(@class), ' '), ' foo ')

and this has to be fully duplicated if there's a second class involved.

Things are slightly better with EXSLT/XPath 2.0 and tokenize, but still not
great:

    tokenize(@class, '\s+') = 'foo'

and the equality check is very weird when unaware of XPath's evaluation rules.

``hasclass`` makes this much simpler to deal with: to get any ``foo`` node
with the class ``bar`` is as simple as:

    //foo[hasclass('bar')

and it can take multiple class, as with e.g. jquery it will return elements
with all specified classes.

Beware though, the predicate function will be called once for each element to
check, since it's implemented in pure python and not profiled elements should
be filtered as much as possible before this point.
2014-05-19 08:32:23 +02:00
..
__init__.py [IMP] Add the ir_logging object where we will store the log messages (exception, error and warning) 2014-02-28 17:10:55 +01:00
ir_actions.py [MERGE] [IMP] Misc view improvements using better name_get / name_search. 2014-05-09 11:49:20 +02:00
ir_actions.xml [IMP] ir.actions.report.xml form view: hide the attachmend fields when report_type controller is selected 2014-03-24 17:26:16 +01:00
ir_attachment.py [IMP] ir.attachment: add method to force all attachments to use selected storage 2014-04-10 17:20:39 +02:00
ir_attachment_view.xml [IMP] Technical menu reorg, remove depreacted requests. 2013-10-06 13:26:08 +02:00
ir_config_parameter.py [IMP]ir_config_parameter.py: use _rec_name. 2014-05-06 14:09:31 +05:30
ir_config_parameter_view.xml [FIX] cleanup ir.xml mess, ir.ui.view name is now optional in xml files 2012-10-13 14:09:24 +02:00
ir_cron.py [MERGE] cron race condition leading to unneeded executions, courtesy of acsone 2014-02-28 17:15:24 +01:00
ir_cron_view.xml [IMP] ir_actions cleanups. 2013-10-06 12:24:04 +02:00
ir_default.py [IMP] cleanups, move tests, remove deprecated model instantiation 2014-05-01 20:42:17 +02:00
ir_exports.py [IMP] cleanups, move tests, remove deprecated model instantiation 2014-05-01 20:42:17 +02:00
ir_fields.py [MERGE] forward port of branch saas-2 up to revid 5007 chs@openerp.com-20140206110220-myn57cryam1y4k9v 2014-02-06 12:04:23 +01:00
ir_filters.py [IMP] cleanups, move tests, remove deprecated model instantiation 2014-05-01 20:42:17 +02:00
ir_filters.xml [IMP] rng of field tag in data xml 2013-04-29 14:24:23 +02:00
ir_http.py [MERGE] forward port of branch saas-3 up to revid 5112 chs@openerp.com-20140407144238-3s38zadkh7yxpdy7 2014-04-07 18:05:48 +02:00
ir_logging.py [FIX] ir_logging missing field 2014-03-17 01:08:51 +01:00
ir_logging_view.xml ir_logging fix msg, add uid in form view 2014-03-16 20:43:28 +01:00
ir_mail_server.py [IMP] add options for calendar view 2013-11-23 12:30:53 +01:00
ir_mail_server_view.xml [FIX] cleanup ir.xml mess, ir.ui.view name is now optional in xml files 2012-10-13 14:09:24 +02:00
ir_model.py [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5294 revid:odo@openerp.com-20140505074636-bl2y5pst4pfmpz3u 2014-05-06 14:16:27 +02:00
ir_model_report.sxw fix res_group rename, move files to clean up res 2013-10-06 17:03:09 +02:00
ir_model_report.xml fix res_group rename, move files to clean up res 2013-10-06 17:03:09 +02:00
ir_model_view.xml fix res_group rename, move files to clean up res 2013-10-06 17:03:09 +02:00
ir_needaction.py [MERGE] From trunk (second time) 2012-12-17 15:47:53 +01:00
ir_qweb.py [FIX] use format_date for date fields 2014-05-19 08:23:15 +02:00
ir_qweb.xml [IMP] ir_qweb: added country flag management in contact widget 2014-04-11 11:16:21 +02:00
ir_rule.py [IMP] cleanups, move tests, remove deprecated model instantiation 2014-05-01 20:42:17 +02:00
ir_rule_view.xml [IMP] ir_actions cleanups. 2013-10-06 12:24:04 +02:00
ir_sequence.py [IMP] Code -> Sequence Type 2013-08-23 11:56:35 +02:00
ir_sequence_view.xml [FIX]ir_sequence: only execute a change on postgresql sequence when really needed and add a field to get an approximation of the current next_number. 2013-05-17 14:43:28 +02:00
ir_translation.py [FIX] clear ir.ui.view cache on translation write/create 2014-01-22 16:13:27 +01:00
ir_translation_view.xml [MERGE] forward port of branch 7.0 up to revid 5224 chs@openerp.com-20140206105141-7e8bv8ordqqsswh7 2014-02-06 12:02:20 +01:00
ir_ui_menu.py [REM] shortcuts, deprecated by bookmarks 2013-10-06 15:24:24 +02:00
ir_ui_menu_view.xml [FIX] cleanup ir.xml mess, ir.ui.view name is now optional in xml files 2012-10-13 14:09:24 +02:00
ir_ui_view.py [ADD] hasclass() xpath function 2014-05-19 08:32:23 +02:00
ir_ui_view_view.xml [MERGE]with main branch 2014-05-05 15:23:33 +05:30
ir_values.py [FIX] ir.values: be tolerant to actions pointing to non existing actions (aka old wizards) 2014-02-13 12:09:37 +01:00
ir_values_view.xml [IMP]Improve Label 2013-11-21 16:13:58 +05:30
osv_memory_autovacuum.py [FIX]Autovacuum force true 2013-01-21 16:03:18 +01:00
osv_memory_autovacuum.xml [FIX] cleanup ir.xml mess, ir.ui.view name is now optional in xml files 2012-10-13 14:09:24 +02:00