This dashboard has implied some refactoring:
- the wizard pos_session_opening has been deleted and all the methods have been put inside pos_config
- new fields in pos_config to display some useful informations (closing balance, closing date, etc.)
Removed a code that allows to write a message, using a subtype that
does not exist. This is probably critical for some business, but
as I don't know which ones, let's remove it.
Chatter is sufficient.
Make the function traverse the class hierarchy upwards, retrieve the value of
the attribute, and stop when the value does not satisfy the given condition.
Optimize registry.setup_models() such that some fields can be reused between registries. This happens when a model has the same base classes as another model.
This reduces the registry setup time.
On the runbot, this reduces the total execution time by ~20%.
When a model is set up, it can retrieve fields from a similar model (with the
same base classes). Only proper (not inherited), regular (non-related) fields
can be shared that way, since other fields may depend on other models.
Avoid this reference from a field to a model class; this will allow the sharing
of fields across model classes. Use `getattr` on class instances instead.
Split the methods `_setup_regular` and `_setup_related` in `base` and `full`
parts, such that the `base` part is done in `setup_base()`, and the `full` part
is done in `setup_full()`.
This optimizes the setup of models during the installation of modules: regular
fields are not set up again from scratch. Only related fields (which are less
common) are always set up from scratch.
The method uses the costly `inspect.getmembers` to retrieve the fields defined
on a model's classes. If the model is not modified by a module installation,
we simply reuse the fields retrieved in a former model setup.
The API of those method has been modified to take a recordset instead of a class
as parameter:
field.set_class_name(cls, name) -> field.setup_base(model, name)
field.setup(env) -> field.setup_full(model)
The recordset gives access to an environment, and will ease code reorganization
in the field's setup methods.
Converting the following class methods to model methods will make them more
flexible for changes, in particular by making the environment available:
- `_add_field`
- `_pop_field`
- `_add_magic_fields`
- `_init_manual_fields` (renamed to `_add_manual_fields`)
- `_inherits_check`
- `_init_inherited_fields` (renamed to `_add_inherited_fields`)
Make an explicit distinction between both semantics of `_attrs`:
- the parameters given to `__init__` in `args`
- the non-slot attributes (memory optimization) in `_attrs`
Making a distinction between the column from which the field was created, and
the one created from the field, allows to keep the second one from a registry
setup to the next one. This opens a door for optimizations: the column may not
need to be recomputed.
- Add nocontent tip in kanban view of project documents and remove create button.
- Hide a lot of noisy fields from attachment form view in technical group.
Former implementation used ir_values to retrieve the dashboard action id from
its menu id. Using ir_values to do that doesn't work anymore since the
cleaning up of rev. e7e452f.
We now retrieve the action id from its xmlid directly in the controller.
The start field is a computed field but it doesn't have any inverse function
(write() is overridden in calendar.event to, among other things, play the
role of the missing inverse function). It is thus automatically set as
readonly, and the events can't be dragged and dropped in the calendar view,
since rev. d6d3d098 in which we start checking if the start_date is readonly
or not before allowing the drag and drop.
This rev. simply adds a "do_nothing" inverse function so that the date field
is not readonly.
In web_calendar, the date_start attribute is mandatory so fallbacking on
date_end and date_delay is unnecessary.
- correctly compute the invoice and its lines, in order to trigger the
computation of the membership_state on the partner
- correctly compute, using a true multi returning correct values, the
various dates of membership
- use the sequence of function field to ensure that the dates and state
are computed in the correct order; otherwise some states are not
reachable
- various fixes in the computation
tests crash and that there is a mismatch between the tests and
the module. However as the tests were badly written the asserts
did not fire.
Now the tests crash as they should be doing since a long time.
[CLEAN] membership: dead code / tests cleaning
Removed dead code, unnecessary comments in membership.py. Also added the
use of server datetime format instead of custom one.
Also slightly cleaned the tests. No change, but use data created for the
tests instead of relying on existing demo data, probably modified by
the user and difficult to track.