The reified view on the res users will be dropped in the following commit.
The previous commit adds support to define each group as a computed field on the res users.
This commit defines:
- A boolean field for each 'isolated' res.group, i.e. a group in the hidden category.
- A selection field for each 'Application' res.group, i.e. a group in a application category.
Example:
- The group to manage pricelist in sales becomes a boolean field
- The groups project user/manager become a selection field
PURPOSE
=======
Ensure terms consistency across Odoo
Specification
=============
All the menus and fields labels which are related to product.category should be named "Product Category" (if field label) and "Product Categories" (if menu entry)
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.
In order to sort lunch order by date desc, the commit
9ab9da235f modified the
json structure (dict to array) of serialized 'previous_order'
field, without changing js code.
The previous order field should respect the new order, so
using OrderedDict does the job !
``import odoo.addons.foo as bar`` doesn't seem to properly trigger the
import hook in Python 3 (it blows up on decimal_precision and
base). Thus convert *all* examples of that pattern to the more
sensible ``from odoo.addons import foo as bar``.
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
Since 54245deebd, when you clicked twice
on the button "Confirm" on a slow connection, you could get an error as
values is not always defined.
This commit fixes the bad indentation level :)
The JS widget is simplified, which a cleaner approach.
For the rendering part:
- the server reads the data
- the JS widget formats/organizes the data
- the template renders the data prepared by the widget
Quick summary of the modifications:
1. The associated field is a text field which contains JSON-encoded
data. The data are read server-side, and not client-side anymore.
2. The widget is an AbstractField, no need of ReinitializeWidgetMixin
anymore. No use of the FieldMonetary widget directly, but use a similar
format_value instead (inspired by ShowPaymentLineWidget).
3. Data formatting (call to format_value) is done in the widget, not in
the template anymore. This seems to be the standard way of doing, since
lunch was the only module where format_value was in the template and not
in the widget.
4. The addition of an order line is cleaner since all necessary data
are prepared server-side.
* Since the user_id field is required, it was impossible to delete
user when he had 'lunch.order' or 'lunch.cashmove'.
We removed required arguments on 'user_id' fields in model and set
"required='1'" on the fields in the view.
* There was a 'ondelete="cascade"' on 'order_line_ids' which does
nothing because it's not supported on One2many fields.
In odoo at many places the filter items are having repeated strings eventhough the
fiter works differently , so find all the places where this happens and give
proper string to each filter..
When only a message argument is given to the crash manager, the popup display
"Error while validating constarint" and "None" with the warning message
which does not make any sense for the common user.
Purpose:
1/ In the lunch app, previous orders list: the products are not displayed.
It is written X Records but you don't see the products name. Therefore
the information is useless.
2/ It is dangerous to be able to delete a previous order that has been
received (it changes the lunch account amount)
What is done:
In Previous Orders list :
- The view should be based on the sales orders lines. In that case, each
line = 1 product.
- add a note column (between product and status)
- add a user column (between status and total)
- Rename Total into Price
- If order.line status = ordered or received, it shouldn't be possible
to delete it. An ir.rule has been added to achieve this.
- An additional group access right check is made in the actions 'confirm'
'cancel' and 'order' because they can be called in batch under the
Action button.
For some reason, the computed Many2many or One2many field is not
received through the onchange RPC call when creating a new order, but
only once the order is saved. This makes the widget displaying previous
orders kind of useless. We use this workaround with the default value
in order to be sure to send the value in the default_get call.
We also display previous orders and the agressive alerts in edit mode.
The awful code of a067129 didn't even work when
there really wasn't any cash move for a user for
which you didn't have the rights to read the moves.
Because there wasn't any move, there wasn't any
access error either.
We finally decided to hard-code the rule that
allows you to read the balance or not, which
renders it dependent of the actual access rules
of the system.
widget for displaying previous orders.
Detailed changes :
- previous order is not a computed field, with its own custom widget that has been designed
according the new spec for widgets;
- useless wizards have been removed, and replaced by some server actions that perform the
same action with less code and views;
- removed deprecated or incomplete reporting;
- some renaming to follow the new specifications of module coding