summaryrefslogtreecommitdiff
path: root/addons/project/tests
AgeCommit message (Collapse)Author
2020-12-17[FIX] project: fix infinite recurring tasks creationVictor Feyens
for repeat_type = 'forever' recurrences. Consider a recurrence creating a task every 15th day of the month. When the cron runs, it updates the next recurrence dates of the recurrence. But currently, the updated "next_recurrence_date" can be set to an earlier date than today, if the fixed day of the recurring task is earlier than the current day. This means that the recurring task to create every 15th of the month will be created the 15, the 16, the 17, the 18, ... until the next month begins (no task will be created when the cron runs before the 15th of a month). This commit enforces the next recurrence_date to be set after the current cron run, to ensure a task isn't wrongly created multiple times. This commit also includes the tests that led to the discovery of this bug. closes odoo/odoo#63518 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-17[FIX] project: fix infinite recurring tasks creationVictor Feyens
For recurrences of repeat_type = 'after', the daily cron would create tasks infinitely. * The cron creates recurring task for all recurrences for which next_recurrence_date < today. * next_recurrence_date was never updated. This commit ensures that next_recurrence_date is set to False for repeat_type = 'after' recurrences, when the last recurrence is created.
2020-10-29[FIX] *: correct typos and bad EnglishMartin Trigaux
Courtesy of translators Reexport .pot of modified modules closes odoo/odoo#61002 Related: odoo/enterprise#14485 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-15[IMP] project: enable config-selected features in projectsDominik Rubo
This change ensures that when the user activates optional features of the project app, they are enabled in existing projects as well as newly created projects automatically, which is likely what the user expects. For most optional features, this behavior was already in place. It was not in place yet for the sub-tasks and timesheets features, which this change fixes. Two added tests check the behavior described above for features that are activated through a `group_*` field on `res.config.settings` (sub-tasks, recurring tasks and ratings). The tests do not cover features that are activated through a `module_*` field, as such fields require the installation of further modules and we cannot simulate this. Task 2297054 closes odoo/odoo#58692 Related: odoo/enterprise#13641 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com> Co-authored-by: Kevin Baptiste <50135801+kba-odoo@users.noreply.github.com>
2020-08-12[IMP] project: add recurring tasksKevin Baptiste
Some interventions are done on a regular basis (e.g. maintenance of fire alarms, safety inspections). Having tasks auto-generate would facilitate the process and would ensure that the next intervention isn't missed/forgotten. closes odoo/odoo#55517 Taskid: 2172156 Related: odoo/enterprise#12246 Related: odoo/upgrade#1604 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-23[IMP] project: convert onchange to stored-editable computed fields.Rémy Baranx (bar)
The 'stage_id' field is now a stored-editable computed field. The 'company_id' has been converted to a stored-editable computed field. The modification of the 'partner_id' field in the onchange method has been moved and merged into the _compute_partner_id method. Remove the empty 'onchange' method from the project.task model and also remove this method call from the sale_timesheet module, which inherits from the project.task model. Adapt the _compute_partner_id to retrieve exactly the behaviour before the onchange method deletion. Update code and tests of the task/subtask partner_id management after discussion with Alexandra to clarify the behavior. Add the 'multi_edit' attribute to tree views.
2020-05-08[IMP] customer ratings flow improvementsBenjamin Frantzen (bfr)
- Rename the 'Use Rating on Project' feature into 'Customer Ratings' - Rename the 'Set Email Template to Stages' link to 'Set a Rating Email Template on Stages' - Add an optional list view for the Stages menu - display warning if the rating_template_id field is set and if one of the selected project_ids doesn't have the rating_status field set to true - Project form view revamp - rename the '% on tasks' stat button into 'Customer Satisfaction' - Remove the 'no option' for the rating frequency field because it is required - project form : Add a 'Go to Website' stat button - Project dashboard: remove the 'Customer Ratings' menu item in more - Ratings page: the 'Last 30 days' filter include ratings from today - remove the Appointment / Helpdesk Customer Satisfaction / Live Support menu items TASK ID : 1251
2020-04-14[FIX] project: fix ACLs testsThibault Delavallée
Currently there are some issues wiht ACLs tests, notably transaction errors due to new_test_user helper tool. Standard new_test_user tool allows to speedup user creation in tests. It may cause issues if reset password is involved as there is a savepoint done. Mail has an improved helper allowing to avoid that. Also tests were actually not working due to cache being invalid. First fix allowed to spot it and this is fixed now. Followup of 7059b177ee3108afe951dc279d3db4054eba4115 . Closes PR #49485 closes odoo/odoo#49504 X-original-commit: 2c766fa8b66c4e05d373ae550a2d43fa2500616c Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-10[FIX] project: Allow multi company ir rule relaxionLucas Lefèvre
If you want to de-activate the multi company ir.rule, those checks will still raise an error. Task 2198433 closes odoo/odoo#47291 X-original-commit: 12a81a3a5265cbd18f5c00ab439cd1486696521b Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-01-31[IMP] project, industry_fsm: Improve subtasks and configuration UXKevin Baptiste
Purpose ======= In Project, the configuration has to be done twice: in the settings of the app and on each project. During the onboarding, the user won't understand that a feature has to be enabled at both places and will think that the system just doesn't work. If the user enabled a feature, he most likely intends on using it for most of his projects. Therefore, having to do a double configuration for each new project is annoying. By the way, sub-tasks is the only global feature (it can't be enabled or disabled by project), so we are breaking it down by project to remain consistent with the rest. Specification ============= 1/ Enable subtasks per project Before this commit, sub-tasks were a global feature (i.e. once enabled they were enabled for all projects). This commit gives the ability to enable/disable sub-tasks per project. 2/ Make project_id on planning required 3/ Change default rating status on new projects 4/ Default value for allow_subtasks 5/ Enable timesheets on existing projects 6/ Hide Total Hours if subtasks are disabled 7/ Create project in the company context. Otherwise some records generation could use a default company which is not the company for which we want to create a project. 8/ Default value for allow_forecast, is_fsm 9/ Change reference to timesheet product 10/ Fix tracback on industry_fsm_report. Before this commit, there was a traceback when enabling "Worksheets" (industry_fsm_report) after "Time and Material" (industry_fsm_sale). 11/ Convert some onchange method into computed editable stored fields closes odoo/odoo#41218 Taskid: 2146474 Related: odoo/enterprise#6998 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com> Co-authored-by: Yannick Tivisse <yti@odoo.com>
2020-01-15[MERGE] project, hr_expense: Fix several multi-company issues + testsfw-bot
Purpose Fix multi-company access issues following the big changes that happened (the 13.0). Make the usability better in order to avoid potential multi-company issues for the user. Specification Check the related commits to see the different fixes that have been made. For more information about the technical/functional considerations, check the related task. Taskid: 2088891 X-original-commit: 5c8df3a5e5f7960e5eab6439e0a32a06224ba826
2020-01-14[IMP] project: Following a private project no longer requiredLucas Lefèvre
======= Purpose ======= Currently for a user to be allowed to see a private project they must follow the project. This means that they will be added as a follower of all new tasks in the project which causes them to receive 1000000 notifications, especially if there are a lot of tasks in a project. ============== Specifications ============== 1) Add an Employee m2m field on project next to 'Invited Employees' - only visible if the 'Invited Employees' option is selected - the project should only be visible to employees selected there (regardless if they are followers or not) 2) Add an Employee m2m field on tasks below the 'Email cc' one in debug mode - only visible if the 'Invited Employees' option is selected on the related project - should be pre-filled with what is set on the project - the task should be visible to employees selected there (regardless if they are followers or not) 3) Add a Portal users m2m field on project next to 'Portal users and all employees' - only visible if the 'Portal users and all employees' option is selected - the project should only be visible to portal users selected there (regardless if they are followers or not) - rename the option into 'Invited portal users and all employees' 4) Add a Portal users m2m field on tasks below the 'Email cc' one in debug mode - only visible if the 'Portal users and all employees' option is selected - should be pre-filled with what is set on the project - the task should be visible to portal users selected there (regardless if they are followers or not) 5) Following a project/task should not grant the user/employee the ability to see the project/task Task 2031527 closes odoo/odoo#40505 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-19[REF] rating, various: improve rating.rating ACLsryv-odoo
PURPOSE Rating model should be available only for internal users. External users access them only through dedicated routes or controllers using sudo and/or granting access through tokens. Therefore simplifying ACLs should be feasible. SPECIFICATIONS Remove access to rating.rating for public and portal users. Only employees can access it, with full access given to system admins. Update various functional flows to use sudo() and check that access is verified before using sudo. Impacted modules * rating / mail: add groups on some rating related fields as only internal users should access them now; * rating / mail: set some statistics fields using compute_sudo as their value should be accessible for external people even without access to the underlying rating.rating records; * project: makes some use of rating and has to be updated, notably for the public rating page; * website_{livechat, rating, slides}: add sudo in public routes as access is already granted; * website_slides: set statistics field using compute_sudo as their value should be accessible for external people; TASK ID 2053096 PR #36592 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-12[IMP] crm, product, ...: Clean some common test classesYannick Tivisse
2019-10-10[FIX] project: can delete archived project with tasksAndrea Grazioso (agr-odoo)
Create a Project with tasks, archive it, delete it. The project is deleted, but this should not happen: tasks are present, but they are hidden because when the project is archived all its tasks are archived too (active flag is set to false). On project unlinking only active tasks are checked, thus allowing the deletion. Using a context flag to avoid filtering the non active tasks. opw-2080515 closes odoo/odoo#38320 X-original-commit: 71a79f26e6319c6987397950c7f9df6c61dfb0d9 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-27[IMP] project: multi company subtasksjem-odoo
This commit makes possible the task delegation in a multi company environement. A subtask is a normal task with a parent, but can now be in a different company, to be use as subcontracting task in another company. Tests are added to check multi company consistency for the project app in general and for the subtask cases. Task-1999686
2019-08-20[IMP] models: ORM speedupRaphael Collet
This branch is the combination of several optimizations in the ORM: * store field values once in the cache: the cache reflects more faithfully the database, only fields that explicitly depend on the context have an extra indirection in the cache; * delay recomputations by default: use method `recompute` to explicitly flush out pending recomputations; * delay updates in method `write`: updates are stored in a data structure that can be flushed efficiently to the database with method `flush` (which also flush out recomputations); * make method `modified` take advantage of inverse fields to inverse dependencies; * filter records by evaluating a domain on records in Python; * a computed field with `readonly=False` behaves like a normal field with an onchange method; * computed fields are computed in superuser mode by default. Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien Pinckaers. closes odoo/odoo#35659 Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-07-04[FIX] *: sudo() -> with_user()Raphael Collet
2019-04-04[IMP] tests, *: add start_tour helperSébastien Theys
Before this commit, the syntax to start a tour was extremely verbose. With this new method, it is possible to start a tour by just giving the essential parameter: the tour name. The full set of features from browser_js are kept by using **kwargs. closes odoo/odoo#32316 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-03-29[IMP] mail, *: don't track fields at createXavierDo
*: project, crm, maintenance, helpdesk, It is useless to track fields during create since they have no initial value and future tracking message will show changes on tracked field. We can log a default creation message instead (as it is now if there is no mail_create_nolog context key) This change will implies - less queries when creating record - cleaner creation messages - less occurence of mail_create_nolog ctx key Removing tracking at create could break the creation subtypes mechanism (example: following task creation subtype on project) Instead of using _track_subtype to give a subtype at create, a new _creation_subtype method can be override. If a creation subtype is set on a specific modlel, creation messages will be create by message_post instead of _message_log. We also need to adapt the message_track_post_template in order to keep this feature whithout tracking. Task: #1916916 closes odoo/odoo#31945 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2018-12-04[IMP] project: make project use rating parent mixinjem-odoo
No functionnal changes are done in this commit. Everything stays the same, but use the parent mixin mecanism. Task-1903565
2018-12-04[IMP] rating: introduce the parent mixinjem-odoo
When creating a task, the satisfaction of the project is recomputed even if the task has not rating. This can lead to performance issue: concurrency error in Postgresql can happen if a task is created when somebody else tries to update the project. The satisfaction recomputation will give and concurrency error whereas it will return the same satisfaction percentage, since the task has no rating. The same problem will happens in every modules implementing the rating feature: project, helpdesk and livechat. This problem leads us to create the rating.parent.mixin in order to retrigger the computation only when a new rating appears on the parent object. We also unstore the field to make its computation lazy. Maybe in a near future, this field will be computed in SQL directly. The parent mixin allow us to standardize the behavior to all parent rating models. These optimizations should reduce the number of computation and speed up the task creation. opw-1902502 Task-1903565
2018-07-17[IMP] project: cleanup in test mailFlorent de Labarre
Coutersy of @tde-banana-odoo Closes #25792
2018-04-03[REF] mail: improve implementation of message subscribeThibault Delavallée
This commit refactors mail.thread message_subscribe method. It is done for two purposes. First one is to optimize performance by using the new followers computation methods introduced recently. Second purpose is to clean the API of message_subscribe to make it simpler to use. This commit splits message_subscribe in two main parts : * _message_subscribe is a private method calling the follower new subscription methods and updating the record set; * message_subscribe is a public wrapper on _message_subscribe that adds access rights checks; Simplification comes by removing message_subscribe_users that was a shortcut to message_subscribe. Having a method to subscribe partners and channels is sufficient as we would like to avoid bloating the public API of mail.thread. A force parameter is also removed from message_subscribe as this implementation detail can be induced in the computation. Various addons using the removed methods are updated in order to use the new subscription API. They have the same functional behavior. This commit has a great impact when subscribing several followers. In a more general way all code using message_post is also optimized as posting a message generally implies subscribing followers. It also improves activity use as posting a message and subscribing new followers are common process in activities.
2018-03-20[REM] project: remove assigned subtype and keep only classic trackingThibault Delavallée
Since e9734f4975904b6196423b7f5de7dd211809d6f6 assignation is now a notification sent in the inbox or by email to the newly-assigned responsible. It is therefore considered as not necessary to link a subtype to the assignation itself. Indeed having it logged in the discussion history as a classic tracking in addition to the notification is considered as sufficient. In project module the task opened subtype was linked to task creation and task assignation. This subtype is now used only for task creation. It also fixes a strange behavior. Changing assigned user in an ongoing task was trigerring the task opened subtype which was strange. This is not the case anymore. This commit is related to task ID 60790. Closes #23244 .
2018-02-23[IMP] rating: Parent document name updateRomainLibert
For objects inherting from rating.mixin, when their parent model change (e.i.: task from a project to another), the "Parent document name" does not change. The rating is still considered belonging to the old parent object (rating stat of project is not correct). Change the rating API. In rating mixin, instead of having 2 methods returning parent id and parent model (rating_get_parent_id and rating_get_parent_model_name), we should have one method returning the 'parent relation field' (inevitably m2o field). Then we can deduce its parent_res_id/parent_res_model, and check this parent field is in values of write to trigger the recompute of parent_res_name. Also, add "ondelete=cascade" on parent_res_model_id Impacted modules: project, rating, helpdesk, livechat
2018-02-15[MERGE] forward port branch saas-11.1 up to a277b585072Christophe Simonis
2018-02-15[MERGE] forward port branch 11.0 up to 259686ba78dChristophe Simonis
2018-02-13[FIX] project: set as favoriteNicolas Martinelli
- Connect as a user with only 'User' rights on projects - Set a project as favorite (click the star) The project is not set as favorite. Since only project managers are allowed to write on projects, the field `is_favorite` is set as read-only. Therefore, it is filtered out by `_generateChanges`, and nothing happens. First step is to set the attribute `force_save` in the view, so the RPC `write` call is forced. Second step is to compute directly the inverse thus bypassing access rights. Co-authored-by: Nicolas Lempereur <nle@odoo.com> opw-814604 opw-801587 closes #22938
2018-01-18[IMP] tests: Add the possibility to tag testsChristophe Monniez
Purpose: When running tests, all the tests for the installed/updated files are done. This commit adds a 'tagged' decorator that can be used to tag tests. Combined with a new 'test-tags' CLI option, it adds the ability to filter which tests are executed. For example, @tagged('slow') will add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will only run tests tagged 'slow'. One can use prefixes to select cases with tags. '+' or no prefix means that the tests tagged with this tag are selected for execution. '-' prefix will exclude the tests tagged with this tag. Exclusion takes precedence over inclusion. Also, by default, all Odoo tests cases are tagged 'standard' and with the technical name of the module. This means that when selecting tests with the 'test-tags' parameter, if '-standard' is not specified, all tests tags are going to be executed. When tagging tests, one can remove such automatic tag by prefixing the tag name with '-'. E.g. @tagged('-standard') will remove the standard tag from the test. Another example, if one wants to test the 'sale' module alone, even without adding any 'tagged' decorator thos tests can be selected like that: --test-tags="sale" Tests are selected or deselected using a TagsSelector. When instanciated, a string is passed with comma separated tests selectors like '+slow,-standard'. When the 'check' method is called with a test as argument, it returns True or False if the test has to be executed or not.
2018-01-17[IMP] project: drop project substask constraintAkash Bhavsar
This commit improves subtask mecanism, on several points: 1) Drop the project constraint: before this commit, creating subtask in non parent project was not possible. Now you can move subtask to any project. The default project of a subtask is the one from the parent. 2) When setting a parent task, we want to force some field to have the same value as its parent, like `partner_id` or the `sale_line_id`. The idea is here, we work for the same client; a subtask count for the same goal (SO line or customer). Those fields should be readonly on the view. 3) Refactor some methods Task: 38498
2017-11-27[MOV] base: move ir_* models into models/Thibault Delavallée
2017-11-21[REF] project: tests: make tests independent from mailThibault Delavallée
Purpose is to be able to move mail tests in a separate module without breaking other tests. It seems dependency is not real, only some data to add. It is better to have self contained tests anyway.
2017-08-16[MOV] website_project,project: move all featuresJérome Maes
Making project depending on portal, makes website_project useless. So move all feature from one module to the other.
2017-08-07[IMP] project: Remove default author when going through the mail gatewayYannick Tivisse
2017-02-21[IMP] mail: improve notification management, either email either inboxAline Preillon
Currently partners have a boolean field to choose whether to receive notifications only in their Odoo inbox or to receive them in their inbox and by email. This leads to several issues : * if a customer is configured to not receive emails he will not receive any notification on sales orders, leads, ... This is not clearly indicated to the salesman and it is not easy to know how to change that behavior * if an user chooses to receive emails and does not use its inbox a lot of notifications stay in Odoo. The user has to manually set them as done to make them disappear which is redundant. This commit changes that behavior. From now on customers will always receive all notifications by email. Indeed Odoo is not a customer oriented mailbox. Moreover sales orders or discussions on leads send to customers should always be sent by email as it is the standard communication mechanism. Users will be able to choose to receive notifications in Odoo or by email. The choice is no longer inbox or inbox + email, but inbox or email. Choosing one option or the other one depends on the way the user wants to work. Technically the field is moved on the users model and selection keys are renamed. Notification process is modified * notified_partner_ids contains as before specified recipients as well as followers matching the subtype * customers and users working with emails are notified. During that process customers notifications are marked as done to be able to track the email state without having needaction. Users notifications are currently deleted as we do not track their email state. The removal of partner field implies changes in various addons that define partner data with this field set in the values.
2016-09-02[FIX] adapt logger namesRaphael Collet
2016-09-01[REF] mail: remove required alias on usersThibault Delavallée
This commit remove required alias on res.users model. It also removes the inheritance of mail.alias.mixin. The field alias_id is kept and allow people to use aliases on users if they want. However there is no default void alias created for each user anymore. Default from of mail.message does not use user alias anymore. Indeed this creates issues with aliases not being correctly configured and can be confusing compared to private channels. Using user aliases is therefore now done manually instead of being a default behavior.
2016-08-26[IMP] web_tour, *: allow to properly extend toursqsm-odoo
* crm, project, website, website_event, website_blog, website_forum, website_sale Eg: the tour 'shop_buy_product' is extended by the website_sale_options addons to add a step to close a modal. The current solution was requiring the module that defines the tour to extend, then add/remove steps in the "step" key of the tour definition. Some of the problems with this method were: * The "register" method calls the "update" method to immediately search for tip to place once registered (as register may be called after the DOM is ready). So extensions of tours were happening after the tours were started (and the tours were not restarted). * The addition/removal of steps was happening after they were filtered according to the "edition" key. To allow extension, the system is changed as follow: * The "register" method now only saves the steps and options without modifying them and does not call the "update" method. * Once the DOM was ready, the tour service started listening to DOM mutations and called the "update" tour method. Now, this "update" call is replaced by a "_register_all" call, on DOM ready and at the end of the current call stack (which makes sure all modules are loaded). This "_register_all" method marks the registered tours as ready after having filtered the steps according to the "edition" key and initialized the current step to trigger. * Also, tours can now define a "wait_for" option which allow them to be marked as ready for run and update after the given deferred. Those tours can now also be extended without having to wait for the deferred. PhamtomJS must wait for the "ready" key to be true to run the tour.
2016-08-10[IMP] various: use odoo for imports instead of openerp and update class namesThibault Delavallée
2016-07-18[IMP] *: activate automatic tour testsqsm-odoo
* project, crm, point_of_sale, website, website_sale, website_blog, website_event, website_forum
2016-07-06[ADD] website_project: Portal access to ProjectsAntony Lesuisse
Split project to move portal features to a new module named website_project. Portal users may now access their projects and tasks throught the website_portal My account page. The Backend portal menuitem is removed. Simplify the privacy settings of project, to be visible to portal users the project must be in 'portal' mode. Original authors: Vipul Bhatt, Florian Wintjens
2016-06-30[IMP] project: replaced except_orm by AccessError in testsRavi Gohil
Comments were referring to Warning rather than AccessError but: - Warning is deprecated - The functions that are tested actually raise AccessError
2016-06-16[REM] project: remove state field on project.projectAdrien Dieudonne
Also remove unused method _generate_task()
2015-09-03[IMP] project: improve tests to consider a task created in a project with ↵Yannick Tivisse
and without stages
2015-09-02[IMP] project, project_issue: discard project templatesRaphael Collet
2015-08-21[REF] mail: mail_thread: followers updateThibault Delavallée
Followers can now be partners or channels. Partners following a document will receive needaction, as previously. However people can follow documents through channels. Members of a channel are able to listen to a stream of messages using the channel. Those messages do not create needaction messages. It is therefore possible to follow documents without receiving too much notifications. For interesting documents subscribing with its partner will create notification. message_follower_ids fields is udpated. It is now a many2many to mail.followers, not to res.partner anymore. A subscription can be either a partner (partner_id) or a channel (channel_id). Some access rules have been updated accordingly.
2015-08-14[IMP] project,project_issue,project_timesheet,project_issue_sheet: project ↵Damien Bouvy
visibility and access rights modifications [REM] portal_project: move ALL the things - move portal access rights from portal_project and website_project_issue to project and project_issue - move portal menuitems back to their respective module - remove public visibility of projects - adapt demo data to have a 'Demo Portal' project - add correct access rights for account.analytic.line for portal users - small view tweak (do not display 'timesheet' tab if one can't see antyhing in it anyway)
2015-07-28[REM] resource, project: removed faces library and its relatedThibault Delavallée
code in resource and project. This library was once used to perfom resource allocation: scheduling tasks and things like that. However this feature cannot be accessed through the interface since a long time. The feature is now removed from the project code. The library has been removed. Some code in resource used only in the project code has also been removed, as well as a test linked to this code.
2015-07-09[CLEAN] mail: tests: reduce a bit the boilerplate of tests to lessenThibault Delavallée
the testing time.