* Move files and reorganize directories according to guidelines
* Lint and clean code, remove dead code
* Migrate code to the new API
In REF commit, some fields of calendar.event models changed. Due to
bad design, the code was not clean with the new API. Changing computed
fields make it more performant, and reduce code complexity.
See commit "[REF] calendar: change computed fields for start and
stop dates" for details.
Change `send_email_to_attendees` signature to force setting email
template and remove `email_from`, since it is not usefull.
Now, when sending email to attendee, meeting author will also received
an invitation.
`get_ics_file` has been modified to be executed in batch.
- `start` and `stop` fields are not computed anymore. Indeed, it was not normal
to have required stored computed field. Normally we shouldn't write on these
fields, but since client calendar api need them, we keep them as normal
datetime fields
- `start_date` and `stop_date` become stored computed date fields depending of
`start`,`stop` and `allday`. An inverse method allow to write on these fields,
since it can be the case from the form view
- `start_datetime` and `stop_datetime` follow the same logic
- `onchange_allday` code is mostly moved in `_inverse_dates` of new computed fields
- `_set_date` method (called in create/write) is now removed, since it does the same
thing as old onchanges
- `_onchange_duration` is kept to adapt `stop_datetime` when changing `start_datetime`
or `duration` on form view
- Duration is now 'zero' in database for allday meeting. Before, it was not changed.
Setting it to zero is less falsy. `duration` can not (yet) be a computed field since
it depends on others computed fields.
After migration, we manage to keep old behavior but the code was crap. Switching stored computed
fields make it cleaner, and respecting new API standarts.
This changes avoid multiple methods doing almost the same thing, and is less 'buggy'.
- move `get_ics_file` from calendar.attendee to calendar.event
- remove calendar.event arguments to convert method into
`api.multi`, which make more sense
- `create_attendees` now returns recordset instead of list of ids
- change signature of `get_interval` method
Migration of all python code, mostly withtout chagnes. And adapting
xml files to guidelines.
On calendar.py, some changes have been perform to make the migration works :
- `_compute` method has been split into `_compute_dates`, `_compute_attendee` and `_compute_display_time`.
- remove unused method `onchange_partner_ids`, `check_partners_email`
- make `compute_rule_string` use a cache record instead of a value
dict to avoid crashes
- remove `new_invitation_token` method, and make it a default value on attendee creation
- add a default value on `day` field, otherwise the "Please select a
proper day of the month" exception is raised during the onchange
This makes the kanban view for pack_operation_product_ids more
consistent with the one for the move lines and also adds the UOM for the
pack operation to the kanban card.
- Converted yml test cases to python unittest
- now, 'self.calendar' recordset from common.py will carry forward its context
so no need to pass context explicitely to the methods calling using that recordset.
- removed commented code
- used odoo.fields.Datetime to covert dates instead of python datetime library
90 percents of the file had to be migrated because of the methods
interval_remove_leaves and get_leave_intervals that were migrated in
the module resource
* Move files and reorganize directories according to guidelines
* Lint and clean code, remove dead code
* Migrate code to the new API
Applied to stock submodules: stock_account, stock_calendar,
stock_landed_costs.
The following modules were already in new API, but cleaned and reorganized:
stock_dropshipping, stock_picking_wave, sale_stock
Two fixes from saas-12 in yaml_import have been included in this branch
because originally developped when fixing issues related to the new API
migration.
* All methods are converted into an api.multi style (using ids instead of
a browse record or an id)
* Removed api.v7 methods for two methods defined in purchase and overriden
in stock_calendar, now used only in a true multi-style (old and new API)
* Moved methods having orderpoint as primary object on the orderpoint model
* Removed unused next_day field on resource.calendar model; it was
introduced with hacks of resource.calendar, and never used.
The whole override of resource models should be cleaned but will be done
after migration of resource and stock.calendar.