Commit Graph
17 Commits
Author SHA1 Message Date
Benjamin Stiens 6383120f3b [IMP] all: Improve error messages
Many error messages are misleading or too "vague"
This task aims to improve all error message.

Task #47042
PR #23321
2018-05-28 16:45:48 +02:00
Raphael Collet e724858d50 [REF] models: use parent_path to implement parent_store
This replaces the former modified preorder tree traversal (MPTT) with the
fields `parent_left`/`parent_right`.  Each record is associated to a string
`parent_path`, that represents the path from its root node to itself.  The path
is made of the node ids suffixed with a slash:

              a                 node | id | parent_path
             / \                  a  | 42 | 42/
           ...  b                 b  | 63 | 42/63/
               / \                c  | 84 | 42/63/84/
              c   d               d  | 85 | 42/63/85/

This field provides an efficient implementation for parent_of/child_of queries:
the nodes in the subtree of record are the ones where `parent_path` starts with
the `parent_path` of record.  It is also more efficient to maintain than the
MPTT fields, and less sensitive to concurrent updates, because the value of
`parent_path` does not depend on sibling nodes.
2018-02-28 10:33:44 +01:00
Kinjal Mehta 89c07862d5 [IMP] crm, project,...: Prevent stage deletion when there's a linked record
Purpose
=======

Avoid having people getting some tasks lost in the "undefined" column. Because they won't understand what it means an how they achieve it.

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

Add an "ondelete='restrict'" on the stage field definition.
2018-02-06 08:56:54 +01: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
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
Srushti Patel 1e9b6b4cb4 [MIG] website_forum_doc: migrated to new api 2016-04-08 13:54:07 +02:00
Srushti Patel b88060e5ba [MOV] website_forum_doc: split Documentation.py file 2016-04-08 13:54:06 +02:00
Thibault Delavallée 64b888669b [FIX] website_forum_doc: fixed last commit, wrong branch pushed (missing code review) 2014-09-03 11:47:47 +02:00
Thibault Delavallée 04d95c6a1a [FIX] website_forum_doc: default stage for post + removed unused import + added toc_id field in post tree view 2014-09-03 10:39:30 +02:00
Martin Trigaux f138aa2608 [FIX] models: display_name and name_get mismatch
- display_name uses name_get and not the other way around:
name_get should not call _compute_display_name, _compute_display_name should call name_get.
The previous behaviour was not backward-compatible with the old api.
All the models redefining name_get would have 2 different behaviors between name_get and display_name.

- Do not set an inverse function to display_name:
In most cases, writing on display_name writes on _rec_name (if any, not mandatory).
If the display_name computation is redefined, we need to redefine as well the inverse method to avoid unexpected behaviour
This required to also modify tests in base_import as readonly fields are avoided.

- Remove search method on display_name:
For the same reason as for the first point, it could be good that searching on display_name use name_search (and not the other way around).
However doing this would be very inefficiant (need to do the search, without limit, extract the ids of the name_get result just to generate
a subdomain ('id', 'in', [...]). As in most cases it would anyway mean to search on the _rec_name it's better to directly do so.

- Changing label to avoid mismatch:
In view displaying the list of fields or when a match is made on the label of a field (e.g. when importing csv file,
matching is made on both label and technical name), the fact that display_name field has '
Calling it 'Display Name' will avoid most errors.

- remove display_name definition from website_forum_doc,ir_model:
These fields are doing the same thing as the display_name of the new api, we can remove them.
We need to keep the one for res.partner as it's a stored field.
2014-07-25 13:58:59 +02:00
Fabien Pinckaers c1b9748947 [IMP] improved form view for posts
bzr revid: fp@tinyerp.com-20140421213850-19gk3hfz8qxa6fw3
2014-04-21 23:38:50 +02:00
Fabien Pinckaers 261204c98d [MERGE] new module: website_forum_doc + small fixes (close) in forum
bzr revid: fp@tinyerp.com-20140421205739-rki3bctinjy3amzy
2014-04-21 22:57:39 +02:00
Fabien Pinckaers 075115f39c [IMP] Documentation
bzr revid: fp@tinyerp.com-20140421204457-4t8lxibu2ml2tnad
2014-04-21 22:44:57 +02:00
Fabien Pinckaers c550fcb3d0 [FIX] Promote to doc flow
bzr revid: fp@tinyerp.com-20140421202350-n6uzooo9mvty07i7
2014-04-21 22:23:50 +02:00
Fabien Pinckaers cbf071a62c [IMP] better layout for documentation
bzr revid: fp@tinyerp.com-20140421144510-9qo1whru5u5ec721
2014-04-21 16:45:10 +02:00
Fabien Pinckaers 8a3c9a7c3c [FIX] misc fixes
bzr revid: fp@tinyerp.com-20140421085952-r64o9e09xgrw9wfq
2014-04-21 10:59:52 +02:00
Fabien Pinckaers 2d601a4194 [IMP] Some improvements in code
bzr revid: fp@tinyerp.com-20140421084749-uygi1h2vwpc1wk9x
2014-04-21 10:47:49 +02:00