Commit Graph

78 Commits

Author SHA1 Message Date
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
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