Commit Graph
159 Commits
Author SHA1 Message Date
Kartik Chavda 7517bf46d4 [FIX] sale_,(project): set default analytic account and analytic tags in task
Currently, the project's analytic account and analytic tags are not set by
default in the task. Now it will be fixed.

 Steps to reproduce:
    1. Install project
    2. Activate the analytic account and analytic tags in the user setting
    3. Create a project with analytic account and analytic tags
    4. Create a task from the kanban view
    5. Check the analytic account and analytic tags in the task

 Steps to reproduce:
    1. Install sale_project
    2. Activate the analytic account and analytic tags in the user setting
    3. Create a project with analytic account and analytic tags
    4. Create a product (Create on Order = task)
    5. Create a sale order and confirm
    6. Check the analytic account and analytic tags in the task

task-2930761

closes odoo/odoo#97455

X-original-commit: 0a5bc153cf682b29b1c86ac966d8164bd41acbdb
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-05 03:38:14 +02:00
Rohitkumar (roku) a819d6a597 [IMP] sale_(project),hr_timesheet: improve generic UX for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - when deleting a project, delete all of its tasks in the process instead of
   raising an error
 - make the list view editable bottom
 - add a 'view task' button to open the task form view
 - the 'download' and 'print' buttons should be centred
 - rename 'planned hours' into 'allocated hours' (or 'allocated days' if the
   timesheet encoding unit is in days)
 - when a project is linked to an SO manually, he should appear in the
   'projects' stat button of the SO; same goes for tasks
 - remove the 'profitability' setting
 - display the SOL and the quantity in red as well if the milestone hasn't been
   reached yet for update right side panel
 - add a project field for quickcreate in kanban view
 - 'fa-check-square-o x/y' in muted on the project kanban cards

task-2838372

closes odoo/odoo#92262

Related: odoo/enterprise#27758
Related: odoo/upgrade#3561
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-05 03:38:02 +02:00
Rohitkumar (roku) 2720bc2034 [IMP] sale_(project),hr_timesheet: generic UX improvement for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - add the following filters for project.update search view
 - display 'due mm/dd/yyyy' in red if the deadline is in the
   past and the milestone hasn't been reached yet for milestone section
 - add an 'x Milestones' stat button that should open a list view of all of
   the Milestones that are linked to an SOL of this SO for sale.order form view
 - add an 'unread messages' filter with separated from other filter
 - rename 'create' into 'create project for project wizard
 - change to "Create projects to organise your tasks. Define a different workflow
   for each project." for project.project action helper

task-2864875

closes odoo/odoo#94936

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-04 18:35:23 +02:00
Adesh Jolhe (adjo) 540c740ae4 [IMP] sale_,hr_(project,timesheet): generic improvements for project
Purpose of this PR to improve generic usage of project app.

So in this commit did the following changes:
 - Changed recurrence conformation messgae
 - Changed Burger menu actions  in
   project.project kanban view
 - Added quick search Description in project.task search view
 - In product form view hide button based on condition
 - Added sample data in project_milestone_views
 - switch the state and the author fields from place and add author
   label underneath it's value
 - switch the date and the progress fields from place
 - Added table-stripes class
 - Changed label sprint summary to summary in project_update_default_description
 - In project.project form view and project.update right-side panel hide
   'collaborators' button on condition

task-2895388

closes odoo/odoo#95245

Related: odoo/enterprise#29089
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-03 20:47:50 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Raphael Collet d86e582283 [IMP] core: move class Query to odoo.tools
Move the definition of class Query to odoo.tools, in order to avoid
circular imports when importing Query in core Odoo modules.

Also reorganize imports in the impacted modules.

Part-of: odoo/odoo#66938
2022-07-05 11:34:59 +02:00
Aaron Bohy 4f984568e1 [REF] *: adapt code to new kanban view
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).

It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...

Part-of: odoo/odoo#92475
2022-06-30 09:29:45 +02:00
Victor Feyens 9750a3c194 [FIX] sale_project: settings user doesn't have access to SOL
Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
momegahed 28caa8fccc [FIX] sale_project_account: Analytic account is overridden
Steps to reproduce:

1- install sales ,accounting, project, timesheets
2- create a new service product p1 that triggers a project and a task
3- create a new sales order so with p1 and validate 1 hour in the task
4- create an invoice from so, an anayltic account is added
5- edit any field of product_id, account_id, partner_id, date
6- the analytic default rule is applied (in this case none) so the
anayltic account is removed

Bug:

the `compute_analytic_account_id` method forces the analytic default
rule even if the field is already set before the changes

Fix:
apply analytic default rule only if the analytic acount is not set and
if it is not a project generated move

OPW-2833912

closes odoo/odoo#94034

X-original-commit: 7f69d623265a53be854eca474876bde2a0b14df6
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-20 13:26:56 +02:00
Touati Djamel (otd) ab485e9318 [FIX] sale,sale_project: delete service tracking for non service product
Steps to reproduce the product:
- Create a new product:
- Select “Service” type
- Go to the Sales tab:
    - Select "Create a task in an existing project" in the `service
    tracking` field
     - the `project` field becomes visible
- Change the Type of the product to “Consumable”
- Try to save

Problem:
The field `project` remains visible and as it is a required field,
we have to fill it in before being able to save the product.
While it is a feature only for service-type products

Solution:
- The `project` field is based on the `service_tracking` field
to become invisible or not. So when the product is not of service type,
we must remove the tracking service so that the project field
becomes invisible.

- Prevent the user from changing the type of products already used in
a sale order

opw-2858064

closes odoo/odoo#93804

X-original-commit: 102951140e3f35ced8653d4bedb82b63bb2c963f
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-06-16 16:03:43 +02:00
Audric Onockx (auon) 439836ba63 [IMP] sale_{project,timesheet} : format hours and differenciate sol
With this improvement,
* in the Project Updates kanban/tree side pannel :
	> Hours are displayed 'HH:mm Hours'
* in the Project Updates form description :
	> idem
	> Sales Order Items with the same products also display their
price to differentiate them.

task-2841685

closes odoo/odoo#90624

Related: odoo/enterprise#27753
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-13 16:51:17 +02:00
Martin Trigaux 5acb6db891 [I18N] *: export saas-15.4 source terms
closes odoo/odoo#93246

X-original-commit: 5ff6d185f70650c26c28a6aef7dd37c859ab58d2
Related: odoo/enterprise#28218
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-10 07:27:26 +02:00
Raouf 83760b9f10 [IMP] project: improve ux
Before this committ:
- Stats buttons were hidden when records are zero
- Some wordings were insignificant
- Existing filters don't allow us to check blocked, blocking and tasks soon in overtime and some other information
- Product form fields need some changes in their order

After this commit:
- All stats button are displayed when records are zero
- Wordings fixed
- New filters added to check blocked, blocking tasks and tasks in overtime soon
- Fields were rearanged

task-2726465

closes odoo/odoo#82253

Related: odoo/enterprise#23257
Related: odoo/upgrade#3185
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-02 18:58:14 +02:00
Xavier BOL (xbo) 50ffc33999 [IMP] sale_{project,timesheet}: remove 'delivered_milestone' in invoice_policy
Before this commit, when the `Milestones` feature is disable, the user
can always defined a service product with invoice policy equals to
'Based on Milestones' but since the feature is disabled he cannot add
this product on a milestone and so this configuratiom is useless without
the feature.

This commit removes the item into the invoice_policy field Selection
when the feature is disabled. Moreover, when the feature is disabled,
the existing products with this setting should be updated to be a
service product with `invoice_policy='delivered_manual'`. The quantity
delivered method of the existing SOLs containing those products should
also be updated to allow the user to manually edit the quantity
delivered of those SOLs when the `Milestones` feature is disabled.
However, when the `Milestones` feature is enabled again, only the
products contained in SOL linked to a milestone will be updated because
we cannot assume all service products with
`invoice_policy='delivered_manual'` were a service products with invoice
policy based on Milestones. Also the existing SOLs containing the
products updated will not be updated too to not impact the quantity
delivered.

task-2829542
2022-05-31 10:29:09 +02:00
Xavier BOL (xbo) c1feb0deaf [IMP] sale_project: get the SOL from the milestone to task if no SOL found
Before this commit, the compute of `sale_line_id` field searches a SOL
to set to each task containing in `self` as default value for
`sale_line_id`. If no SOL is found in the parent task or the project set
into the task then no SOL will set. Since a milestone can be set to a
task and a milestone can have a SOL set in its model, the task could
have the one of the milestone if no SOL is found.

This commit sets the SOL from the milestone to the task if no SOL is
found in the project or the parent task related to that task.

task-2829542
2022-05-31 10:29:08 +02:00
Rohitkumar (roku) 61569e9bf7 [IMP] sale_project: fix the SO access error even user has correct sales rights
Before this commit, When user has sale order all docuements right, project user right
and try to open a sale order linked with private project then it raises an
access rights error when a user clicks on sales orders in a project, even
though the user has the correct rights due to invalid access on project_ids
field also only project manager was able to see the project stat button on sale order.

so in this commit, make the project stat button visible to project user
and fix the access error on private project for project user.

task-2792884

closes odoo/odoo#91167

X-original-commit: f4e371a4b0903cea92c947b3afc36deee05237da
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-12 14:51:03 +02:00
Xavier BOL (xbo) 5582af3958 [FIX] sale_project: exclude the Section and note SOLs
Before this commit, when a SO linked to the project contained a section
or a note in its Sales Order Items, the `Sales` section displayed in the
project update view displays those Sales Order Items even if there is no
product set and so the UoM will be False for those Sales Order Items.

This commit adds a condition in the domain to exclude the `Section` and
`Note` Sales Order Items in the `Sales` section displayed in the project
update view.

task-2849122

closes odoo/odoo#91035

X-original-commit: 0eaafbe4e56fd9728ce17a58e2dd3b91abd44359
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-05-11 11:29:03 +02:00
Krzysztof Magusiak 2490982fce [FIX] sale_project: Expecting an ID in write for Many2One
When we are writing on a Many2One field, we are supposed to pass the id
of the object, in this case we are passing directly the object which is
working with the ORM, but is not expected in overrides as the
documentation suppose that an int is passed.

community PR refused in stable:https://github.com/odoo/odoo/pull/88736

closes odoo/odoo#90992

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-11 09:21:55 +02:00
Prakash Prajapati e2c2e61387 [IMP] sale_project: visible sales order stat button in mobile
task-2739646

X-original-commit: 17230cddc3fe974b8c7fe7a16105b706cee0332f
Part-of: odoo/odoo#90721
2022-05-06 14:26:59 +02:00
Kartik Chavda c0da9d934c [IMP] (sale_,)project,hr_timesheet: improve generic ux of project
Purpose of this commit to improve generic usage of project
app.

So, in this commit done following changes:

- add 'my department' filter in project search view.
- add 'my department's tasks' and 'my department's projects filter
  in task search view.
- add quick search, filter and groupby in task analysis report search view
  to make task analysis report search view same as task's search view.
- improve portal template of my/tasks page.
- project.task form view > timesheets: display the employee avatar
  on mobile.
- make 'Task: Rating Request' template auto_delete false.
- settings: make following features disabled by default: sub-tasks,
  task dependencies, recurring tasks.
- project.update kanban list: align the stat buttons with the kanban
  list cards.
- add sample data to the project stages > list view.
- project.task quickcreate: enable the creation of new users on the
  fly.
- move tags quick search below project.
- add title to show  project full name on hover of project name in kanban
  view of project.
- copy user_ids for task in recurrence.
- improve UI visibility of planned_hours and subtask_planned_hours field in
  timesheet page of task form view.
- improve project sharing wizard and project.collaborator tree
  view.
- add grid,kanban,pivot and graph views to 'hours spent on
  sub-tasks' button's action.

closes: #83482
task-2742725

Related: odoo/enterprise#23788
Related: odoo/upgrade#3480
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-03 17:53:45 +02:00
Nicolas (vin) f34d863257 [FIX] account,*: Ensure tests using TestInvoicingCommon runs
Add a check in 'AccountTestInvoicingCommon' to ensure that all
tests using it are run in post_install.
These tests cannot be run at install, thus they would be ignored
and wouldn't run on the Runbot.

X-original-commit: 659ee179e1beed962026e3abac1bda322c2ac964
[FIX] account,*: Ensure tests using TestInvoicingCommon runs

Add a check in 'AccountTestInvoicingCommon' to ensure that all
tests using it are run in post_install.
These tests cannot be run at install, thus they would be ignored
and wouldn't run on the Runbot.

closes odoo/odoo#90242

X-original-commit: ec36b403edda3fbe3b5bd5f30f31ef6bad680967
Related: odoo/enterprise#26791
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-05-02 18:48:52 +02:00
Audric Onockx (auon) c3c5c5ae72 [FIX] sale_project : set project's aa on sol
Steps :
Create a Project (P) :
	> Analytic Account : AA
Create a Product (A) :
	> Product Type : Service
	> Create on Order : Task
	> Project : P
Create a Product (B) :
	> Product Type : Consumable
Create and confirm a Quotation :
	> SOL > Product : A
Go to the Task consequently created.
Add B to the products.
Go back to the Quotation and create invoice.

Issue :
See Invoice Lines:
	> INVL(A)'s analytic account is AA.
	> INVL(B)'s is not set.

Cause :
To set the aa on the SOL, we use
SOL.task_id._get_task_analytic_account_id(),
which returns the task's aa or its project's.
Yet we do that only if the task has an aa.

Fix :
Call the method. If it returns something, set it on SOL.

opw-2817811

closes odoo/odoo#89660

X-original-commit: 9e7bf074c346c35325e14e14422f2d860d0db74e
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-04-26 12:22:08 +02:00
Martin Trigaux 158b537c28 [I18N] *: export saas-15.2 source terms
closes odoo/odoo#89225

X-original-commit: 5925a83d87fa4702f4c0f22346304dc2da47c728
Related: odoo/enterprise#26435
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-04-23 08:33:43 +02:00
Kartik Chavda 43644341a6 [FIX] project,sale_project: fix action of milestone stat button
This commit fix button action of milestone stat button.

task-2784776

closes odoo/odoo#89326

X-original-commit: 70f67d8ca012ccc7980a2cc8da1c2fea1fd15678
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-22 19:57:46 +02:00
Xavier BOL (xbo) 3fcf7631c9 [IMP] sale_{project,timesheet}: add default values for timesheets action
This commit adds some default values for the action used in the SOLs
containing a service product shown in the Sales section.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:30 +02:00
Xavier BOL (xbo) e41a8b924c [IMP] sale_{project,timesheet}: display price_unit when 2 SOLs for the same service
Before this commit, the `name_get` method is override in
`sale_timesheet` module to add the price_unit when more than one SOL is
shown for the same product in the same Sale Order. This override adds
the price unit only when the `with_price_unit` key is in the context, so
it is only used in the `sale_line_id` field defined in `project.project`
and `project.task` models and also `so_line` field in
`analytic.account.line` model when the user wants to set a SOL for those
models. However, the Sales section displayed in project right side
panel is added in `sale_project` and so we cannot use the override in
that module since `sale_timesheet` is not installed when `sale_project`.

This commit moves the part concerning the `with_price_unit` of the
`name_get` override defined in `sale_timesheet` module to `sale_project`
one. And then, we will use the context key in the Sales section to
display the price unit when there are more than one SOL for a same
product in a same Sales Order.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:30 +02:00
Xavier BOL (xbo) 6bd547a4e1 [IMP] sale_project: display 5 sales order items in Sales section
Before this commit, by default 10 sales order items are shown in the
Sales section displayed in the right side panel of project update view.
This section takes much place when there are 10 rows by default.

This commit reduces the number of Sales Order Items to 5 records
to display by default when the user arrives in the project update
view with the right side panel. By the way, if the user wants to see
more Sales Order Items, he can click on "Load More" button to see 5
additional Sales Order Items.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:29 +02:00
Xavier BOL (xbo) ad4b334789 [IMP] sale_project: check if the user can access SO to see SOLs
Before this commit, when the user clicks on the Material row shown in
the project profitability section, he can see the SOLs from another
saleman even if he has just the "See own documents" access rights on
Sales app. Moreover, the check to allow the user to click on a SOL name
in Sales section to get either the timesheets and the stock moves
related is done in sudo and so we do not take into account the rules
defined for the current user.

This commit filters the Sales Order Items to show for the user if
he can see the Sales Order(s) related. it removes the sudo to
correctly filter the SOLs and get only the ones accessible by the
current user.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:28 +02:00
Xavier BOL (xbo) 153f35ef7f [IMP] project: grey the row when the user hovers it.
Before this commit, the user could having a bit difficult to read a
row in Sales or Profitability section shown in right side panel of
project update view since there is not much space between 2 rows.
The idea is to add a color when the user hover a row to correctly see
the row that he sees.

This commit greys a row when the user hovers a row like we did for the
line in the milestone section in the right side panel.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:28 +02:00
Xavier BOL (xbo) d1d00c0e4c [IMP] project,sale_{project{_stock},timesheet}: display form view if one record
Before this commit, when the user clicks on a row in Sales section
displayed in the right side panel of project update, the action display
the list view even if there is only one record to display.

This commit passes the `res_id` with the action to the frontend to
call the action and directly display the form view when we are sure
there is only one record to show.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:27 +02:00
Arnaud Joset 9ac53b07db [IMP] sale,sale_management: adaption for subscription override of SO
Before this commit, the sale module could not be used to manage subscriptions in an override.
This commit adapts the sale module to https://github.com/odoo/enterprise/pull/21825

taskid: 2568007
2022-04-07 10:57:49 +02:00
Thibault Delavallée 05c7e84239 [IMP] rating: make methods private
Purpose is to lessen access to internal methods and make them private. No
need to expose internal computation.

Task-2812665 (Rating: Cleanup rating flow code)

Part-of: odoo/odoo#80707
2022-04-04 17:48:23 +02:00
Xavier BOL (xbo) e26bdb3282 [IMP] project,*: sort the row displayed in profitability section
Before this commit, the order of rows shown in costs and revenues is not
fixed and depends on the order of the modules.

This commit adds a sequence on each row and then sort the rows to fix
the order of those rows.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 518a5becd6 [IMP] sale_project: allow to change the domain for profitability from SO
Before this commit, the domain used to find the SOLs inscreasing the
revenues of the project is fixed, so it is not possible to override the
domain without rewriting the method which computes the revenues from the
SOLs linked to the project.

This commit adds a hook to easily modify the domain used.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 31b2ddc42f [IMP] project*,sale_timesheet: add profitability label
Before this commit, the label is giving with the data computed for the
project profitability.

This commit separes the label with the data to avoid translating many
times the same things.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) ca8aaa0a0d [IMP] sale_project: add action to get all SOLs related to revenues
Before this commit, the materials row displayed in the revenues of the
project profitability in the right side panel shows only the result of
all SOLs containing a material product. The user cannot see which SOLs
give that result.

This commit adds an action to see all SOLs related to that row. If the
user has access to the Sales app then the name in that row (that is,
'Material') will be clickable to redirect the user to the view of SOLs
found for that row.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 50315deaa2 [IMP] sale_project,sale_timesheet: compute project revenues from SO 2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 42ce97a479 [IMP] sale_project: add general to service method in product
Before this commit, we don't have any method to get a dict containing
the mapping with the invoice_policy and the service_type to get the
service_policy. A mapping method exists for that use case but this
method creates the dict each time and we need to map more than one time.

For those reasons, this commit adds a method to get the dict containing
the `(invoice_policy, service_type)` as key and `service_policy` as
value.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 6ba17be98d [IMP] sale_project: load more SOLs in project update if more than 25
Before this commit, the SOLs displaying in the Sales section of the
right side panel is 25, but if there are more than 25 SOLs linked to a
project, it is not possible to see the others.

This commit adds a button to load the others SOLs if there are more than
25 SOLs linked to the current project.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) f13568c809 [IMP] project: review project profitability in right side panel
This commit reviews the project profitability displayed in right side
panel of project update kanban view. The goal of this commit is to add
more information to allow the user to see all information concerning the
profitability of his project.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 7c3e8cf963 [IMP] sale_{project,timesheet}: get sales order items linked to the project
This commit renames some methods and add a query into timesheets to also
fetch the SOLs linked to the timesheets linked to the projects. So, now
all SOLs selected in the project app for that project will be take into
account.

task-2710808
2022-04-01 15:33:00 +02:00
Xavier BOL (xbo) 08501fa130 [IMP] project,sale_{project,timesheet}: review 'Sales' section in project update
This commit completly reviews the Sales section. This section will
display all Sales Order Items linked to the current project shown
instead of displaying the sold section with the total sold section.
This section will shown the name and ordered, delivered and
invoiced quantities for each Sales Order Item related.

The name displayed in this section will be clickable if the product linked to
the Sales Order Item is a service one and if there is at least one
timesheet linked.
Finally, this commit also moves the Sales section initially defined in
sale_timesheet module into the `sale_project` one.

task-2710808
2022-04-01 15:32:59 +02:00
Victor Feyens 00ed6aa042 [IMP] mail,* : uniformized API for chatter links
* Enforce html escaping of record title
* Avoid translating html content as much as possible, to reduce translation errors.
* Uniformize/Factorize link generation, easing future tasks, code maintenance, ...

Enterprise PR: https://github.com/odoo/enterprise/pull/25357

closes odoo/odoo#84866

Related: odoo/enterprise#25357
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-03-31 12:32:47 +02:00
Audric Onockx (auon) 0dc5984d4d [FIX] sale_project : create on order when type updated to service
Steps :
Install Sales, Project and Inventory.
Create a Storable Product.
Create a SO with this product, but do not confirm it.
Change this product :
	> Type : Service
	> Sales > Service Tracking : Create a task in SO's project
Confirm the SO.

Issue :
Neither a delivery or a task is created.

Cause :
Confirming the SO calls SO._timesheet_service_generation(),
which filtered its SOLs based on is_service to 'create on order'.
As this field is not updated when changing the type of the product,
the SOL with the service is filtered out.

Fix :
Update SOL_.is_service when changing SOL.product_id.type.

opw-2786655

closes odoo/odoo#87308

X-original-commit: f1518e8c9a6c7819a0d7f72a524c189cd9de5fc6
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-03-26 11:23:38 +01:00
Vincent Larcin 0039c4a04e [MOV] account_sale_timesheet,sale_project_account: remove useless bridges
Since the sale module depends on the account module, the bridges account_sale_timesheet
and sale_project_account can be merged with sale_project.

This commit removes those bridges and merges them with sale_project.

Task-2772395

closes odoo/odoo#86045

Related: odoo/upgrade#3321
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-03-21 12:11:43 +01:00
Laurent Stukkens (LTU) 7cac66187b [FIX] sale_project: use is_closed in domains instead of stage_id.fold
Before this commit:
- Two uses of `stage_id.fold` were remaining in the code of sale_project
  although `is_closed` is directly available in the model and is an
  indexed field.

After this commit:
- The use of `is_closed` will improve the code performance as the field
  is in the model and indexed.

closes odoo/odoo#86681

X-original-commit: ec98ba2c883e2d37352dba400f911532a6510a1c
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-03-18 19:50:06 +01:00
Xavier BOL (xbo) 8aa63d7873 [FIX] sale_project,sale_timesheet: get SOLs linked to project
Before this commit, when we need to get all SOL linked to the project.
That is the SOL linked to the project and also the SOL linked to all
tasks of this project.

Technically, a fetch is made to get the SOL of the project, a fetch to
get all tasks of the project and then a fetch to get the SOL linked to
all tasks fetched, finally the union is made to avoid having duplicate
sale order items in the recordset
(`self.sale_line_id | self.tasks.sale_line_id`).

This way could be a performance issue if the project contained many
active tasks and so the project update could take more and more time to
compute the sold items shown in the right side panel of project update
view.

This commit does a query builder to fetch the SOLs linked to the project
and its active tasks to avoid doing the prefetchs.

part of task-2710808

closes odoo/odoo#85660

X-original-commit: 0734f4e
Related: odoo/enterprise#24918
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-03-03 03:07:57 +00:00
41bcee0cda [FIX] *: use lazy translation for _get_stat_buttons in project update
Before this commit, the translation is not done in lazy, so for each
stat button shown in the right side panel of the project update, a query
is done to find the correct translation based on the language of the
user. It means, the translation is costly and need to be done in lazy to
reduce the time for the translation of those stat buttons.

This commit uses the `_lt` to translate in lazy mode those stat
buttons. By doing that, the execution time is reduced from 750 ms to 250 ms.

X-original-commit: 95fe018
Part-of: odoo/odoo#85660
Co-authored-by: Yannick Tivisse <yti@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
2022-03-03 03:07:57 +00:00
Vincent Larcin d161d28782 [IMP] sale_timesheet: link milestones to SOLs
Currently, a service can be configured to be invoiced on milestones.
This means that the user has to manually update the delivered quantity on the SO in order to invoice it.

We now also have the notion of milestones in the project module.
It would be nice to have a link in between the milestone and the corresponding SOL, so that the delivered quantity is automatically updated when the milestone is reached.
This would help the users save time, limit the risk of error and reduce the confusion of having unrelated milestones at two different places.

To this end, this commit adds a new "milestones" invoice policy that computes the delivered quantity of a SOL based on the milestones that have been reached, and renames the previous "milestones" policy into "manual".

Task-2558889

Closes https://github.com/odoo/odoo/pull/81684

closes odoo/odoo#81684

Related: odoo/upgrade#3265
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-28 13:52:41 +00:00