Commit Graph

272 Commits

Author SHA1 Message Date
Antony Lesuisse 658ed76a84 [REM] preprocess of widget selection on m2o
As they are now directly supported by the webclient since commit
web 3863 nicolas.vanhoren@openerp.com-20131022131525-d0i61sbm0w6katfs

bzr revid: al@openerp.com-20140121112759-zavwqdyv8kdq4oys
2014-01-21 12:27:59 +01:00
Jojo le bricolo 6a4ea0f9a4 QWeb cleanups
bzr revid: jojo_le_bricolo-20140119174437-kjrr9p1smpdxhd3u
2014-01-19 18:44:37 +01:00
Christophe Matthieu bd444b8a5e [FIX] ir_ui_view: add method clear_cache called when user change user groups
bzr revid: chm@openerp.com-20140117143853-sy5ehfk9n2wrzq41
2014-01-17 15:38:53 +01:00
Christophe Matthieu 2f974012db [FIX] ir_ui_view: write noupdate on ir_model_data with SUPERUSER when the user write
bzr revid: chm@openerp.com-20140117134916-w59ive0yiqchp57m
2014-01-17 14:49:16 +01:00
Thibault Delavallée c76a3aba8f [CLEAN] ir_qweb: simplified and cleaned QWebcontext implementation
- now using openerp.tools.safe_eval, instead of a custom eval with custom builtins
- removed undefined_handler, hardcoded to a lambda function that returns None for
a missing attribute

tools.safe_eval: added a parameter locals_builtins. This allows to copy the builtins
in the locals. This hack is due to the fact that the locals always returns None, allowing
to simplify templates. Otherwise we would have to test the existence of each variable
before actually using it.
However as the locals always return None for every key, the globals are never checked.
Copying the builtins inside the local allows to have a complete locals, but sligtly
break the globals/locals separation.

To be reviewed and approved.

bzr revid: tde@openerp.com-20140116182750-1rnw8iljt5a9gb4u
2014-01-16 19:27:50 +01:00
Thibault Delavallée ab5c23079a [MERGE] Sync with trunk, solved conflicts.
bzr revid: tde@openerp.com-20140116091716-zk1n5ots94i65io5
2014-01-16 10:17:16 +01:00
Xavier Morel b741852c3d [IMP] correctly handle writing to a view without a model_data (e.g. test views)
bzr revid: xmo@openerp.com-20131218134932-382cvndk8asr82ip
2013-12-18 14:49:32 +01:00
Thibault Delavallée 56f18f56c5 [FIX] ir_ui_view: still usign context without being sure it exists
bzr revid: tde@openerp.com-20131218105511-fuf8ca99nimzbcpc
2013-12-18 11:55:11 +01:00
Fabien Meghazi f229af7b57 [IMP] Set ir.model.data noupdate flag to touched views
bzr revid: fme@openerp.com-20131217131439-b0rv83oeqat5rue8
2013-12-17 14:14:39 +01:00
Xavier Morel 0546993327 [FIX] merge from trunk and fix handling of view inheritance
main problem, view inheritance model field would use model from the
root view (after following inherit_id links) rather than the base view
(the requested one) -> with divergent models, it was possible for the
requested view itself to never be returned.

bzr revid: xmo@openerp.com-20131212134422-uxg6h21w1jhth9ow
2013-12-12 14:44:22 +01:00
Christophe Matthieu 1bf1f0de8f [FIX] forgotten fix for fields_view_get in orm.py (moved to ir_ui_view.py): [MERGE] forward port of branch saas-2 up to revid 4987 chs@openerp.com-20131127105828-ng8z4by1tszmj9d2
bzr revid: chm@openerp.com-20131202191411-edf01rvvpngyezok
2013-12-02 20:14:11 +01:00
Fabien Pinckaers e477c1f617 [FIX] temporary fix, should be cleaned by removing editable context
bzr revid: fp@tinyerp.com-20131201115142-mok8vlkua5f4tb5l
2013-12-01 12:51:42 +01:00
Fabien Pinckaers 4a3529afdf [IMP] Performance improvement: improved cache with context, better get_object
bzr revid: fp@tinyerp.com-20131130154723-05r90b2yhwwovpx4
2013-11-30 16:47:23 +01:00
Fabien Meghazi 071ef9702b [REV] Previous commit loses the inherit_branding context's key
bzr revid: fme@openerp.com-20131128094809-l77nyyqglzha3tuh
2013-11-28 10:48:09 +01:00
Fabien Pinckaers 2fef12e984 [IMP] cache on read_template, divide by 2 number of SQL queries on page loading
bzr revid: fp@tinyerp.com-20131127230024-cqhvjy9yg57cxunv
2013-11-28 00:00:24 +01:00
Fabien Pinckaers 0dbc41aca0 [IMP] access right when accessing object, not second checks in view rendering
bzr revid: fp@tinyerp.com-20131127223831-7r06xxuimrx21fzw
2013-11-27 23:38:31 +01:00
Fabien Meghazi 54b15928cf [FIX] ahem, fix previous commit
bzr revid: fme@openerp.com-20131121205959-jvlmcofp5yq5s7ht
2013-11-21 21:59:59 +01:00
Fabien Meghazi 9f43e80662 [IMP] rendering context not mandatory for ir.ui.view#render()
bzr revid: fme@openerp.com-20131121203230-uo485jls4uk15n7x
2013-11-21 21:32:30 +01:00
Xavier Morel 3389198f81 [IMP] remove unnecessary keys() calls
bzr revid: xmo@openerp.com-20131104125735-wtnngolx07755o1u
2013-11-04 13:57:35 +01:00
Xavier Morel 55c38976c0 [ADD] cr, uid, context to qweb.render & qweb rendering context
bzr revid: xmo@openerp.com-20131018144546-p693x1iur5gm98ez
2013-10-18 16:45:46 +02:00
Xavier Morel 8d6302f260 [IMP] use existing tools for the job
bzr revid: xmo@openerp.com-20131018141510-1x1w5ba5fqfzebfk
2013-10-18 16:15:10 +02:00
Xavier Morel 64ea89e3be [MERGE] from parent
bzr revid: xmo@openerp.com-20131014085215-qoqytud1mkpdqbz0
2013-10-14 10:52:15 +02:00
Christophe Matthieu 1a0b74d033 [IMP] ir_ui_view: improve security dev. Log a warning message if the browse record used in the views have a SUPERUSER access.
bzr revid: chm@openerp.com-20131008095805-8ek62kl4k0spw9b8
2013-10-08 11:58:05 +02:00
Xavier Morel d414f8c7cf [IMP] make view rendering engine kinda sorta pluggable
bzr revid: xmo@openerp.com-20131008082555-l8b2mu8ny8ouf5n5
2013-10-08 10:25:55 +02:00
Xavier Morel 0bce14ccd7 [MERGE] from trunk for tests fixes
bzr revid: xmo@openerp.com-20131007093527-gkem29e7agcmt0rd
2013-10-07 11:35:27 +02:00
Xavier Morel cd31b4af4d [IMP] move field conversion around
ir.fields architecture turns out not to be a very good or simple fit,
especially as different widgets/fields need different granularity of
customizations. Having objects dedicated to each field type/widget
makes things simpler as it allows a conversion pipeline which can be
plugged into at any point.

bzr revid: xmo@openerp.com-20131007091556-03azc2mdhcb7kmwo
2013-10-07 11:15:56 +02:00
Thibault Delavallée b94389dfca [FIX] ir_ui_view: MOVABLE_BRANDING back, was deleted by error when merging trunk
bzr revid: tde@openerp.com-20131007090206-f0y2vtv84113tbcd
2013-10-07 11:02:06 +02:00
Xavier Morel 856e3d0b91 [MERGE] from trunk
bzr revid: xmo@openerp.com-20131007085815-sfzb0lrhysxsdxzg
2013-10-07 10:58:15 +02:00
Thibault Delavallée b74c255168 [MERGE] Sync with trunk until revision 4967 (including al cleaning)
bzr revid: tde@openerp.com-20131007081039-adyay7oy1tpx4g2k
2013-10-07 10:10:39 +02:00
Antony Lesuisse 31a8dc36e5 [REM] shortcuts, deprecated by bookmarks
bzr revid: al@openerp.com-20131006132424-bpd8w0zzuf42s55l
2013-10-06 15:24:24 +02:00
Xavier Morel 40ab4f6e83 [MERGE] from trunk
bzr revid: xmo@openerp.com-20131004144724-pj6kd1ftw0sy0lbd
2013-10-04 16:47:24 +02:00
Xavier Morel 81a82ca37f [IMP] make qweb into an openerp object
also attempt to improve/simplify a few implementation details

bzr revid: xmo@openerp.com-20131004114155-j2639jx6dwvkz3hh
2013-10-04 13:41:55 +02:00
Thibault Delavallée 54933118a4 [MERGE] Sync with trunk until revision 4957.
bzr revid: tde@openerp.com-20131002133820-8xomdumexexqp3pk
2013-10-02 15:38:20 +02:00
Fabien Meghazi 9051c44d68 [ADD] oe-source-id in inherit branding
bzr revid: fme@openerp.com-20130925154155-v23u1l1go1spedzz
2013-09-25 17:41:55 +02:00
Fabien Meghazi e01f97e8f7 [MERGE] upstream
bzr revid: fme@openerp.com-20130925085305-wbmdcm75i6o1qm30
2013-09-25 10:53:05 +02:00
Thibault Delavallée 2939c58e72 [CLEAN] ir_ui_view: removed print statement
bzr revid: tde@openerp.com-20130923144830-i5iqzfc1pydm9pge
2013-09-23 16:48:30 +02:00
Thibault Delavallée e07531f451 [FIX] don't try to set attributes on comments, it makes no sense
bzr revid: tde@openerp.com-20130923143349-y922fxtbkotsjzpf
2013-09-23 16:33:49 +02:00
Fabien Meghazi 1fbe796ec3 [WIP] Temporary qweb translation
TODO: refactor of ir.ui.view in order to abstract translations

bzr revid: fme@openerp.com-20130923114649-0ykl77hclzmjmkq3
2013-09-23 13:46:49 +02:00
Xavier Morel 724bbffc88 [FIX] Partially revert xmo@openerp.com-20130812074509-yopeb4pxtsads4d9
Change attempted to simplify branding distribution, but based node
branding on final view. To be able to rewrite, node branding must be
based on source views positions before applying inheritance.

Reintroduce manual generation of xpath in distribute_branding as
ElementTree.getpath() can't handle it.

Note: why isn't branding distribution performed during initial views
reading (e.g. inherit_branding)? Surely that would obviate the need
for special casing and manually creating paths no?

bzr revid: xmo@openerp.com-20130919130847-3t8zfpv9m9pcibg0
2013-09-19 15:08:47 +02:00
Christophe Simonis ffdcf33673 [IMP] ir.ui.view: log traceback when validation of view arch fail
bzr revid: chs@openerp.com-20130919114508-72pv3u1stxw4l3ry
2013-09-19 13:45:08 +02:00
Christophe Simonis fd9a9577df [MERGE] forward port of branch saas-1 up to revid 4908 dle@openerp.com-20130918160049-fo88fl7uyhfoofkv
bzr revid: chs@openerp.com-20130918171816-cxxt3c9ktcq4a8oz
2013-09-18 19:18:16 +02:00
Xavier Morel 4b89b246a8 [FIX] distribute branding on t-if, t-for and t-att
bzr revid: xmo@openerp.com-20130917163708-u61ol5yqr3nrd9mu
2013-09-17 18:37:08 +02:00
Xavier Morel 47fac4836b [IMP] avoid using Element.attrib when unnecessary
bzr revid: xmo@openerp.com-20130917154505-4kf77rqjrg1bncvk
2013-09-17 17:45:05 +02:00
Xavier Morel 8159503eb1 [FIX] ensure we distribute branding only over actual element, not over e.g. comments
bzr revid: xmo@openerp.com-20130917154414-zdbv7861e9p6mdgi
2013-09-17 17:44:14 +02:00
Christophe Simonis 7081038378 [IMP] validate custom views at the end of update of database
bzr revid: chs@openerp.com-20130912182926-3lectt8mvd9smwfb
2013-09-12 20:29:26 +02:00
Christophe Simonis e13ffe7e11 [MERGE] forward port of branch 7.0 up to revid 5075 chs@openerp.com-20130912141018-qmcyase8zqov9d01
bzr revid: chs@openerp.com-20130906165207-1oklc8cqs0rex3kg
bzr revid: dle@openerp.com-20130909170248-a4t5y6qd5ikkhhac
bzr revid: dle@openerp.com-20130911083736-6jfkb140jxbbx7j6
bzr revid: chs@openerp.com-20130912150616-v0c383trj7gaa7eu
2013-09-12 17:06:16 +02:00
Xavier Morel cbb5bf3c56 [MERGE] from parent
bzr revid: xmo@openerp.com-20130912141037-xqu3qpcyjph4xltu
2013-09-12 16:10:37 +02:00
Christophe Simonis 1d91378ce2 [FIX] ir.ui.view: properly validate newly created inheriting views
When a new inheriting view is imported during a module
    installation, it is validated thanks to the _constraints
    on the ir.ui.view model. However the validation uses
    a rather convoluted system for validating the whole
    view tree at once (root view + all inherited changes)
    while only taking into account the views that belong
    to modules that are currently loaded.

    This complicated system is necessary to be able to
    operate on-the-fly at any point during the registry
    loading/initialization.

    Now because _constraints are checked during create()
    this particular validation happens *before* the
    external ID (ir.model.data entry) of that new view
    can be created (it obviously needs to wait until
    the view record is inserted). As a consequence the
    view validation cannot determine the module to
    which that new view belongs, and was erroneously
    ignoring it.
    Changing the view filtering to also include views
    that have triggered this check.
    Manually created views are not check during registry
    update.

bzr revid: chs@openerp.com-20130912141018-qmcyase8zqov9d01
2013-09-12 16:10:18 +02:00
Xavier Morel cc187b884b [IMP] re-enable XML check on view arch
bzr revid: xmo@openerp.com-20130912124334-skafqdt0hxna7frx
2013-09-12 14:43:34 +02:00
Xavier Morel bb14116785 [MERGE] from trunk
bzr revid: xmo@openerp.com-20130909095042-zf9p1qybf4f2b7gu
2013-09-09 11:50:42 +02:00
Xavier Morel a61e7b5efa [REM] view.save, move to website module where it belongs
bzr revid: xmo@openerp.com-20130906130905-86ul9efvjt6wo1j2
2013-09-06 15:09:05 +02:00
Xavier Morel 4f6af7f857 [REM] page attribute on views, doesn't belong in server
bzr revid: xmo@openerp.com-20130906091108-gk2biyqyi2xaekxl
2013-09-06 11:11:08 +02:00
Xavier Morel 3d42f63246 [IMP] remove unused imports
bzr revid: xmo@openerp.com-20130906091013-4smmete74hc9kpj1
2013-09-06 11:10:13 +02:00
Christophe Matthieu c36bfe173e [MERGE] from trunk
bzr revid: chm@openerp.com-20130828161130-641xsmbr8xm53xjx
2013-08-28 18:11:30 +02:00
Xavier Morel d8bf3892f3 [ADD] page attribute to views
This can be used to distinguish template views expected to be
available as web pages, and thus directly linkable. By opposition to
non-web views and template sections (reusables).

bzr revid: xmo@openerp.com-20130821121206-ebxsxrmyogcv7pnv
2013-08-21 14:12:06 +02:00
Christophe Simonis 208b697239 [MERGE] forward port of branch saas-1 up to revid 4899 chs@openerp.com-20130821094758-1ae0d1ml5obufzxv
bzr revid: odo@openerp.com-20130820160346-qcdy4kavgm5cb9t6
bzr revid: chs@openerp.com-20130821103139-zqqbrt8dq6iixrny
2013-08-21 12:31:39 +02:00
Olivier Dony fbd0758cb5 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 5054 rev-id: odo@openerp.com-20130820091157-e5brwlxuhujf8rrd
bzr revid: chs@openerp.com-20130724085026-525l9apggc9yzx0h
bzr revid: odo@openerp.com-20130730140644-1xih0as5jsks4pub
bzr revid: dle@openerp.com-20130801130723-khgwjkglgsdn34fj
bzr revid: odo@openerp.com-20130820091638-jpbcmh653bpa29em
2013-08-20 11:16:38 +02:00
Xavier Morel de952ae352 [FIX] don't extract the root ir.ui.view as an embedded field
bzr revid: xmo@openerp.com-20130812121121-e3ch0b2u5j1u3ytp
2013-08-12 14:11:21 +02:00
Xavier Morel 212f088aea [MERGE] from trunk-website-al
bzr revid: xmo@openerp.com-20130812075650-sv5v98kuuifaog2z
2013-08-12 09:56:50 +02:00
Xavier Morel db5e36efa3 [FIX] rewrite ir_ui_view.save with new semantics, xpath fixes
since lxml provides built-in tools to generate the path for a node in a tree, don't reimplement it manually

bzr revid: xmo@openerp.com-20130812074509-yopeb4pxtsads4d9
2013-08-12 09:45:09 +02:00
Fabien Pinckaers 0c768d8703 [IMP] Added one2many symetry
bzr revid: fp@tinyerp.com-20130811102831-x5jvza7oi69ck2sx
2013-08-11 12:28:31 +02:00
Fabien Pinckaers 14e555d920 [IMP] support for inherit_option_id, <template> for inherited views
bzr revid: fp@tinyerp.com-20130810132449-tckikyrtqcawnzor
2013-08-10 15:24:49 +02:00
Fabien Meghazi a467b2d0ef [IMP] Qweb, use undefined handler
bzr revid: fme@openerp.com-20130808182218-3a9vb97gx49alyzz
2013-08-08 20:22:18 +02:00
Fabien Pinckaers b8f5817c8b [IMP] branding distribution in views
bzr revid: fp@openerp.com-20130804205215-0g8fvzy8aducrc3v
2013-08-04 22:52:15 +02:00
Xavier Morel bfd97c110f [FIX] typo in attribute name, don't distribute on t-field
bzr revid: xmo@openerp.com-20130802114606-ef0pddt2uhc4ghlj
2013-08-02 13:46:06 +02:00
Xavier Morel 4cc13f0625 [IMP] branding distribution
* don't serialize subtrees to string all the time
* don't add XML root and prefix by string munging
* extract trigger and moved branding attributes to constants
* reduce unnecessary nesting
* don't brand sub-elements of head

bzr revid: xmo@openerp.com-20130802104208-rirrsgtxp2lydd7m
2013-08-02 12:42:08 +02:00
Fabien Pinckaers 402907df8d [FIX] removed print statement that crashes on runbot ascii
bzr revid: fp@openerp.com-20130731191544-nbyrlxz2xzycammn
2013-07-31 21:15:44 +02:00
Fabien Meghazi 390c968e17 [FIX] fix t-ignore
bzr revid: fme@openerp.com-20130731150422-p48vmtulerqqa4b9
2013-07-31 17:04:22 +02:00
Fabien Meghazi a17606df0f [ADD] t-ignore branding opt-out
bzr revid: fme@openerp.com-20130731123603-y7dmh6rxr2lq9bcw
2013-07-31 14:36:03 +02:00
Fabien Meghazi 81ec0dbc1e [REM] Removed arch_file from ir.ui.view
bzr revid: fme@openerp.com-20130718170314-f6g6topynizgnwl6
2013-07-18 19:03:14 +02:00
Fabien Pinckaers 726b333148 [FIX] copy() on ir.ui.view
bzr revid: fp@tinyerp.com-20130702190301-oh7kj8iatbij3bm1
2013-07-02 21:03:01 +02:00
Christophe Simonis 0a5b3c9fd7 [FIX] views: correct distribute branding
bzr revid: chs@openerp.com-20130702181439-4ghn4ciz5efmzumk
2013-07-02 20:14:39 +02:00
Christophe Simonis 906da9b7ef [FIX] views: correct distribute branding
bzr revid: chs@openerp.com-20130702173648-96mxveli0eh1hzcj
2013-07-02 19:36:48 +02:00
Christophe Simonis 25388630cc [FIX] views: distribute branding only if not t-* attributes
bzr revid: chs@openerp.com-20130702164157-nsfq9xpswj0r56ry
2013-07-02 18:41:57 +02:00
Antony Lesuisse 2bac4d24c4 distribute branding take care of call and t
bzr revid: al@openerp.com-20130702160750-0yv4g6bcnh4v80rp
2013-07-02 18:07:50 +02:00
Antony Lesuisse d346320699 distribute branding for fields
bzr revid: al@openerp.com-20130702154446-7fpel212amdwmmjz
2013-07-02 17:44:46 +02:00
Antony Lesuisse 8f25c9bdae be xml in the db
bzr revid: al@openerp.com-20130702145605-nkzjall1msp6ggsa
2013-07-02 16:56:05 +02:00
Martin Trigaux 641c4fe784 ir_ui_view: parse using lxml.html instead of etree
bzr revid: mat@openerp.com-20130702125916-ahk6jkim08j2voam
2013-07-02 14:59:16 +02:00
Fabien Meghazi 1e303767ee m
bzr revid: fme@openerp.com-20130702124313-cuehsln93w7mzhqx
2013-07-02 14:43:13 +02:00
Martin Trigaux e372cbbce4 add t-field and t-record in rendering
bzr revid: mat@openerp.com-20130701155541-20plkar9a89qosij
2013-07-01 17:55:41 +02:00
Vo Minh Thu 7786d96095 [FIX] ir_ui_view: restore the inheritance mechanism for model-specific inheritance:
A view for a given model can inherit from a root view specified for
another model. When applying the modifying views to the root view,
only the views with the same model as the child view must be
considered. This patch restore that behavior.

bzr revid: vmt@openerp.com-20130701145334-ojp1plqjveym7cj7
2013-07-01 16:53:34 +02:00
Martin Trigaux a7b0a0379c add save method for javascript call
bzr revid: mat@openerp.com-20130701135313-absej6vq16aztrc8
2013-07-01 15:53:13 +02:00
Martin Trigaux b4e6c6e22d add count for inherit_branding
bzr revid: mat@openerp.com-20130701112309-hf3rarslfc2hhvr4
2013-07-01 13:23:09 +02:00
Antony Lesuisse df01c096ec branding temp fix for comment in xml
main company demo data

bzr revid: al@openerp.com-20130701002424-ojr6yzlr9m0xv6vi
2013-07-01 02:24:24 +02:00
Antony Lesuisse 05c9b607f8 fix rng validation, fields_view_get, qweb t-esc t-raw default
bzr revid: al@openerp.com-20130630213515-go5qr2dmo0xlazvr
2013-06-30 23:35:15 +02:00
Antony Lesuisse 54a41790a0 distribute branding xpath count
bzr revid: al@openerp.com-20130630015800-gln7j46ume1h536k
2013-06-30 03:58:00 +02:00
Antony Lesuisse 0963443691 correct distribution of branded tags
bzr revid: al@openerp.com-20130630010941-t922sz1smwi6jnni
2013-06-30 03:09:41 +02:00
Antony Lesuisse 4aa13cf591 correct inheritance branding
bzr revid: al@openerp.com-20130629234158-ttav8rypjrkxvctf
2013-06-30 01:41:58 +02:00
Antony Lesuisse 932efea388 untangle inheritance and postprocessing
bzr revid: al@openerp.com-20130629213516-pqcl6oz1g3o5tpgn
2013-06-29 23:35:16 +02:00
Martin Trigaux ad9f8a9fa1 [ADD] ir_ui_view: add tags to tree
bzr revid: mat@openerp.com-20130627171027-j3t7l8dadm8cohvx
2013-06-27 19:10:27 +02:00
Christophe Simonis d84c90b41d [FIX] views: correct type detection
bzr revid: chs@openerp.com-20130627153758-1yhk7d79is5c707r
2013-06-27 17:37:58 +02:00
Christophe Simonis 0ed83c3cec [FIX] view creation
bzr revid: chs@openerp.com-20130627143639-nxurinzeqqjqdiam
2013-06-27 16:36:39 +02:00
Christophe Simonis 4efebc6fd0 [FIX] ir.ui.view:render() can render view by xmlid/path
bzr revid: chs@openerp.com-20130627142506-gdmre0jj36v5inc0
2013-06-27 16:25:06 +02:00
Antony Lesuisse 01c08e2ebc type is regular field
bzr revid: al@openerp.com-20130627131629-1au7xtdv2fdxtko0
2013-06-27 15:16:29 +02:00
Antony Lesuisse a93bc8bdb0 qweb templates
bzr revid: al@openerp.com-20130627091329-t3hjytf3gt0dmkvo
2013-06-27 11:13:29 +02:00
Antony Lesuisse ca163b58db fix check_xml, disable wrong tests
bzr revid: al@openerp.com-20130624160910-zp898ew6va3lergk
2013-06-24 18:09:10 +02:00
Antony Lesuisse 9a8ff60da0 file based openerp views
bzr revid: al@openerp.com-20130620221648-kj53t7vdopfab0c2
2013-06-21 00:16:48 +02:00
Antony Lesuisse ab8e0f89b4 use read_combined instead of fields_view_get to check inherited views
bzr revid: al@openerp.com-20130620154617-uiceguvzjtu3ab87
2013-06-20 17:46:17 +02:00
Antony Lesuisse 4f76c69b76 [MERGE] trunk
bzr revid: al@openerp.com-20130620151512-p5ysov21an6ogbtv
2013-06-20 17:15:12 +02:00
Olivier Dony eae2321cd2 [FIX] ir.ui.view: properly validate newly created inheriting views
When a new inheriting view is imported during a module
  installation, it is validated thanks to the _constraints
  on the ir.ui.view model. However the validation uses
  a rather convoluted system for validating the whole
  view tree at once (root view + all inherited changes)
  while only taking into account the views that belong
  to modules that are currently loaded.
  
  This complicated system is necessary to be able to
  operate on-the-fly at any point during the registry
  loading/initialization.
  
  Now because _constraints are checked during create()
  this particular validation happens *before* the
  external ID (ir.model.data entry) of that new view
  can be created (it obviously needs to wait until
  the view record is inserted). As a consequence the
  view validation cannot determine the module to
  which that new view belongs, and was erroneously
  ignoring it.
  Changing the view filtering to also include views
  from unknown modules fixes this transient problem,
  and also means that manually created inherited
  views will be validated during module init too.

bzr revid: odo@openerp.com-20130703215704-x732bepiifvf4g3n
2013-07-03 23:57:04 +02:00
Vo Minh Thu 8d0a477644 [IMP] ir_ui_view: do not use _logger.exception() (because there is no exception), add a check on `model`.
bzr revid: vmt@openerp.com-20130605121143-u2nkmcmeifphr54h
2013-06-05 14:11:43 +02:00
Vo Minh Thu 1ed9049041 [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20130605120443-wgt24723597pak4b
2013-06-05 14:04:43 +02:00
Xavier Morel 282a7180ca [IMP] remove SQL definition of ir.ui.view, schema alterations
* Formally make model not required
* Remove idiotic default values on type and arch
* Make type not required (it's a function field!)

bzr revid: xmo@openerp.com-20130426145113-cf0t0xx24lk9mtgs
2013-04-26 16:51:13 +02:00
Xavier Morel 9d06d98735 [FIX] read_combined and get_inheriting_views_arch when no model provided
* view['model'] required for base_model_name handling, force its read
  as with arch (nb: arch could actually be made optional, if it's not
  being read can skip most of the inheritance complexity no?)

* if model=None in get_inheriting_views_arch, it generates domain to
  SQL `model is NULL`, except model required on ir.ui.view so unspec'd
  models are `''` (the empty string) not NULL => inherited views never
  found.

  Righter move might be to formally make model non-required on view.

bzr revid: xmo@openerp.com-20130426090237-u3rojvx4gow6uue1
2013-04-26 11:02:37 +02:00
Xavier Morel e30b6edb41 [ADD] model-less fields & views munging thing
bzr revid: xmo@openerp.com-20130425093739-v0kya956yzcy5wp3
2013-04-25 11:37:39 +02:00
Xavier Morel c08513763c [NOTSURE] move __view_look_dom_arch into ir.ui.view
Also alter BaseModel._view_look_dom_arch to proxy to method above.

bzr revid: xmo@openerp.com-20130424135825-grjfgbjuc4ozzdqy
2013-04-24 15:58:25 +02:00
Xavier Morel fb492d98ba [ADD] behavior and tests for default & ancestors, fallback handling in read_combined
bzr revid: xmo@openerp.com-20130424130907-6d6lkrkrgqv0hsfq
2013-04-24 15:09:07 +02:00
Xavier Morel 8715746672 [IMP] move stuff around, try building flatter top-down API with read_combined as utility 'do all the things' hook
bzr revid: xmo@openerp.com-20130424095114-4nw0nfuxzx4n1ltv
2013-04-24 11:51:14 +02:00
Christophe Simonis 261dea6fec [MERGE] forward port of server v7 up to revision 4954
bzr revid: qdp-launchpad@openerp.com-20130422093655-txqmbalod6qmw1s6
bzr revid: chs@openerp.com-20130423183723-9kiexdyzdew8iuzm
2013-04-23 20:37:23 +02:00
Xavier Morel dfc1800305 [MERGE] from trunk to match addons
bzr revid: xmo@openerp.com-20130423155233-c7tyowoqsfzzdjv8
2013-04-23 17:52:33 +02:00
Xavier Morel d40ec67c2d [IMP] move application of view inheritance outside of fields_view_get and into View.
change get_root_ancestor to return just the id of the ancestor view

bzr revid: xmo@openerp.com-20130423150844-eubxue9vbtc6jhof
2013-04-23 17:08:44 +02:00
Xavier Morel 8914886040 [IMP] simplify ir.ui.view.get_root_ancestor by using browse records
Also only case which should result in the id not existing is the
initial record, if a view_id is explicitly provided. So the loop can
avoid it's, it's traversing through an m2o so if the m2o value is not
null the next record in the chain should always exist.

bzr revid: xmo@openerp.com-20130423135739-jve1fe2it8q4gkwh
2013-04-23 15:57:39 +02:00
Xavier Morel 0676c84be5 [IMP] move view_id initialization out of loop, make flow simpler
bzr revid: xmo@openerp.com-20130423133640-lci2djdj45ztdtu8
2013-04-23 15:36:40 +02:00
Xavier Morel aef4ce51a7 [IMP] move fetching of root view into ir.ui.view
bzr revid: xmo@openerp.com-20130423124657-zkogrodgdw0ymf2f
2013-04-23 14:46:57 +02:00
Xavier Morel e996f92e6c [REF] move apply_inheritance_specs to ir.ui.view
also moved raise_view_error utility function

bzr revid: xmo@openerp.com-20130423105856-558rl6ankd4g3qb0
2013-04-23 12:58:56 +02:00
Xavier Morel edf1f23a6e [ADD] depth-first iterator on views, refactor apply_view_inheritance to use it
bzr revid: xmo@openerp.com-20130422125000-pg60ovrxejegenka
2013-04-22 14:50:00 +02:00
Xavier Morel cdc8110363 Temporarily disable XML validity check (calls fields_view_get, PITA)
bzr revid: xmo@openerp.com-20130422122739-gx72s6lxna0nk5ug
2013-04-22 14:27:39 +02:00
Xavier Morel 9683224830 [IMP] Element.getiterator -> Element.iter
> Note that this method is deprecated as of ElementTree 1.3 and lxml
> 2.0. It returns an iterator in lxml, which diverges from the
> original ElementTree behaviour. If you want an efficient iterator,
> use the element.iter() method instead. You should only use this
> method in new code if you require backwards compatibility with older
> versions of lxml or ElementTree.

bzr revid: xmo@openerp.com-20130422091958-413qo439qqgv296u
2013-04-22 11:19:58 +02:00
Xavier Morel c9a6e74bf4 [IMP] add tests for locate_node
bzr revid: xmo@openerp.com-20130422091014-qbd4jun4n9u4402x
2013-04-22 11:10:14 +02:00
Xavier Morel aa9406e28b [IMP] move locate inner function to ir.ui.view method
bzr revid: xmo@openerp.com-20130419141409-a2jqq5maszc53e6s
2013-04-19 16:14:09 +02:00
Xavier Morel 6a8d05b77e [IMP] move raw SQL to ORM
Improves maintainability, required adding a fake-ish o2m field to
ir.model.data to handle join.

bzr revid: xmo@openerp.com-20130419123712-6r6q1e8h93wly66y
2013-04-19 14:37:12 +02:00
Xavier Morel 5fd1e56566 [FIX] incorrect view in super() call
super() finds the MRO parent of the provided class to resume the
execution chain from there, so the class being defined should be
provided.

Here view called super(osv.osv, self).create so if osv.osv (Model) had
a create() defined (which luckily it does not) it would've been
skipped.

bzr revid: xmo@openerp.com-20130415105744-cfx47t01oc7loyes
2013-04-15 12:57:44 +02:00
Raphael Collet 05851d21ba [MERGE] from trunk
bzr revid: rco@openerp.com-20130411073017-x6e4h8xbvmy3ofdw
2013-04-11 09:30:17 +02:00
Raphael Collet 09be864f1d [IMP] replace all tests like 'registry.get(X)' by 'X in registry' where X is non static
bzr revid: rco@openerp.com-20130329140723-dnrl02saky570xg0
2013-03-29 15:07:23 +01:00
Quentin (OpenERP) 72efeaa44f [FIX] base, ir.ui.view: added a default value for 'type' field as it's a required functional field without fnct_inv (thus not possible to enter a value). This is needed in order to let people create their views manually via the menuitem
bzr revid: qdp-launchpad@openerp.com-20130327160258-jev32y4t99vj6b5s
2013-03-27 17:02:58 +01:00
Cecile Tonglet ad8b76de53 [MERGE] From trunk (second time)
bzr revid: cto@openerp.com-20121217144753-1rboqdw01h8yrehj
2012-12-17 15:47:53 +01:00
Xavier Morel 5d3d3868f6 [IMP] use augmented assignments
bzr revid: xmo@openerp.com-20121214131924-bpl48ht21ic4g34b
2012-12-14 14:19:24 +01:00
Vo Minh Thu 509a084e79 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121210152723-mv4dykfu6ip1991h
2012-12-10 16:27:23 +01:00
Nhomar Hernandez 73297439ff [FIX] Improved message when you define a view with an incorrect name in developing time
lp bug: https://launchpad.net/bugs/1077794 fixed

bzr revid: nhomar@gmail.com-20121112051205-a8uxa76xbwsn6jen
2012-11-12 00:42:05 -04:30
Xavier Morel 5bd939f0ac [REM] useless intermediate lambdas in default values
bzr revid: xmo@openerp.com-20121102094705-6vcutz0bv4dc0jkl
2012-11-02 10:47:05 +01:00
Antony Lesuisse 8fa8551f01 [FIX] cleanup ir.xml mess, ir.ui.view name is now optional in xml files
bzr revid: al@openerp.com-20121013120924-xix9cbozm8kda7rj
2012-10-13 14:09:24 +02:00
Olivier Dony 470415ced9 [IMP] ir.ui.view: discard custom views before updating view arch
- as the custom views are still in place when validating the new arch, they would
hide the new arch and prevent proper validation (if custom views are set for uid 1)
- conversely, if the RNG validation has changed, the old view customizations may not
pass the updated validation rules, and cause spurious validation errors

bzr revid: odo@openerp.com-20120924104026-z7bjzzq80ifxy1oc
2012-09-24 12:40:26 +02:00
Raphael Collet 3b2423c5da [IMP] ir.ui.view: filter inheriting views based on groups
bzr revid: rco@openerp.com-20120829133732-ijyy3y05mlbazgya
2012-08-29 15:37:32 +02:00
Raphael Collet 750165e94d [MERGE] trunk-ir_ui_view_access_rights-mdi (add field groups_id on views)
bzr revid: rco@openerp.com-20120829123539-5m718m71c8o06ujz
2012-08-29 14:35:39 +02:00
Divyesh Makwana (Open ERP) 004a1a64ee [ADD] Added 'groups_id' field into 'ir_ui_view' model.
bzr revid: mdi@tinyerp.com-20120829055333-6iw12tthxeidkkus
2012-08-29 11:23:33 +05:30
Vo Minh Thu 1534feb8f7 [IMP] ir_ui_view: somewhat better `type` functional field implementation.
bzr revid: vmt@openerp.com-20120814100049-dngykdg5l21q9vvp
2012-08-14 12:00:49 +02:00
Jigar Amin - OpenERP 803e74458e [FIX] Setting the view type of parent when you have inherited view
bzr revid: jam@tinyerp.com-20120808091002-0k8dm05pd4x8qf6l
2012-08-08 14:40:02 +05:30
Vo Minh Thu 2666ab3fe0 [IMP] ir.ui.view: Added assertion-based checks.
bzr revid: vmt@openerp.com-20120622131004-stn7tf68xph3f278
2012-06-22 15:10:04 +02:00
Vo Minh Thu ebf1383785 ir.ui.view: type field can be a functional field.
bzr revid: vmt@openerp.com-20120619101425-u73r47zdhsg7ecma
2012-06-19 12:14:25 +02:00
Olivier Dony 3a81cf88f8 [IMP] Improve view validation to based on fields_view_get rendering, not just raw arch
This will allow improved validation of inherited
views, which is not possible when only the raw
arch is validated on its own - without context 
many things cannot be verified.
Calling fields_view_get() also catches early all
mistakes that require dynamic validation, like
wrong XPath expressions (parent view contains
no match).
In order to have current addons pass the improved
validation the RNG had to be fixed to support
the new @modifiers attribute added by fields_view_get()
itself on many view elements, and a few missing
valid attributes, like @invisible on <filter>
and <group>. The latter had never been used
as part of the view architecture but appear
as a result of the handling of @groups
restrictions on view elements, and must
be allowed by the RNG schema.

bzr revid: odo@openerp.com-20120614144633-31c642s7q7f28o6b
2012-06-14 16:46:33 +02:00
Fabien Pinckaers f1716c0e35 [IMP] improved comment TODO
bzr revid: fp@tinyerp.com-20120612171459-74dh9ik7yju2mum5
2012-06-12 19:14:59 +02:00
Olivier Dony 2126f83a35 [IMP] modules, ir.ui.view: improve view validation + avoid validation errors during updates
As of 7.0, RNG validation is not possible for form views
that have a version attribute equal to "7.0", due to the
allowed usage of HTML syntax mixed with the regular OpenERP
view syntax. RNG validation is still enabled for regular
form views (@version missing or less than "7.0"), and for
all other views types.
Validation of 7.0 form views should be improved with the
addition of an assertion-based schema, still to be done.
 
The above is also complemented with an explicit call to fields_view_get()
during view installation, in order to immediately verify
that the updated view hierarchy does not cause any
issue when loaded along with its related views (i.e
parent and siblings, for inheriting views).
In addition to that, fields_view_get() will now only
consider loading views that belong to modules that have
already been loaded. This avoids a lot of validation errors
during a module update operation, which runs on top of
an existing database with all previous views visible,
even those whose module is not loaded yet.

bzr revid: odo@openerp.com-20120611122758-qcw9xdhupl24busq
2012-06-11 14:27:58 +02:00
Fabien Pinckaers 84fe3e7ba6 temporarily removing checks
bzr revid: fp@tinyerp.com-20120611091031-sfear1x3c574tvpw
2012-06-11 11:10:31 +02:00
Fabien Pinckaers fc3873e131 [IMP] views
bzr revid: fp@tinyerp.com-20120611090248-oechaas8kntaqzqf
2012-06-11 11:02:48 +02:00
Fabien Pinckaers 9901961a2f fix
bzr revid: fp@tinyerp.com-20120610120614-oe3plgxr1364um0q
2012-06-10 14:06:14 +02:00
Fabien Pinckaers 7d89afe7bc fix
bzr revid: fp@tinyerp.com-20120610104338-spr8hfo74z2vy0nj
2012-06-10 12:43:38 +02:00
Vo Minh Thu d2252dba05 [IMP] rng validation: remove call to rng validation, replace it with calls to fields_view_get.
bzr revid: vmt@openerp.com-20120604160124-uz4q4aim6sl9wckm
2012-06-04 18:01:24 +02:00
Antony Lesuisse 927cd1aaa8 [MERGE] trunk-form-v2, rng validation can _optionally_ be disabled, new view for partners
bzr revid: al@openerp.com-20120417091619-ohuvnu0javler9pm
2012-04-17 11:16:19 +02:00
niv-openerp f5cad0242d [imp] desactivated rng check for views
bzr revid: nicolas.vanhoren@openerp.com-20120327092345-06bhhik1suy3td6p
2012-03-27 11:23:45 +02:00
Olivier Dony 79ac080fb2 [MERGE] Minor bugfixes (missing imports, etc.) courtesy of Florent Xicluna
bzr revid: odo@openerp.com-20120214150022-yx6zi0j4fr2d48uc
2012-02-14 16:00:22 +01:00