Please sign in to comment.
[MERGE][IMP] sale_timesheet: select project on Sale Order to create task
Purpose ======= The 'service_tracking' selection field on the 'product.template' model in the 'sale_timesheet' module had its 'task_new_project' option renamed to 'task_in_project'. If one or more sale_order_line have a product configured with this option, a new 'project_id' field appears on the sale_order under the 'Sales Information' section. When a project_id is selected, the analytic account on the sale order is automatically changed to this project's analytic account. This allows handling more use cases on sale_order: - If a sale_order_line has a service product with that new option and no project_id configured on the sale_order: -> create a new project based on the configured project_template_id and then create a task in that project (same behavior as before) - If a sale_order_line has a service product with that new option and a project_id is configured on the sale_order: -> directly create a task in the selected project_id The behavior does not change for the 3 other options ('no', 'task_global_project' and 'project_only'). Specs ======= - Add project field on sale order in "other infos" tab, shows only when a product on the SO has the option activated - If projec is selected on SO, create task in this project, otherwise it creates a new project (as before) - Rename 'task_new_project' into "task_in_project" - Allow to have the new option with project template - Selectable projects on Sales Order are `billate_type` in 'no' and 'task_rate' - Never link SO's project to SO or AA - Add onchange on project_id to select this project's analytic account on the SO - Non stored computed field to check if at least one SOL has the new option Use cases - 2 SOL with new option (no template) will create 2 tasks in SO's project - 2 SOL with new options (one no template, one with) + 1 SOL "create new P no T" --> create 2 tasks in SO's project and one new project Task #1915660 closes #29772 Signed-off-by: Jérome Maes (jem) <email@example.com>
- Loading branch information...
Showing with 176 additions and 25 deletions.
- +1 −1 addons/hr_timesheet/views/project_views.xml
- +2 −2 addons/sale_timesheet/data/sale_service_demo.xml
- +9 −6 addons/sale_timesheet/models/product.py
- +44 −6 addons/sale_timesheet/models/sale_order.py
- +8 −3 addons/sale_timesheet/tests/common.py
- +1 −1 addons/sale_timesheet/tests/test_reinvoice.py
- +100 −0 addons/sale_timesheet/tests/test_sale_service.py
- +2 −2 addons/sale_timesheet/tests/test_sale_timesheet.py
- +1 −1 addons/sale_timesheet/views/product_views.xml
- +4 −0 addons/sale_timesheet/views/sale_order_views.xml
- +4 −3 addons/sale_timesheet/wizard/project_create_sale_order.py
Oops, something went wrong.