Commit Graph
21 Commits
Author SHA1 Message Date
Denis Ledoux 3869b080ae [FIX] survey: preserve the multiple choices question answers order
When configuring a survey with a
Multiple choice: only one answer
question,

the answers shown in the result may be in the wrong order
because of the use of a simple `Dict` instead
of an `OrderedDict`.

The behavior was increased when using Python 3.5,
as it randomizes on purpose dictionnaries.

opw-1818797
2018-03-19 12:17:46 +01:00
Christophe Simonis d67b410dfc [MERGE] forward port branch saas-15 up to cb87388d72 2018-03-07 17:42:02 +01:00
Christophe Simonis ac89023155 [MERGE] forward port branch 10.0 up to 5e6bb745e8 2018-03-06 12:28:30 +01:00
Raphael Collet 36d6910269 [FIX] survey: constraint method on recordset 2018-03-06 11:23:29 +01:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Kinjal Mehta cd05983121 [IMP] survey: ease use of "Date" questions
- ask questions about "Dates", not "Datetimes" anymore
- display dates according to website language

Thanks to Kinjal Mehta and Ravi Gadhia who contributed to this commit.
2017-08-14 09:21:50 +02:00
Thibault Delavallée 014b5c9f7c [MOV] website, http_routing: move (un)slug support to http_routing
Slug and unslug API is now available in http_routing. Indeed there is no
link to any website or any reason to not support slufigied URLs when
website is not installed. A new unslug_url method is added as a tool
coming from an embedded method from website. Doing it allows to have all
slug related methods defined at the same point.

Support of slug and unslug in qweb rendering is also moved directly in
http_routing version of ir_ui_view instead of website inheritance. This
is done in order to keep things coherent.

Some code from website about ModelConverter is also moved. Indeed both
versions of ir_http uses some kind of placeholder to store the uid
when converting urls to python. This commit unifies it by using the
website one directly in base to simplify the override.

This commit also updates all module importing slug. Enterprise modules
will have to be updated, see related commit.
2017-08-08 14:23:58 +02:00
Xavier Morel 01e3514147 [FIX] P3: urllib, urllib2 and urlparse
In Python 3, all of these were "consolidated" under urllib(.request,
.parse, .errors) which is inconvenient.

Since we already have hard dependencies on requests and
werkzeug(.urls, which is a backport of Python 3's unicode-aware
urllib.parse) migrate *everything* to that.

A sticking point is urllib2.URLError, those were (mostly) replaced by
the slightly more general IOError which URLError extends.
2017-05-15 12:26:30 +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
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
Christophe Simonis cbdd0b20dc [MERGE] forward port branch 10.0 up to ffd4442b06 2017-02-10 13:17:02 +01:00
Goffin Simon 09237efa33 [FIX] survey: validate_multiple_choice with comments allowed
When validating a multiple choice with comments allowed,
the comment was popped from answer_candidates and then
the condition to prevent answers with blank value always
triggered an error.

opw:707072
2017-02-07 09:42:00 +01:00
Raphael Collet d0ca2d115e [REF] ir_config_parameter: remove group_ids and simplify
Add `sudo()` to call `get_param` where necessary, and make the web client use a
controller instead of directly accessing parameters.
2017-01-03 16:52:49 +01:00
Ravi Gadhia 44e2892809 [IMP] survey: add support of activities
survey.survey model now supports activities. Filters have been added to ease
their management.
2016-12-21 11:00:18 +01:00
Jérome Maes 13f84b9aca [REM] *: remove ir.needaction mixin
ir.needaction_mixin is not used anymore by the webclient.
From 9.0, the concept has changed: this feature is now
available in mail module, with the mail.thread mixin,
and message_neeadction field.

Remove all code handeling needaction bullet and
counter on ir.ui.menu, knowing that since 9.0
webclient does not display the counter anymore.

This code was, thus, useless and some RPC calls
were done for nothing, and adapt accounting
reconcialiation widget.
2016-12-05 11:30:03 +01:00
Raphael Collet fa082019a0 [IMP] models: change API of _group_by_full
The dictionary `_group_by_full` is replaced by a field parameter `group_expand`
that is assigned to the method name.  The API of the method has been simplified
as well:

    @api.multi
    def _read_group_stage_ids(self, domain, read_group_order=None, access_rights_uid=None):
        # the stages are given by self.ids (wrong model);
        # read_group_order is the order given to read_group() on self;
        # return stages.name_get(), {stage.id: stage.fold)

    _group_by_full = {'stage_id': _read_group_stage_ids}

is now written:

    stage_id = fields.Many2one(..., group_expand='_read_group_stage_ids')

    @api.model
    def _read_group_stage_ids(self, stages, domain, order):
        # stages is a recordset;
        # order is the order to use on stages' model;
        # return a recordset which is a superset of stages
2016-09-16 17:35:24 +02:00
Christophe Simonis 523d3af131 [MERGE] forward port branch saas-12 up to 16d65a8 2016-07-29 17:55:21 +02:00
Tanguy Charlier 09ea5c7d49 [IMP] survey: add gc of empty survey userinputs in the autovacuum cron 2016-07-15 12:57:51 +02:00
Ravi Gadhia 66cb880b74 [MIG] survey: migrate into new api 2016-07-15 12:57:51 +02:00
Tanguy Charlier 628c1d9564 [MOV] survey: module directory organization 2016-07-15 12:57:50 +02:00