Commit Graph
6 Commits
Author SHA1 Message Date
damr 16a07ed1bf [IMP] project: make the field company_id of projects non required
This commit's purpose is to allow the user to set the company_id of a project to False, meaning the project is no longer restricted for the user who does not have access to the company of the project. This change induces a lot of other small behavior changes/approximation. Since some fields (currency_id, resource_calendar_id, etc) were company dependent, we had to updates some use cases.

task-3084819

closes odoo/odoo#122144

Related: odoo/enterprise#41363
Related: odoo/upgrade#4947
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-19 23:17:53 +02:00
damr 5ad0aa5c2a [IMP] project,web_form_project : add the handling of AAL for
project_profitability + change the name displayed in portal

This commit's purpose is to
- add the computation of the AAL for the project profitabity. If a the
analytic account of a project contains AAL that were manually added (
and thus not linked to any sol/purchase/etc ) those lines are not
computed in the 'other costs/other revenues section.

- to display the title of the ticket/task/project in the name of the page My ticket/My task/My project of the portal

task-2960753

closes odoo/odoo#106438

Related: odoo/enterprise#34344
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-06 17:20:44 +02:00
Victor Piryns (pivi) 1adaaba90e [FIX] (sale_)project(_purchase): proj.prof. w/ AA distr. for inv/bills
Current behaviour:
The project profitability panel doesn't take into account the AA
distribution of the project's AA for solo invoices and bills.

Expected behaviour:
It should take the distribution set into account.

Steps to reproduce:
- Install Accounting, Sales, Project, Purchase
- Settings > Activate AA
- Create a new project with a new AA for it.
- Create a new bill or invoice, on the line set the 2 AA, one with
  the project's AA with some X%, and the other AA is irrelevant (the
  sum of all AA on the line should be 100%)
- Confirm the invoice/bill
- Go to the project profitability report (project updates), see that
  we have 100% of the line value that contributed, when it should have.

Reason for the problem:
The contribution of the AA was not taken into account when computing
the project profitability for solo invoices/bills (invoices/bills
w/o SO/PO respectively)

Fix:
Additionally get the analytic_distribution when fetch the
account_move_lines to compute the project's profitability.

Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- master

opw-3246199

closes odoo/odoo#117163

X-original-commit: c3c66d05d039514c9dd02ebdede20a3dff757728
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-03-30 16:23:04 +02:00
Thomas Lefebvre (thle) 5da3ab038b [FIX] base, sale_project, project_purchase: convert currencies in profitability
Steps to reproduce:
- create a project with an analytic account;
- create sale orders/invoices and purchase order/bills for a project;
- use other currencies;
- go to the "Project Updates".

Issue:
The amounts are used without being converted
into the currency of the analytic account.

Solution:
Convert amounts used in the currency of the analytic account.

Note:
For performance reasons, it is acceptable to fetch all currency
on the same date to get the conversion rate.
In this case, today's date is the most appropriate
(as the project is in progress).

opw-3193676

closes odoo/odoo#113684

X-original-commit: 68b4ea69c173dd5894bcb42b99e6818f241f9734
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-24 20:14:01 +01:00
Victor Piryns (pivi) 9ffe67a975 [FIX] project_purchase: consider analytic_distribution in costs
Current behaviour:
Project Update doesn't take into consideration the `analytic_distribution`
percentage of the analytic_account on the line of the purchase orders.

Expected behaviour:
Account correctly for the % of the analytic account for the project,
just like in the Accounting app.

Steps to reproduce:
- Install Accounting, Sales, Purchase, Timesheet, Inventory, Project
- Activate "Analytic accounts" in Settings
- Create a product service which is creating a project at sales
- Create a new SO, add the service, confirm the SO and invoice
- Create a new PO, add some random product, on that same line add 2
analytic account, 50% of the SO project we just created, and 50% from any other.
- Confirm the PO
- Go to the SO's project update section, observe the cost is 100% of the line cost, not 50%

Reason for the problem:
`analytic_distribution` ratios are not taken into account when calculation the costs
of the project.

Fix:
Get the ratio of the `analytic_distribution` and multiply by it when processing the costs

Affected versions:
- 16.0
- master

opw-3079537

closes odoo/odoo#108222

X-original-commit: b676222c129863c154efb48e454e144b77157617
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-19 11:33:49 +01:00
Victor Piryns (pivi) 9ed8db4f6e [FIX] project: account invoices/bills in project update dashboard
Current behaviour:
In the project update dashboard, invoices and bills that are created
directly (without sales order or purchase order) are not taken into account
in the calculations for profits/costs.

Expected behaviour:
They should be taken into account, as long as the line on them has the
analytic account line on it.

Steps to reproduce:
- Install Project, Sales, Purchase, Accounting
- Activate "Analytic Accounting" in Settings
- Create a new Project and create a new analytic account for the project
- Create a Bill with a product (storable/consumable) and the analytic account
on the line
- Post the bill
- Go to your project update dashboard and notice the cost of the bill
is not taken into account, but we do have a smart button that goes to the bills

Reason for the problem:
Profits/Costs calculations are done based on the sales/purchase orders,
missing the "orphaned" invoices and bills. A side effect of this problem,
storable products on sales are also not taken into account, since Sales Orders
don't have an analytic account per line before version 16, unless that product
is a service (all services intrinsically have an analytic account)

Fix:
Get all invoices/bills that have lines with the project's analytic account,
and removing from those the lines that were already accounted for.

Affected versions:
- saas-15.3
- 16.0
- master

opw-3058198

closes odoo/odoo#108176

X-original-commit: 3d3f4109a06445b6ce9606770085c763ea206b35
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2022-12-16 17:20:00 +01:00