Odoo's Mergebot d5aec6c2f1 [MERGE] sale_timesheet: add some unit tests + clean code
Purpose
======

The goal of this PR is to write some unit tests about the changes made in Task-2388500, Task-2409761 and Task-2424382 to keep the functional features.

## Determined Sales Order Items in task and timesheets
These tests check if the Sales Order Items (SOL) computed in task and timesheets are the ones expected based on the pricing type defined in the project.

- Check if the SOL in task is the same than the one in project when we create a task in project which has a pricing type to project rate or employee rate.
- When the pricing type is employee rate and we timesheet, check if the SOL on these timesheets are the one expected, that is:
  - If the pricing type is employee rate and there are some mapping for employees, normally when we timesheet for an employee in the mapping, we should have the SOL defined in the mapping for this employee in the timesheet.
    - If we timesheet for an employee who is not in the mapping then we should have the SOL of the current task.
  - When the pricing type is task rate and we defined a customer who has some SOs with services products in project, if we create a task in this project then we should have the customer defined in the project and the one of latest SOLs if it is prepaid service and remaining_hours > 0. Otherwise, the SOL is False.
  - When the pricing type is employee rate or project rate and the customer, SO, SOL is defined in the project, if we change the customer then the SO and SOL should be False if the customer in the project is different that the one in SO selected.
    - If the pricing type is employee rate then when the customer changed in the project, the SOL in each mapping should also be removed.

## Remaining hours for prepaid service products

This test checks if the remaining hours is correctly computed in project.task when the Sales Order Item in this task contains a prepaid service product.

## Tour JS to check features in the UI

A tour js has been created to check the process with the UI. The steps are the following:
- Go to the Sales App,
- Create a sales order for Brandon Freeman for instance,
  -  In this Sales Order, we take a prepaid service product (we created this one in a unit test in python as we must not use the demo data to realize the JS tour) and the quantity ordered is 10 hours,
  - Check the product_uom field is set on 'Hours',
  - Confirm the Quotation to create the Sales Order,
- Go to the Project App,
- Create billable project to timesheet for Brandon Freeman,
- Create task in this project and add a timesheet into it,
- Show in this task that we can see the Sales Order Item linked to the createed timesheet, because this field is hidden by default.
- Go to the Settings menu and then Projects submenu.
- Create a project, and show the three different configurations to invoice services in a project. That is:
  - Task rate
  - Project rate
  - Employee rate

## Miscellaneous

The `project.task.create.sale.order` model has been removed because the wizard is unused since these 3 tasks have been merged.

task-2439304

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#65146

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-03 10:38:51 +01:00
2020-04-20 11:41:39 +00:00
…
…
…
…
2019-11-08 11:24:04 +00:00
2020-09-28 14:07:25 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%