Commit Graph
32 Commits
Author SHA1 Message Date
Yannick Tivisse 77eb1f82d9 [REM] tools: Remove the yml import engine 2017-11-16 14:49:06 +01:00
Yannick Tivisse 1c178eb896 [IMP] convert.py: Extend accessible variables in '_tag_record'
Purpose
=======

Currently on <record> tags, it's impossible to use 'datetime' or 'obj' when using 'search' attribute on a field.

The following example won't work:
<record id="foo" model="model.model">
    <field name="bar_id" search="[('company.id', '=', obj([]).env.user.company_id.id)]"/>
</record>

Specification
=============

Use '_get_idref' to extend the accessible variables on the 'safe_eval' computation.
2017-11-07 14:15:13 +01:00
Andrew Latham b67e18bcb5 [IMP] tools: basic spelling and grammar corrections
Closes #20391
2017-10-25 09:22:52 +02:00
Xavier Morel 059710b2b0 [FIX] reading of HTML and XML view fields in P3
Reading them as bytes would not crash but could fill the corresponding
field with pretty much garbage. Turns out Html fields inherit from
Text and XML content generally goes into text fields, so handling
these items as text makes much more sense than as binary data.
2017-09-25 17:00:43 +02:00
rde 4ecbacaf59 [ADD] website: add new page management
website.page = old ir.ui.view with page=True
website.redirect is a new mechanism to replace in the futur the ir.attachment
mechanism of redirect.

From now, we don't have a specific /page controller to serve 'page'.

We use a new model website.page which is rendered if none route matches the url
 and that the field 'url' on website.page matches the request.httprequest.path.

The order to serve a path is:
    - Routes defines in controllers (/shop, /blog, ...)
    - ir.attachment with name matching the path
    - website.page with url matching the path
    - website.redirect with url_from matching the path
    - 404

To improve:
    - allow regexp in website.redirect model
    - allow to edit the view_arch from the page.management via redirect backend
      (needed when traceback in the page, or when modifying a js/css/less/...)
2017-09-15 15:29:37 +02:00
Raphael Collet 55549f1e61 [ADD] base: direct support for binding an action to a model 2017-08-28 09:53:23 +02:00
Xavier Morel 3b67fda251 [FIX] P3: file modes
In P3, files *must* be opened in binary mode when reading or writing
binary data, text mode (default) generates text and thus decodes on
the fly.
2017-08-20 23:25:54 +02:00
Xavier Morel a9d8d59833 [FIX] P3: error messages are text, dump XML docs as text 2017-08-20 23:25:54 +02:00
Xavier Morel 69c8528388 [FIX] P3: encoding & decoding mess while manipulating XML
* IrValues.value should be a binary field, since pickle encodes
  objects to bytes
* Which means the "action" string must be encoded before storage and
  decoded before use
* Remove complete garbage mess of random encodings during XML
  conversion, this probably still requires serious thinking and fixing
  but it seems to run for now (yay)
2017-08-20 23:25:54 +02:00
Xavier Morel be7c5aefdf [FIX] P3: CSV reading & writing 2017-08-20 23:25:54 +02:00
Xavier Morel 7dd062f835 [FIX] P3: text model types
* remove references to basestring & unicode (use relevant pycompat
  helpers)
* remove some str calls (either entirely or replaced by relevant
  helper, either text or native)
* use better API to avoid unnecessary conversions
* remove some XML declarations in views
2017-08-20 23:25:54 +02:00
Xavier Morel 3824b5dcc1 [FIX] P3: fix base64 and StringIO uses
* StringIO removed from stdlib, replace with io
* try to correctly handle BytesIO/StringIO (one is for bytes the other
  is for text)
* fix base64: Python 3 removed bytes-encoding and bytes-bytes
  codecs (via #encode) so replace all calls to str.encode('base64'),
  also b64encode is a bytes->bytes conversion so attempt to properly
  handle that

issue #8530
2017-08-20 23:25:54 +02:00
Jerther 3553c555e0 [IMP] tools: add filename in error message of bad schema
To easily identify the file responsible for the error

Closes #17622
Fixes #15869
2017-06-19 15:20:24 +02:00
Yannick Tivisse 83608995e1 [IMP] base: Add 'active' attribute on menuitem tag
This attribute will be used in the next commit to hide by default account menuitems in the account module to finally display them in the account_invoicing module.

Without this attribute, we should create the menuitems with the <menuitem> tag and after that make them inactive by using a <record> tag
2017-06-02 15:31:47 +02:00
Yannick Tivisse 7e008469e4 [IMP] base: Always load menuitem xmlids on templates
PURPOSE
=======

Currently we can choose to load the xmlid of a menuitem if web_tour is installed by setting the attribute `load_xmlid=True` on the view.

This is strange for 2 reasons:
- Searching all the ir.model.data on menuitems with load_xmlid=True to compute its xmlid, searching the related subtree on the returned structure of the method load_menus is quite complicated for the perfomance gain (if there is any perfomance gain to do it)
- This is not working in community in frontend, as only the root menuitems are loaded, thus it is the `load_menus_root` instead of the `load_menus` that is called. This issue prevent a tour step to be displayed correctly on community and enterprise on a menuitem.

SPECIFICATION
=============

Remove all the `load_xmlid` attributes and the related mechanism and move it into base to always load the xmlids for all the menuitems. It won't bee to heavy as the result is cached.

It's better the keep the current mechanism (Load the xmlids from ir.model.data and insert them into the tree) as we only make 1 search to the ir.model.data
2017-05-26 13:13:12 +02:00
xmo-odoo 7cffacb434 [FIX] missing import
Call would crash when you crash.
2017-05-15 16:09:45 +02:00
Xavier Morel 3dd3790597 [FIX] P3: raise exception with existing traceback
In Python 2, to raise a new exception but reuse a traceback requires a
special form of ``raise`` (``raise etype, evalue, tb``).

In Python 3, this is now done via a ``with_traceback`` method on
exception objects.

However this requires a bit of trickery as the former is invalid
syntax in Python 3, hence pycompat bridge created via an exec for
Python 2.
2017-05-12 16:15:39 +02:00
Thibault Delavallée 3a52e5e5c9 [IMP] import, report: allow print_report_name when defining a report
Otherwise you have to have another xml block just to define the print
report name instead of doing everything in the report tag.
2017-05-10 17:10:04 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Laurent Smet 3425752eac [REM] odoo/report: remove deprecated stuff
- RML Reports
- Webkit Reports (most part already removed by 13b9982c62)
- LocalService in netsvc.py
- rename attributes like rml_% to report_%
- rename ir.actions.report.xml to ir.actions.report
- allow rendering directly on an ir.actions.report by calling render method
- remove 'controller' report_type
- remove unused res.font stuff
- remove print_report method in models.py (not used)
- restore removed call to pdftotext process in test_reports
2017-05-08 09:22:56 +02:00
Christophe Simonis 9898b125ad [MERGE] forward port branch saas-15 up to c0e4ab8080 2017-05-05 17:23:23 +02:00
Christophe Simonis bac4d13d47 [MERGE] forward port branch 10.0 up to d5cdb77717 2017-05-05 16:19:28 +02:00
Nicolas Martinelli 514bdcb0f1 [FIX] tools: unnecessary error logging
The limit of 64 characters on the XMLID has been removed a long time
ago. This error is therefore not necessary anymore.
2017-05-04 16:48:31 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)

issue 8530
2017-04-27 13:59:33 +02:00
xmo-odoo 3cbca4b734 [FIX] iterator definition & stepping
* in P3, the iterator stepping method has become a dunder method (next
  -> __next__), the protocol has not changed, add a __next__ alias to
  the iterator-next definition (nota: ir.config also has a next method
  but it's not part of an iterator, so don't alias it and don't
  convert calls to it)
* since ~2.6, a builtin (next()) has been added to step an iterator &
  allow for a default (in case of iterator end), convert all manual
  stepping to the builtin

Fixers:
    libfuturize.fixes.fix_next_call

#8530
2017-04-25 13:04:54 +02:00
Xavier Morel 3979f6802e [#8530] convert exception handlers to except..as syntax
Futurize fixers:
* lib2to3.fixes.fix_except
2017-04-11 14:53:29 +02:00
Yannick Tivisse 98cb4719db [REM] workflow: Remove workflow engine, documentation and tests 2016-11-23 11:52:39 +01:00
Christophe Simonis 341bea8f88 [MERGE] forward port branch saas-12 up to 43cb4ac 2016-10-10 13:00:05 +02:00
Christophe Simonis f4fc3985b6 [MERGE] forward port branch saas-12 up to 10cde43 2016-09-16 11:03:50 +02:00
Raphael Collet 4a700d0ad9 [FIX] odoo: rename imports and adapt import hooks 2016-09-02 17:28:12 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00