Commit Graph
107999 Commits
Author SHA1 Message Date
Thibault Delavallée bc067dfd8b [REF] hr_holidays: improve resource integration and remove product strange dependency 2017-02-27 14:04:48 +01:00
Thibault Delavallée 5a9cff3387 [REF] mrp: remove inherits from workcenter to resource and use resource mixin 2017-02-27 14:04:48 +01:00
Thibault Delavallée 9d092c77c9 [REF] hr: remove inherit from employee on resource and use resource mixin 2017-02-27 14:04:48 +01:00
Thibault Delavallée 583b9d0088 [REF] stock_calendar: remove overrides of resource methods
As standard code of resource module now includes attendances and leaves
in computed intervals, there is no need to keep hackish overrides of some
resource methods. Everything should work from base module.
2017-02-27 14:04:48 +01:00
Thibault Delavallée 9944209ef7 [IMP] resource: add resource mixin adding fields and an API for resource
Purpose is to replace existing inherits of resource.resource by an inherit
on the mixin itself. The mixin offers several methods to compute working
intervals, attendance, hours, ... This mixin will be improved in future
commits when new methods that will be required with future improvements
of various service apps.

This commit also adds tests for the mixin itself. A new model is defined
only for testing purpose to test the mixin.
2017-02-27 14:04:48 +01:00
Thibault Delavallée 27d41ccbb5 [REF] resource: update security rules
Add some rules to enable the read of calendar records by employees as
those rules should not be defined a bit everywhere in various addons.
2017-02-27 14:04:48 +01:00
Thibault Delavallée ff32384b8f [REF] resource: correctly take into account timezones and clean code
Currently timezones were not or incorrectly taken into account in resource
computation. Indeed complexity comes from attendances being expressed in
naive timezones valid for all users, whereas dates and leaves are computed
into UTC. Computation should always be done in user timezone so that there
are no overlapping days and all time intervals are correctly computed.

A new timezone field is added on leaves to know in which timezone they
were originally encoded. Indeed putting them in naive user timezone
require its original timezone, not the current user timezone, as those
can be different.

This commit also contains code cleaning in resource to be a bit more
pythonic, simplify method parameters and offer a more simple api to
other modules.

Eventually code field is removed on resource as it is not really necessary
for resources. It is explicitly added on workcenter model who use it.
2017-02-27 14:04:48 +01:00
Thibault Delavallée ac26fa3dd4 [REF] resource: include attendance and leave info in intervals
Calendar and resource scheduling work on time intervals. However in some
cases it is useful to have info about attendances and / or leaves linked
to those intervals. Internal interval tuples is thus extended to keep
records about resource.calendar.attendance and resource.calendar.leaves.
This will notably allow to remove some hacks in stock_calendar module.
Hooray.
2017-02-27 14:04:48 +01:00
Thibault Delavallée be01aaa99f [REF] resource: remove deprecated compatibility and rename methods
Old methods are still present since a long time and are deprecated since
saas-3. This compatibility layer adds unnecessary complexity to the module
API. Those methods should now be removed. Some renaming is also performed
to ease resource api understanding, notably to better differentiate
internal methods from other methods.

All addons are updated accordingly.
2017-02-27 14:04:48 +01:00
Thibault Delavallée 06f36ddbe9 [REF] resource: remove pseudo-default working hours computation
Companies now always have a default calendar configured. All methods in
resource module should therefore be able to use a real resource.calendar.
This commit removes the computation based on a pseudo 8-17 calendar
given as weird method parameters.

Project is updated in order to use the company calendar by default.
2017-02-27 14:04:48 +01:00
Martin Trigaux a3f4c4974d [IMP] pos: correct outdated comment
So 2015
2017-02-27 12:43:24 +01:00
Fabien Pinckaers 16b93b6dcc [IMP] lunch: better layout for recommendations 2017-02-27 11:48:01 +01:00
Martin Trigaux 4e03cdae48 [ADD] point_of_sale: refund test 2017-02-27 10:43:10 +01:00
Martin Trigaux cdb1074adb [FIX] point_of_sale: set name when duplicating
Introduced at 645df676
2017-02-27 10:43:09 +01:00
Martin Trigaux 3a5521859b [IMP] point_of_sale: add domain on payment wizard
To avoid making a refund on a non-configured payment method.
The point of sale refuse to register a payment with a journal not set at session
creation.

Fixes #15567
2017-02-27 10:43:09 +01:00
Thibault Delavallée 58a4bfd973 [IMP] mail: update message_new to return the newly created record not just its id 2017-02-27 10:00:46 +01:00
Olivier Dony 3979a4f4c6 [REM] website_mail: remove sha_in based message_post
The _message_post_helper() method historically allowed
passing a `sha_in` signature to let an unauthenticated
user post a message on a record.

This option is unused and an alternative is preferred:
passing a `token` value that matches the value of a
given field of the record.

In light of the increasingly grim future of SHA-1
as a cryptographic hash function, we consider it
better to entirely remove this specific option.

It has been unused for a while, and a simple
alternative exists.

As a temporary measure, the feature was also
deactivated in 10.0 at 2cffcfd860
2017-02-25 04:05:26 +01:00
Jeremy Kersten 7b902fca02 [ADD] website_sale_comparison: add comparison feature on eCommerce 2017-02-24 20:29:17 +01:00
Jeremy Kersten 2be56f9d81 [ADD] website_sale_wishlist: add wishlist feature on eCommerce 2017-02-24 20:29:17 +01:00
Jeremy Kersten 39df01ab29 [ADD] website_sale: add website_sale.utils with eCommerce generic function 2017-02-24 20:28:46 +01:00
Jeremy Kersten fe33aefbc0 [IMP] website_sale: move pricelist_context and compute_currency in one helper 2017-02-24 20:28:46 +01:00
Jeremy Kersten bbd2d0e42f [IMP] website_sale: typo, label and add id/class to make js/xpath easy 2017-02-24 20:28:26 +01:00
Jeremy Kersten 1a86155d1c [IMP] website_sale: improve total to be (a little bit) more responsive 2017-02-24 19:16:34 +01:00
Jeremy Kersten 169682c542 [FIX] website_sale: add indentation for categories in left menu
Removed previously by error during the checkout refactoring
2017-02-24 19:16:34 +01:00
Jeremy Kersten 564c15c4d5 [IMP] website: add is_website_user and user_id in odoo session_info
Theses informations need to be available in javascript easily without ajax request
2017-02-24 19:16:34 +01:00
Laurent Mignon (ACSONE) b3b3715586 [IMP] report: add postprocess hook in attachment generation
To allow to override a postprocess of a generated report
By default the method create the attachement if required

Closes #15091 
Closes #15241 
Closes #15268
2017-02-24 17:59:39 +01:00
Jeremy Kersten 28b920e73a [IMP] website_portal*, website_project*: typo in label + try to imp mobile view 2017-02-24 08:51:26 +01:00
Jeremy Kersten 5b3d0b3bc8 [IMP] ir_qweb: allow to display only the time from a field datetime.
Can be usefull if we want to split date part (using widget:'date') and time part (new option)
2017-02-24 08:51:26 +01:00
Jeremy Kersten 6571597b42 [IMP] website_project_issue: allow to see attachment from object in portal.
Before this commit, only attachment linked to a message_ids was visible.
So when you open the ticket, you don't have the 'main' attachments
2017-02-24 08:51:26 +01:00
Jeremy Kersten c5d2d78aa7 [IMP] website_project_issue: add search input in searchbar.
Allow to search issues with criteria: content, message, customer
2017-02-24 08:51:26 +01:00
Jeremy Kersten 561d68bafd [IMP] website_portal: allow to add search input into the searchbar 2017-02-24 08:51:26 +01:00
Jeremy Kersten 83bfdb0d21 [IMP] website_portal*, website_project*, website_quote, website_blog: add record pager in portal
+ fix re-use websitue_url in get_access_action
2017-02-24 08:51:26 +01:00
Jeremy Kersten d89210e1fd [FIX] website_portal: align center the th row from portal
TD text is right align, but TH text is left align.
No jealous: now centerd
2017-02-24 08:51:26 +01:00
Jeremy Kersten f4ae1a63c7 [FIX] base: fix dev mode when view is no more in addons-path 2017-02-24 08:51:26 +01:00
Raphael Collet c59d79da3c [IMP] models: better argument 2017-02-23 14:48:44 +01:00
Raphael Collet 68c9f1a673 [FIX] models: missing argument 2017-02-23 14:47:20 +01:00
Raphael Collet 6a768cd1de [MERGE] models: refactor BaseModel._auto_init 2017-02-22 17:39:08 +01:00
Raphael Collet e78269664d [IMP] tools: use information_schema instead of pg-specific tables 2017-02-22 15:24:08 +01:00
Raphael Collet f8e573db23 [REF] models: refactoring of foreign keys 2017-02-22 15:24:08 +01:00
Raphael Collet dc82ff59ac [REF] models: in _auto_init, delegate field schema updates to fields
The fields objects are responsible for creating their column/table and indexes.
The methods that update the schema are overridden to handle cases specific to
each type of field.
2017-02-22 15:24:07 +01:00
Raphael Collet d024c76021 [REF] tools: add functions for SQL schema manipulation
This helps factoring out a certain number of similar queries, and removing a
few methods from `BaseModel`.
2017-02-22 15:24:07 +01:00
Raphael Collet 8225f36497 [IMP] models: speed up schema update for models
Simply remove most `commit()` statements from code that updates the database
schema.  This improves the performance of the schema update by 30%.
2017-02-22 15:24:06 +01:00
Raphael Collet b3c97f08bb [FIX] mail: when initializing aliases, force reflection of models 2017-02-22 15:24:06 +01:00
Raphael Collet dfec1fa778 [FIX] base_sparse_field: remove pre_init_hook 2017-02-22 15:24:05 +01:00
Raphael Collet daa1eb1fc4 [IMP] base: remove ir_model_* tables from base.sql 2017-02-22 15:24:05 +01:00
Raphael Collet 2b46025dd5 [REF] models: use Registry.post_init() for reflecting models, fields, relations and constraints 2017-02-22 15:23:48 +01:00
Raphael Collet b6103d0b1b [REF] models: foreign keys use Registry.post_init() instead of BaseModel._auto_end()
Also use Registry.post_init() for the creation of foreign keys in
`_sql_constraints`.
2017-02-22 15:22:26 +01:00
Raphael Collet a1d061080e [REF] models: improve the API for post-init functions
Add a method to the registry to register function calls that must be done after
methods `_auto_init` and `init` have been invoked on all models.
2017-02-22 15:22:26 +01:00
Raphael Collet d0591c18e5 [REF] base: refactor the API of model, field, constraint and relation reflection
Simplify the API as much as possible, and delegate all the implementation
details to the models `ir.model`, `ir.model.fields`, `ir.model.constraint` and
`ir.model.relation`.
2017-02-22 15:16:35 +01:00
Raphael Collet 3214ca9820 [ADD] test_new_api: add checks on a model's schema 2017-02-22 15:16:34 +01:00