These changes are made as a result of simplifying attrs and 'states' in
views. However, they should have remained in a separate commit. When
applying the script making the xml changes (used later for the migration
script), the script checked the definition of the python fields in order
to convert the information into a python expression. Therefore, this
commit is not applied when the script is applied to xml changes.
During this attribute deletion pre-existing errors were found. Part of
the code was using the boolean values of 'states' and another part of
the code was not. The behavior could therefore be different (in cases
where readonly on the field had the same value as the ballan in
'states').
Following the deletion of 'states' and without the application of the
view migration, the js tests (tower) were no longer functional. Tests
using the Form view suffered the same effect. There are few tests that
had to be adapted, including two tests in business accounting (updated
by the accounting team). A test for column_invisible did not work. Test
checking if the test system triggers an error if we try to write on an
invisible field. It turns out that Form was testing on the value of
invisible but not taking into account if the column was invisible. The
test system fix is applied separately because there were a lot of tests
that were incorrect.
Part-of: odoo/odoo#104741
Prior to this commit:
When we open the portal view of the project which is project sharing and search
in a project, we have two different filters for searching sale orders and sale
order item which is unnecessary. Hence we can make the search resourceful by
combining both filters just like the working of sale order filter in the Search
View of the project.
Post this commit:
Combining both filters under the name sale order to make a seamless search.
closesodoo/odoo#131810
Task: 3391908
X-original-commit: fb31cea2aeb666e71f49b4f99813bf592a96d6b2
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.
Part of task~3443861
Part-of: odoo/odoo#130467
In this commit, we show a helper message in case there
are no records to show under those section (milestone, profitability,
sales section) in project right side panel.
task-3293012
closesodoo/odoo#128220
Related: odoo/enterprise#43972
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
1. Purpose: be consistent with the information indicated in the
description of the form view + add a way for users to analyze the margin
of their project is relative terms
- updates right-side panel > display the margin % under the margin
- apply the same color code and visibility conditions as for the margin
- The margin section is visible only if there are revenues and costs for
the current project.
2. Purpose: currently, SOLs and associated revenues are only taken into
account in the project updates right-side panel when it is set either on
the project, its tasks or its timesheets. This was designed this way to
manage the use-case where the AA of the project would be linked to
multiple projects. We wanted to avoid duplicate information.However, in
practice, it seems that the current behavior is confusing and is
generating a lot of questions from customers (according to our
colleagues at the support and the PS). IMO, the use-case where an AA
would be shared with multiple projects is not very common and we should
privilege the basic use-case.In addition, even if we have duplicate
information in case of a shared AA, it is still possible to have the
detail per project from the accounting app by setting a corresponding
analytic distribution.
- SOLs and associated revenues should be taken into account in the
project updates right-side panel if their SO share the same analytic
account as the project, regardless if the SOLs are set on the
projects, its tasks or timesheets, or not.
task-3330274
closesodoo/odoo#128439
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.
task 3410198
[1]: 19ea1ac08043e22a811630968e44715cc3bfc495
Part-of: odoo/odoo#125716
Before this commit, when `sale_project` module is installed and not
`sale_timesheet` module, `allow_billable` field is displayed in
Settings tab in form view of project but not in the form view
simplified. In the simplified one, `allow_billable` field is only
displayed when `sale_timesheet` is installed.
This commit displays `allow_billable` field in form view simplified
of `project.project` when `sale_project` is installed to be coherent
with the main form view.
closesodoo/odoo#129584
X-original-commit: ae203aa3cccc1187197ff0be98a884ca8ce6d6d1
Related: odoo/enterprise#44566
Related: odoo/upgrade#4975
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, the `project_enterprise_tour` has a step to
check `allow_billable` field in project to make the new project
billable to get partner field visible. The problem is this step
cannot be achieved if `sale_project` module is not installed.
This commit moves `project_enterprise_tour` is project module
to easily override it in `sale_project` and `project_enterprise`
modules to be sure the tour works when `sale_project` is not installed
and also when that module is installed.
X-original-commit: f09245f4dae4c3503630c9cd92b9d9ab5bfb6e78
Part-of: odoo/odoo#129584
This commit adapts the spaces and table layouts to maintain concistency
with Milk design.
task-3382174
Part of task-3326263
closesodoo/odoo#129571
X-original-commit: 68611ce40f48c6c8a143a24ac05e9ef72a8f69e4
Related: odoo/enterprise#44558
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
_*: hr_timesheet,sale_project,sale_timesheet
Generally, you don't want subtasks to be displayed at the same level
as their parent tasks. You want to consider the subtasks as part of
their parent's project, but don't want to see them directly in this
project. Rather, you want them to be accessible only via their parent.
(There are exceptions to that and we want to stay flexible.)
First solution that comes to mind is to have `project_id` set to False
for the latter tasks, but then how to get the value of the fields that
are related to the project?
So, second solution would be to have a field `project_root_id`,
which would be the project of the parent, or the grand-parent, etc.
The issue now is that we have to fields "project", and it isn't obvious
when to use one or the other.
The most simple way to answer this need is to keep one field "project",
that will always be set for (non-private) tasks,
and create a boolean field : `display_in_project`.
But we want it to be technical (no checkbox in the view).
So, when the user unsets the project on a subtask, the view will act
as if the project was unset, but in the back-end,
we'll set `display_in_project` to False and set `project_id` back.
The fact that all tasks have a project allows us to know if action x
can be perform on this task t, dependind on t.project_id.allow_x.
task-3367246
closesodoo/odoo#128281
Related: odoo/enterprise#43996
Related: odoo/upgrade#4930
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models
These records can be read and used in children companies.
This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
country
task-3371677
closesodoo/odoo#125642
Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
This commit allows creating SOLs on the fly from various places:
- Project employee mapping list view
- Project from view
- Task form view
Task-3278895
This commit hides the "Sales Order Line" field on tasks when no customer is set on them.
It doesn't really make sense to have a SOL without a partner, and it eases other flows to be able to assume that a SOL implies that there is a partner.
Task-3278895
This commit moves the "Sales Order Line" field in the project form view from `sale_timesheet` to `sale_project`,
as the field itself is introduced in `sale_project`
Task-3278895
This commit adds a "Sales Order Line" stat button in project updates to easily search among the SOLs of a project
and be able to create new ones.
Task-3278895
This commit adds a "Sales Order" stat button in the project form view to ease the creation of a SO from a project.
This stat button is displayed if the project is billable and has a partner.
Task-3278895
* = project,timesheet
This commit changes the label when grouping tasks and timesheets by sol in the
portal for records without sol from "No Sales Order Item" to "Not Billed",
which conveys more clearly to the user that the records are not billed.
Task-3278895
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
closesodoo/odoo#122144
Related: odoo/enterprise#41363
Related: odoo/upgrade#4947
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
The test `test_duplicate_project_duplicates_milestones_on_tasks` and the test class `TestSoLineMilestones`
fail when demo data are not installed.
This commit makes it demo data independent.
Task-3410352
closesodoo/odoo#128307
X-original-commit: 9193168d39a808d66e67ad8d5d704d72fdc5f3a0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
-* = sale_timesheet, sale_project
Issue:
Currently, the fields and description are not appeared in the full width in the
project setting.
Technical description:
Currently, the content does not appear in full row because col-lg-6 is given in the
settings component. Other col-lg-6 is empty.So in this commit we have shown content in
full row.
task-3183771
closesodoo/odoo#114405
Related: odoo/enterprise#37802
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Current behaviour:
When creating a new quotation from an FSM task, if we use a template
that adds a line that is a service that would have added a task on
SO confirmation, no new task is generated.
Expected behaviour:
A new task should be created, just like when we add manually the
line with service without using a quotation template.
Steps to reproduce:
- Install FSM
- Activate "Extra Quotations" from Settings
- Create a new service that generates a task on SO confirmations
- Create a new quotation template, add a line that uses the service
we created.
- In a FSM task, click on "New Quotation"
- Add the template to the quotation and confirm it
- Observe there is no Task attached to the SO. No new task was created.
Reason for the problem:
When we create a new quotation view the action "New Quotation", we
add in the context a key `default_task_id` with the current task
that generated the quotation. When we add a template, an onchange is
triggered which creates the lines for the SO, and since we have a
`default_task_id` in the context, the related task of the new line
is set to the task we came from. This prevent subsequently the
creation of a task if the service was supposed to generate a new
task on SO confirmation.
Fix:
Add an override when generating the data used to create the lines
when the onchange is triggered, explicitly setting the `task_id` on
the line to `False` if the key is in the context and the service
would've generated a task.
Affected versions:
- 15.0
- saas-15.2
- 16.0
- saas-16.1
- saas-16.2
- saas-16.3
- master
opw-3360403
closesodoo/odoo#127811
X-original-commit: 06eeefc94f08cc01786c82b769d1c488e0e1c483
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
Current behaviour:
Sale Order Items on a task shows only SO related to the current
customer, or all SO if there is no customer on the task.
Expected behaviour:
If we have a customer on the task, show also SOs from child contact
of that customer (mirror the SO count in `Contacts` app)
Steps to reproduce:
- Install Contacts, Sales, Field Services
- Create 4 contacts, a company, with child contact A and B, a
contact C who is child of A
- For each contact create an SO and confirm a field service product
- Now on any task, add the company as customer.
- In the Sale Order Item we can't select any of the SOs from the
child contacts of the company.
Reason for the problem:
Since 41116c81cd where we wanted to
show all SOs when no `partner_id` was set on the task, we made use
of `=?` operator which is `True` when there is no `partner_id`, but
it matched only for `=` when it's not the case, not taking into
account `child_of` of said contact.
Fix:
Extend the domain with an `OR` to take child contacts if the
`partner_id` is not `False`.
Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- saas-16.3
- master
opw-3374191
closesodoo/odoo#126898
X-original-commit: 027ba2e682ba046459fc60a76e59792fa6bbeda9
Related: odoo/enterprise#43395
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
Before this commit, when the user installs `sale_project` and some
of his projects has no partner set but a partner is set on some
tasks of those projects then the user will no longer see the partner
field in those tasks because the project is not billable.
This commit checks if one of the tasks has a partner set to make the
project linked billable if it is not yet the case.
closesodoo/odoo#126880
X-original-commit: b0cb255577a7a0c49c2c764dbad715d3842b9508
Related: odoo/enterprise#43384
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Current behaviour:
Any product type of product that is sellable can add
`service_tracking` option on the product.
Expected behaviour:
`service_tracking` should be available only for services that are
sellable.
Steps to reproduce:
- Install `sale_project`
- Create a new product, type `consu`
- Observe we have the `service_tracking` option available (create
project/task/project&task on SO confirmation)
Reason for the problem:
Incorrect domain for the `service_tracking` field in the view.
Fix:
Correct domain for the field. The field should be `invisible` only
when the product `type` is not a service *or* it's not sellable.
Affected versions:
- saas-16.3
- master
opw-3366909
closesodoo/odoo#126750
X-original-commit: 1634019df17d25167bad091933d757f706f7549b
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
It's not a specific state, it should be considered separately,
as a boolean.
This allows to reduce code complexity (flows should not rely (much) on
the locked logic) and to have a clearer flow.
Task-3163931
Part-of: odoo/odoo#115871
The following changes are made in this PR:
- sort projects by favorite > sequence > name for project
- add the 'tasks' stat button for project form view
- when creating a project on the fly from a task's form view, allow_billable
should be set to true by default
- Display only the colored dot, hide the status label for project list view
- remove following fields from project
allow_recurring_tasks
task-3251656
closesodoo/odoo#119154
Related: odoo/upgrade#4569
Related: odoo/enterprise#40050
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit SOL field on task visible when user no
sale access and field is set but SOL field is readonly when
user has no sale access there is not point showing readonly
empty field.
This commit hide SOL field when user has no sale access and
field is not set.
task-3186438
closesodoo/odoo#115474
Related: odoo/enterprise#38186
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
New features developed in this PR:
- Write Javascript tests for the project.task.state widget
- Tests are in the project_task_state_selection.js
- rewrite Research & Development demo data
- Created a digest tip for task state selection (in Settings > technical > digest tips)
- Tip: Use task state to keep track of the task progression
- Fix Sharingview (Readonly) icons for the project.task.state widget, previously only the color bubble were displayed in readonly sharing views, now all of the icons are displayed
- Display state in the Calendar view
- Display the same widget as in the kanban/list views
- Remove is_closed References
- Adapt Kanban stages Exemples
- Kanban exemples are available when creating a new stage in kanban view
- improve Progressbar colors (different color for approved/done, in_progress/waiting)
Task-3213526
closesodoo/odoo#117968
Related: odoo/enterprise#39714
Related: odoo/upgrade#4548
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, when the user set a subtask and wants to directly
set the SOL of that subtask in the subtree view of a task form view. He
cannot because the field is in readonly.
This commit makes the field editable if the user has access to Sales app
as it is the case for the SOL field in the form view of task.
task-3336215
closesodoo/odoo#124563
X-original-commit: 0373abdf24e1139706e6d7610873cc89ada60e74
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Allow timesheeting on sub-tasks with no project_id set.
Instead, refer to the project_id set on its parent_id, and so on,
recursively.
task-3336215
X-original-commit: d794e41619a36a8c9ad1e77a816e57051207cdcf
Part-of: odoo/odoo#124563
Steps to reproduce:
-------------------
- create two product of type "service";
- field "Create on Order" is set to "Project & Task";
- create a Sale Order with these two products;
- condirm the Sale Order;
Two tasks are created in a project and each task has its own Sale Order Line Item.
- create a subtask from both tasks respectively;
- select a project for the subtask.
Issue:
------
The same Sale Order Line is selected for the two subtasks.
It always take the first Sale Order line.
Cause:
------
To choose the sale order line, we first look to see if
the subtask belongs to a project.
If so, we take the sale order line which created the project.
Unfortunately, a subtask can belong to a project created with
a sale order line without belonging to the same sale order line
(in the case where a task is added to a project via another product
and therefore another sale order line).
Solution:
---------
- A project without parent --> use project's sale order line
- A parent without project --> no sale order line defined
- A parent in the same project --> use parent's sale order line
- A parent in an other project --> use parent's sale order line
opw-3333936
closesodoo/odoo#124260
X-original-commit: 323d7f631916f5acc5ab34f8531ae59bb0455828
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Current behaviour:
If in 1 SO we have 2 service lines, each making their own project (for
ex: 1 with a template project, the other without), these 2 lines are
present in both project profitability report, skewing the margins,
as costs calculated on a per-project basis, while sol are aggregated.
Expected behaviour:
Don't include services that have their have another project than the
current one in the profitability report. (Project profitability `A`
shouldn't show services that are linked to project `B`).
Steps to reproduce:
- Install Sales, Project, Accounting, Timesheets
- Activate Analytic Accounts in Settings
- Create a project template
- Create 2 service products, both create a Project when confirming
the SO, one has no project template, the other has a template (the
one we create just beforehand)
- Create an SO, add the 2 lines, 1 for each service, 5 and 3
quantity respectively > Confirm SO
- Go to the Project's Update panel of either created project, we can
see that both lines are present. If you timesheet in a task in
either project, it will show up in both project's profitability
report.
Reason for the problem:
In some places, when we are constructing the domain that is used to
fetch the sale order lines that will be added to the profitability
items, we fetch the correct sol (only linked to this project), then get
the sale order linked to this line, and we search all lines related
to that SO (so we included products that are not services, for
example materials necessary for a service). This flow includes lines
that may be linked to other projects.
Fix:
We fetch SOL linked to the current project or that have no project
(for materials).
⚠️ **known limitation** Material lines are shared between
projects (because of `('project_id', '=', False)`), but that's
already current behaviour, even before this fix.
Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- saas-16.3
- master
opw-3300322
closesodoo/odoo#123803
X-original-commit: d0735a6168f5c019d5c03190f930882addd2496a
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
Current behaviour:
All sold services in another currency than the companie's one are not
being converted in the project profitability, but the currency
symbol is correctly set to the one of the project. (related to company)
Expected behaviour:
Sold services in another currency should be converted in the project
profitability.
Steps to reproduce:
- Install Sales, Accounting, Project, and a localization (ex: Sweden)
- Switch to the Swedish company.
- Settings:
- Activate analytic accounts
- Make sure the company currency is SEK
- Update the conversions rates of the currencies
- In products: create a new service (ex: $100)
- Create a new project (make sure it creates an analytic account)
- Sell 1 unit of that service, make sure the pricelist before adding
the line is "USD Public pricelist" (so the line should be $100),
add the analytic account to the line. Confirm the SO.
- Add a task in the project, and add the SO as ref to it.
- Go to the project profitability panel, observe that the value of
the service we just sold is 100 kr (the value of $100, but with
the symbol for SEK kr).
Reason for the problem:
Lack of currency conversion for services when computing the
profitability items for the project update panel.
Fix:
Similar fix to 68b4ea69c173dd5894bcb42b99e6818f241f9734, but in that
fix we missed the conversion for revenues coming from analytic
accounts (aka services).
Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- master
opw-3274626
closesodoo/odoo#123527
X-original-commit: bf8766b4c15946adac9e2e16a31f11df54cb30f8
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
The purpose of this PR is to improve the generic usage of the project app.
So in this PR done following changes:
- switched Sales Orders button and planning, document button from their place in
the project kanban card burger menu
- In milestone form view added decoration-danger on quantity % if it is equal
to 0 and there is an SOL set
- On milestone creation the SOL of the project set default if it is of
milestone type
- In the product form view Uom is set as 'hours' if the service is either
prepaid or invoiced based on timesheets.
- In project.milestone list view changed quantity_percentage label to
to Quantity(%).
- Added product_uom_qty field in project.milestone list view .
- In project.sharing improved remaining hours widget now only the frame is
displayed in orange/red, not the background (as in the back-end)
- project.update right-side panel added the ref of the SO in the nameget
of the SOL
- In project.update right-side panel added Confirmation when trying to delete
a milestone
- Reduced the size of project and task sharing wizard
task-2989828
closesodoo/odoo#106284
Related: odoo/upgrade#4198
Related: odoo/enterprise#34322
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit:
- When a project is created on SO confirmation,
the new project (assuming there is no project template
set on the product) is added with one stage with name=New
- When portal users drag & drop columns from the kanban view
of project.task, an access rights error is displayed.
After this commit:
- When a project is created on SO confirmation,
set the following stages for the new project
(assuming there is no project template set on the product):
to do - in progress - done (folded) - canceled (folded).
- Disable dragging and dropping project tasks for portal
user.
task-2929871
closesodoo/odoo#97220
Related: odoo/enterprise#29911
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit's purpose is to take into account the down payments for the
project profitability of the project update window.
Currently, if an SO has a total of 300$, and a down payment is created for 100$, the project
profitability will not compute the 100$ into the 'amount_invoiced'
column. After this commit, it will. A negative value of -100 is also
added in the 'amount_to_invoice' column in order to keep the total of
that column, and the total of the 'expected' column of the project
update consistent with the total of the SO.
task-3204827
closesodoo/odoo#116293
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
view
The goal of these changes is to make it easier for the user to manage
their SO. They can create new tickets/timesheets/etc without being
forced to leave the application to open the one they need, nor do they
need to manually link the new record to the SO
task-2954409
closesodoo/odoo#100300
Related: odoo/enterprise#31391
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.
This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
In the multi-company context, it is possible to create
an analytic account without a defined company.
The result is that the analytic account
will not have a currency.
A traceback will be triggered when calculating the
profitability of a project
(for example by changing its status when
the 'sale_timesheet' module is installed).
Solution:
Use the currency of the project.
Introduced by:
68b4ea69c173dd5894bcb42b99e6818f241f9734
opw-3292417
closesodoo/odoo#121143
X-original-commit: 90512da68f776459a8a65bed285f5a178f9dd77d
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Current behaviour:
If we confirm an SO with a service with a delivery based on
milestones, that creates both a project & task, and we set a project
on the SO, the project for the milestone should be the one set on
the SO, a ValidationError is raised for missing project on milestone.
Expected behaviour:
No ValidationError, the milestone should use the project set on the SO.
Steps to reproduce:
- Install Sales, Project
- Check Milestones in Settings
- Create a new project.
- Create a new product, type service, delivery milestones, on
confirm create project & task
- Create an SO, add a line with the new product.
- Set a our new project on the SO (In the "Other Info" tab)
- Confirm the SO, you are met with a ValidationError.
Reason for the problem:
Since we are not *generating* a new project, `project_id` on the
sale_order_line is empty, and we base ourself on it when creating
the milestone in `_generate_milestone`, leading to the non-null
validation error, because this field is `required=True` on milestones.
Fix:
When creating the milestone in `_generate_milestone`, if the line
doesn't have a `project_id`, we take the one set on the order.
We don't set the `project_id` to the *determined_project*
(`_determine_project`) at line 305
(after: `so_line._timesheet_create_task(project=project)`) because
the `project_id` on the sale_order_line is marked as "Generated
Project", which is not true in our case (the project isn't generated
by the sale order line).
Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- master
opw-3236235
closesodoo/odoo#121141
X-original-commit: 811bbf05722bc69d461306a8890235541c571457
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Current behaviour:
In the project update section, if the project has only draft
invoices linked to the analytic account of the project, the invoices
smart button isn't present. But once we have at least 1 posted
invoice, the button is shown, and when triggering the action, we see
both the posted invoice and all the draft invoices that were not
shown previously.
Expected behaviour:
The button should be visible, even if the only invoices linked to
the analytic account of the project are only in draft.
Steps to reproduce:
- Install Project, Sales, Accounting
- Activate Analytic Accounting in the Settings
- Create a Project and make sure it has an analytic account linked to it
- Create a new invoice in draft, make sure on the line you have set
the analytic account of the project we just created. Save.
- Go to the project update page, there is no smart button that will
go to the invoice we just created.
Reason for the problem:
The Invoices smart button is shown only when the `invoice_count` is > 0.
`invoice_count` is a related field to the same field name of the
analytic account, which is a compute. In that compute we explicitly
only take invoices that are posted, since in the context of an
analytic account, it only makes sense to take actually posted
invoices, since those are real revenues. So the button is shown only
when we have at least 1 posted invoice. The action itself is just
fetching all the `in_invoice, out_refund` invoices that are linked to
this analytic account.
Fix:
Transform the `invoice_count` in `sale_project` module from a
related to a regular compute and do a query with the same heuristics
for the action of the invoice smart button.
Affected versions:
- 16.0
- saas-16.1
- saas-16.2
- master
opw-3227421
closesodoo/odoo#119578
X-original-commit: 1b45e22530cb07ca437d2fd53bda3af2c918c223
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Purpose of this commit have consistent list views between
project.task and the sub-tasks / blocked by o2m so that when
a change is done in one place it also impacts the other
places.
So, in this commit add/update sub-task and blocked by page list
views to make them identical.
task-3165202
closesodoo/odoo#112620
Related: odoo/enterprise#37055
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Purpose of this commit to avoid having a default group by that
would impact all views without distinction by using the new
attribute that was recently introduced for the list view.
So this commit add group the kanban and list views by stage by
using an attribute on list and kanban view instead of a default
group by in action.
task-3165202
Part-of: odoo/odoo#112620