Monday, November 30, 2020
28 changes · master
Enhancements to existing features
This change adds coverage to ensure the system handles missing external identifiers correctly during inheritance-related module loading. It helps reduce the risk of hidden setup or upgrade issues in dependent modules.
Original PR description
Task: 2235368
This update introduces a clearer, standardized way for developers to manage linked records behind the scenes while keeping existing integrations compatible. It improves code readability and maintainability across core areas and the Mail app, reducing the chance of mistakes in future changes.
Original PR description
One2many and Many2many use a special "command" to manipulate the set of records stored in/linked to the field. There is a total of 7 commands: create, update, delete, unlink, link, and set. * The…
One2many and Many2many use a special "command" to manipulate the set of records stored in/linked to the field. There is a total of 7 commands: create, update, delete, unlink, link, and set. * The **create** command (id: 0) is used to create a new record in the related model and to link it in the current record. * The **update** command (id: 1) is used to update the targeted record id with new values. * The **delete** command (id: 2) is used to both remove the target record id from the related table and to remove its link from the current record. * The **unlink** command (id: 3) is used to remove the link to the targeted record id from the current record. * The **link** command (id: 4) is used to link the targeted record id which exists already in the related model in the current record. * The **clear** command (id: 5) is used to empty the list of linked record ids. * The **set** command (id: 6) is used to replace the list of linked record ids with the provided. Each command is a tuple with up to 3 elements, the second and/or third element is ignored when it is not applicable to the command: * the mandatory command identifier * the targeted record id (1, 2, 3, 4) * create/write values dictionary (0, 1) or target record ids (6) -- Before this contribution, the several commands did not have a standardized name, the tuples were just hard-coded with the integer identifier. For long developers have been complaining the commands were hard to write and hard to read mainly due to the meaningless integer. This contribution provide a new namespace with the constants and functions desired to ease writting and reading the x2many commands. All modules have been updated to use the new constants instead of the integer identifier. Task: 2366606 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
The website editor's table picker now expands beyond its container instead of being trapped behind scrolling. This makes it easier for users to choose table sizes when editing content.
Original PR description
Description of the issue/feature this PR addresses: The table picker is hard to use because its container scrolls instead of letting it overflow. Desired behavior after PR is merged: The table picker expands outside of the container. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Miscellaneous changes
The kanban quick create is meant to stay open if a click event is triggered within a modal, which was working for most cases before this commit. However, there are some specific tricky cases when the behavior is incorrect. Issues were mainly observed when using the many2one widget inside a quick create card. When typing something into a many2one widget and then focusing out of it, the widget has a built in feature that asks the user if he wants to create the record (based on options a
Original PR description
The kanban quick create is meant to stay open if a click event is triggered within a modal, which was working for most cases before this commit. However, there are some specific tricky cases when the…
The kanban quick create is meant to stay open if a click event is triggered
within a modal, which was working for most cases before this commit.
However, there are some specific tricky cases when the behavior is incorrect.
Issues were mainly observed when using the many2one widget inside a quick
create card.
When typing something into a many2one widget and then focusing out of it, the
widget has a built in feature that asks the user if he wants to create the
record (based on options and necessary create rights).
This implies to open a modal asking the user to create or discard his input.
When you combine a many2one widget IN a kanban quick create card, then type
something in the many2one and click outside of the quick create, it triggers
BOTH the focus out event of the many2one and the click event of the kanban
quick create that verifies if it should be closed.
This click event creates a race condition but the following behavior happens
most of the times:
- The many2one 'focusout' is triggered first, creating the modal to confirm
record creation (see FieldMany2One#_onInputFocusout) ;
- The click event is registered second, triggering the quick create check to
see if it should be discarded (see RecordQuickCreate#_onWindowClicked) ;
- The click is technically registered outside of the modal since the modal was
not created yet. This behavior differs a bit between browsers:
- On Firefox the click event correctly targets the actual element that was
clicked (ex: another kanban card) ;
- On Chrome it varies between the actual element (same as Firefox) and
sometimes the raw 'body' element.
- The quick create card will then incorrectly consider the click as outside of
any condition to keep itself open and will close and destroy itself ;
- Which in turn destroys the FieldMany2One and the record creation modal ;
- (If you look carefully on the screen you can see a slight flicker when that
happens).
During all my testing, only one condition will stay consistent when focusing
out of the FieldMany2One by clicking somewhere else: the body element will
always have the "modal-open" class by the time the click event is triggered in
the RecordQuickCreate.
This is why relying on the condition that an element exists with the
"modal-open" class to avoid closing the quick create card provides better
results and seems to suit all necessary conditions and behaviors.
Task 2388450
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#62426
Forward-Port-Of: odoo/odoo#61981Odoo now gives internal fields default display names when they are accessed directly from Python code. This prevents confusing output or infinite loops in developer workflows, improving reliability without changing day-to-day business features.
Original PR description
From python code, import a module class and print one of its field, it creates an infinite recursion due to `model_name` and `name` field attributes being accessed by `__str__` but only being set when accessing a model through the environment. This commit provide a default values for the field name and the field model name to prevent that infinite recursion.
In order to avoid eventual future issues, this PR adds a filter on the journal field of journal entries to only allow selecting misc journals task id #2371198 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61223
Original PR description
In order to avoid eventual future issues, this PR adds a filter on the journal field of journal entries to only allow selecting misc journals task id #2371198 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61223
During the accounting tour, users are invited to upload one of their bills, send one by mail, or use a sample bill. For the last one, the returned action which opens a list view with the new move does not have the correct context, which makes clicking on 'create' launch the creation of a journal entry and not a vendor bill. This will make sure the context is correctly set in this case. task id #2368810 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/sub
Original PR description
During the accounting tour, users are invited to upload one of their bills, send one by mail, or use a sample bill. For the last one, the returned action which opens a list view with the new move does not have the correct context, which makes clicking on 'create' launch the creation of a journal entry and not a vendor bill. This will make sure the context is correctly set in this case. task id #2368810 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#61247
Courtesy of Transifex's translators for reporting bad/unclear sentences. Forward-Port-Of: odoo/odoo#62539
Original PR description
Courtesy of Transifex's translators for reporting bad/unclear sentences. Forward-Port-Of: odoo/odoo#62539
Behavior prior to the fix: - when adding a filter on "Quantity < 0" (or > 0) on the forecast inventory report the quantity reported becomes incorrect: for example if there is a restock on Tuesday and a shipment on Friday that drives the forecasted quantity into a negative, the forecasted inventory report instead reports a negative quantity on Monday. - the problem occurs because the view the report is based on is built using positive and negative entries that are supposed to cancel each
Original PR description
Behavior prior to the fix: - when adding a filter on "Quantity < 0" (or > 0) on the forecast inventory report the quantity reported becomes incorrect: for example if there is a restock on Tuesday and…
Behavior prior to the fix: - when adding a filter on "Quantity < 0" (or > 0) on the forecast inventory report the quantity reported becomes incorrect: for example if there is a restock on Tuesday and a shipment on Friday that drives the forecasted quantity into a negative, the forecasted inventory report instead reports a negative quantity on Monday. - the problem occurs because the view the report is based on is built using positive and negative entries that are supposed to cancel each other when accounting for stock items (quant). This way the quantity is reported as 0 before the quant is moved in the inventory (there is a positive entry for the quant, and a negative entry for the move up to the move effective date). But when a filter on quantity is placed the "cancelling" entries are not loaded and the report ends up with just the negative value Behavior after the fix: - the quantities are reported as expected: with a negative on Friday, and 0 on the days before - to achieve this the view was modified to perform the grouping of forecast entries inside of the view. This way we have one row per product / day / state and we don't risk selecting only part of the report. - as the view is only read in aggregate there will not be any visible changes to its consumers opw-2379098 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62457 Forward-Port-Of: odoo/odoo#62064
### Goal of the PR This PR is mainly a revert to 13 functionalities in project_* modules as functional changes introduced in 14 do not seem to be well accepted by users. ### Details - sale_timesheet: rename 'Ordered quantities' service_policy into 'Prepaid' - project, sale_project, sale_timesheet: refactor task form view - sale_timesheet: modify sale_line_employee_ids many2one widget on project form - sale_timesheet: add link between ticket and sale order - sale_timesheet: remove the
Original PR description
### Goal of the PR This PR is mainly a revert to 13 functionalities in project_* modules as functional changes introduced in 14 do not seem to be well accepted by users. ### Details - sale_timesheet:…
### Goal of the PR This PR is mainly a revert to 13 functionalities in project_* modules as functional changes introduced in 14 do not seem to be well accepted by users. ### Details - sale_timesheet: rename 'Ordered quantities' service_policy into 'Prepaid' - project, sale_project, sale_timesheet: refactor task form view - sale_timesheet: modify sale_line_employee_ids many2one widget on project form - sale_timesheet: add link between ticket and sale order - sale_timesheet: remove the option 'link to an existing SOL' - sale_timesheet: remove the warning messages in project.task - sale_timesheet: reword labels in customer_type and pricing - sale_timesheet: adapt timesheet section on invoices in portal - sale_timesheet: add timesheet section on orders in portal - sale_timesheet: remove employee rate related warning on projects in Kanban view - sale_timesheet: update sale_line_id of all the not invoiced timesheets accordingly to the employee mappings - sale_timesheet: timesheet entries for employees that have no mapped SOL in project get the sol of the task or project task-2388500 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62360
This commit fixes the step trigger: '#o_website_links_link_tracker_form #generated_tracked_link:contains("/r/")' that was taking too long because of a call to _get_title_from_url happening during the creation of a 'link.tracker'. Before this commit the automated tests of website_links did trigger an http request on the 'contactus' page which sometimes took too long to respond and reached the test failure timeout. After this commit the information obtained from this request is hard-
Original PR description
This commit fixes the step trigger:
'#o_website_links_link_tracker_form
#generated_tracked_link:contains("/r/")' that was taking too long
because of a call to _get_title_from_url happening during the creation
of a 'link.tracker'.
Before this commit the automated tests of website_links did trigger an
http request on the 'contactus' page which sometimes took too long to
respond and reached the test failure timeout.
After this commit the information obtained from this request is
hard-coded to avoid the unpredictable timing of the test.
This commit is a manual port of #62479.
task-2397724
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#62508This commit forces the default value of the mail.mail 'state' field to 'outgoing' (the default field value), when notifying the record by email. Without this change, there can be a collision when the ORM tries to compute default values for this state field. For example: - Model "A" has a 'state' field ; - Create an action that redirects to model "A" form view, setting some default values in the context such as {'default_state': 'done'} ; - Model "A" has an inherit on 'mail.thread' and
Original PR description
This commit forces the default value of the mail.mail 'state' field to 'outgoing' (the default field value), when notifying the record by email. Without this change, there can be a collision when the…
This commit forces the default value of the mail.mail 'state' field to
'outgoing' (the default field value), when notifying the record by email.
Without this change, there can be a collision when the ORM tries to compute
default values for this state field. For example:
- Model "A" has a 'state' field ;
- Create an action that redirects to model "A" form view, setting some default
values in the context such as {'default_state': 'done'} ;
- Model "A" has an inherit on 'mail.thread' and a 'user_id' field to set a
responsible user ;
- Model "A" record is created with a responsible user, who is automatically
notified by email that the record "has been assigned to him" ;
(see mail_thread#_message_auto_subscribe_notify)
- A 'mail.mail' is in turn created ;
- The 'mail.mail' model ALSO has a 'state' field, and the context is propagated
so the ORM will try to assign 'done' to that field, which is an incorrect
value ;
- -> Crash.
If we ensure that the value of the state is set to 'outgoing' for that record,
we bypass the default values computation for the 'state' field and everything
works fine.
A test was added to make sure this works properly.
Task 2393259
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#62545
Forward-Port-Of: odoo/odoo#62339Steps: - Install Contacts - Have Multi-Companies enabled - Go to a Contact of type "Company" - Click "Sales & Purchases" - Assign it the company you're on - Save and Edit again - Remove the assigned company - Go to a contact of type "Individual" linked to this company - Click "Sales & Purchases" Bug: The company has not been deleted on the linked Individual Explanation: When we delete the company of a contact, the value of `vals.get('company_id')` is `False`. This is why it did
Original PR description
Steps:
- Install Contacts
- Have Multi-Companies enabled
- Go to a Contact of type "Company"
- Click "Sales & Purchases"
- Assign it the company you're on
- Save and Edit again
- Remove the assigned company
- Go to a contact of type "Individual" linked to this company
- Click "Sales & Purchases"
Bug:
The company has not been deleted on the linked Individual
Explanation:
When we delete the company of a contact, the value of `vals.get('company_id')` is `False`.
This is why it didn't enter the propagation process.
This fix makes sure we can still remove a company from a contact linked to a user.
Related: https://github.com/odoo/odoo/pull/62418
opw:2391464
Forward-Port-Of: odoo/odoo#62506Fix field removal introduced in bed22b10322882802cb0435088f9731ebbdf634e -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62579
Original PR description
Fix field removal introduced in bed22b10322882802cb0435088f9731ebbdf634e -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62579
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62494
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62494
This rule was generating a lot of noise for very little gain. Forward-Port-Of: odoo/odoo#62598
Original PR description
This rule was generating a lot of noise for very little gain. Forward-Port-Of: odoo/odoo#62598
Issue - Install Sales - In Sales > Configuration > Settings -> Enable "Sale Warnings" - Go to Sales > Orders > Customers - Pick a customer/company - Go in Edit mode and go to "Internal Notes" tab - Switch "Warning on the Sales Order" from "No Message" to "Warning" and add any warning message then save - Press the "$ X Sales" smart button - Create a new Quotation - Validate the warning message - Go back to the previous menu (using the breadcrumb) or save the quotation - Cr
Original PR description
Issue - Install Sales - In Sales > Configuration > Settings -> Enable "Sale Warnings" - Go to Sales > Orders > Customers - Pick a customer/company - Go in Edit mode and go to "Internal Notes" tab -…
Issue - Install Sales - In Sales > Configuration > Settings -> Enable "Sale Warnings" - Go to Sales > Orders > Customers - Pick a customer/company - Go in Edit mode and go to "Internal Notes" tab - Switch "Warning on the Sales Order" from "No Message" to "Warning" and add any warning message then save - Press the "$ X Sales" smart button - Create a new Quotation - Validate the warning message - Go back to the previous menu (using the breadcrumb) or save the quotation - Create a new quotation The quotation form editor does not appear. Cause If we use the breadcrumb (or save then create), it will call the `_reload` function (instead of `load` when the form view hasn't been opened yet). In this case, creating a new record, it will call `_makeDefaultRecord` without setting `allowWarning` param to true (like it is done in the ref. commit bellow). Solution Set `allowWarning` param to true before calling `_makeDefaultRecord`. related commit : https://github.com/odoo/odoo/commit/a41db9a2cf410bb233b021651a5633180eaddf18 opw-2374857 Forward-Port-Of: odoo/odoo#62534 Forward-Port-Of: odoo/odoo#62204
Create a automated action on deletion that send an email, delete a related record. The email is not sent. Email are linked to their chatter message, when the later is deleted the former is deleted in cascade too. This is a known limitation of the mail model. Task: 2151519 Forward-Port-Of: odoo/odoo#62606 Forward-Port-Of: odoo/odoo#44840
Original PR description
Create a automated action on deletion that send an email, delete a related record. The email is not sent. Email are linked to their chatter message, when the later is deleted the former is deleted in cascade too. This is a known limitation of the mail model. Task: 2151519 Forward-Port-Of: odoo/odoo#62606 Forward-Port-Of: odoo/odoo#44840
…entry after migration In 13.0, create a statement line and process it by creating a custom journal item in any reconcile account. At this point, a journal entry has been created and is linked to both a payment and a statement line. Migrate to 14.0. Now, try to reconcile manually the custom journal item with anything. Because the matching number is written on the line, it triggers the synchronization between the payment and the entry but it fails because the manual entry doesn't really loo
Original PR description
…entry after migration In 13.0, create a statement line and process it by creating a custom journal item in any reconcile account. At this point, a journal entry has been created and is linked to both a payment and a statement line. Migrate to 14.0. Now, try to reconcile manually the custom journal item with anything. Because the matching number is written on the line, it triggers the synchronization between the payment and the entry but it fails because the manual entry doesn't really look a valid payment. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62610
You may have inactive warehouses for some companies and then, when recreating missing warehouses, you try to create same warehouses for those companies, but you can't because there is an unique constraint. We should avoid violating that constraint due to having inactive warehouses. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62603
Original PR description
You may have inactive warehouses for some companies and then, when recreating missing warehouses, you try to create same warehouses for those companies, but you can't because there is an unique constraint. We should avoid violating that constraint due to having inactive warehouses. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#62603
task-2394789 Forward-Port-Of: odoo/odoo#62449
Original PR description
task-2394789 Forward-Port-Of: odoo/odoo#62449
https://github.com/odoo/odoo/commit/1b273d4c11e3e8d8583de302b71b2522a71f4d1d added the 'general' value to invoice_filter_type_domain, neglecting that this field was used for filtering tax_ids field of account.move.line, and hence making it impossible to select any tax in that field when creating a misc. operation manually. This commit does what the initial fix intended without breaking the taxes. Forward-Port-Of: odoo/odoo#62618
Original PR description
https://github.com/odoo/odoo/commit/1b273d4c11e3e8d8583de302b71b2522a71f4d1d added the 'general' value to invoice_filter_type_domain, neglecting that this field was used for filtering tax_ids field of account.move.line, and hence making it impossible to select any tax in that field when creating a misc. operation manually. This commit does what the initial fix intended without breaking the taxes. Forward-Port-Of: odoo/odoo#62618
task-2387825 Forward-Port-Of: odoo/odoo#62393
Original PR description
task-2387825 Forward-Port-Of: odoo/odoo#62393
Previously, in company form view, avatar was not clickable due to a `block` div that was overlapping the avatar widget and preventing clicking on it. This commit fixes the issue by preventing the overlap and thus making the image widget on company form clickable. Note that another fix would be to remove `partner_gid` from the company form view (it's already the case in 14.0). In this case "oe_title" is directly followed by .o_form_view .oe_avatar and a padding-right: 100px is applied
Original PR description
Previously, in company form view, avatar was not clickable due to a
`block` div that was overlapping the avatar widget and preventing
clicking on it.
This commit fixes the issue by preventing the overlap and thus making
the image widget on company form clickable.
Note that another fix would be to remove `partner_gid` from the company
form view (it's already the case in 14.0).
In this case "oe_title" is directly followed by .o_form_view .oe_avatar
and a padding-right: 100px is applied:
.o_form_view .oe_avatar + .oe_title {
padding-right: 100px;
}
However, considering stable version, changing fields position
should be avoided.
Task Id: 2231950
Forward-Port-Of: odoo/odoo#53798Behavior prior to this commit: In some cases, the `depreciation_number_import` field is left as NULL in the database, and thus the report does not calculate the depreciation rate. For example, this happens if the asset is created automatically by posting a vendor bill with an account that is set up to create assets. Behavior after this commit: Report SQL statement will handle the NULL value and treat them as 0 Note: The setting of default values on fields is not consistent be
Original PR description
Behavior prior to this commit: In some cases, the `depreciation_number_import` field is left as NULL in the database, and thus the report does not calculate the depreciation rate. For example, this happens if the asset is created automatically by posting a vendor bill with an account that is set up to create assets. Behavior after this commit: Report SQL statement will handle the NULL value and treat them as 0 Note: The setting of default values on fields is not consistent between records created via the UI, and records created programmatically. This is because for records created via the UI, the `onchange` method is called initially to retrieve defaults, which may include implicit defaults set via the field type (in `convert_to_record`). opw-2391268 Forward-Port-Of: odoo/enterprise#15013
Purpose ======= If the SEPA file validation is failing, we should be able to recreate the file after having fixed the different issues (wrong bank account, etc...) TaskID: 2393748 Forward-Port-Of: odoo/enterprise#14981
Original PR description
Purpose ======= If the SEPA file validation is failing, we should be able to recreate the file after having fixed the different issues (wrong bank account, etc...) TaskID: 2393748 Forward-Port-Of: odoo/enterprise#14981
## Helpdesk - (helpdesk_timesheet,helpdesk_sale_timesheet) allow_billable=True when use_helpdesk_sale_timesheet=True: Before this PR, when the user checks the 'time reinvoicing' and saves in helpdesk.team, if the helpdesk_sale_timesheet is not installed, the generated project will not contain the allow_billable set to True. Because the generation of this project is made in **_init_data_create_project** method when helpdesk_timesheet is loaded or in write method of helpdesk.team defined in hel
Original PR description
## Helpdesk - (helpdesk_timesheet,helpdesk_sale_timesheet) allow_billable=True when use_helpdesk_sale_timesheet=True: Before this PR, when the user checks the 'time reinvoicing' and saves in…
## Helpdesk
- (helpdesk_timesheet,helpdesk_sale_timesheet) allow_billable=True when use_helpdesk_sale_timesheet=True: Before this PR, when the user checks the 'time reinvoicing' and saves in helpdesk.team, if the helpdesk_sale_timesheet is not installed, the generated project will not contain the allow_billable set to True. Because the generation of this project is made in **_init_data_create_project** method when helpdesk_timesheet is loaded or in write method of helpdesk.team defined in helpdesk_timesheet module. In this PR, we add **_post_init_hook** in helpdesk_timesheet and helpdesk_sale_timesheet modules to generate project in helpdesk.team in the last module installed (case when the user checks 'Time Reinvoicing'
and 'Timesheet on Ticket'). If the user checks only 'Timesheet on Ticket' and saves the project has right generated with allow_billable=False. After that, if the user checks 'Time Reinvoicing', then we set the allow_billable in this generated project to True.
- (helpdesk_sale_timesheet) Update the creation of the sale order in ticket: Before this PR, we can create a sale order, if the allow_billable in the project linked in the ticket is set to False. Because, before the allow_billable=False means the pricing type is equal to "Task rate". But now it's not the case, it means that the project can't be invoiced. Moreover, when the user wants to create a sale order from a ticket in which the pricing type is equal to "project rate" or "employee rate" in the project linked, then the quantity in the first sale order line stay to 0. It's because the ticket is not linked to a task and then the timesheet is not linked in the first sale order line of the sale order created. In this PR, we change the condition for the visibility of the "create sale order" button to fit with the configuration of the project linked to the ticket. And we add a context key called "timesheets_on_ticket" to give the timesheets in the ticket to the wizard for the creation of the sale order. With this key, if the project in the ticket does not contain a task then the timesheets in the ticket are correctly linked in the first sale order line of the new sale order.
- (helpdesk_sale) Hide the sale_order_id field in form view of ticket.
- helpdesk_timesheet: Remove the warning messages in ticket: When the user changes the task of a ticket in Helpdesk App. We displayed a warning message about the impact of this changes. This warning message was useful to inform the user that is a change in the behaviour compared to the previous version of Odoo. But each time, the warning message appears and it can be boring for the user. That's why we remove the warning message.
- (helpdesk_sale_timesheet) Add stat button in ticket: we add a stat button in form view of helpdesk.ticket model. This button allows the user to see the sale order linked with the current ticket. This button only appears if the user has the group_sale_salesman group **and** use_helpdesk_sale_timesheet=True in helpdesk_team **and** it exists a sale order linked in the current ticket.
## Field Services
- (industry_fsm_sale): invert allow_quotations default logic: that is, we want this button will appears only for the fsm projects only by default.
- (industry_fsm and industry_fsm_sale): refactor task form view:
- we change the visibility of the phone field, this field is visible if is_fsm is True.
- we hide the sale_line_id field when allow_billable is False or is_fsm is True.
- (industry_fsm_sale) Hide sale order in task if non billable: When the allow_billable=False in the fsm project, we should not see the sale order in the form view of project.task as it's the case for the sale order line field in the same model.
- (industry_fsm_sale) Prevent the user to configure fsm project with employee_rate or project_rate: Indeed, the fsm project doesn't correctly work to create sale order when it is configured as project_rate or employee_rate. That's why this commit allows only to configure a fsm project with task rate. Moreover, when the user creates or updates a project to have a fsm project, we need to be sure that the sale_line_id field in project is not set to respect the sql_constraint.
- (industry_fsm_sale) Hide Sale Order if the project is not fsm project: we hide this field in the form view of project.task.
- (industry_fsm_sale) Sale Order can just be selected in task of fsm project.
- (industry_fsm_sale) Display the 'New Quotation' button: If the user disables the feature in the settings of Field Services, that is 'Extra Quotations' (correponds to group_industry_fsm_quotations field) then the button 'new quotation' is always displayed for fsm project because the allow_quotations in the project is set to True. Since the group_industry_fsm_quotations field implies a group named 'industry_fsm_sale.group_fsm_quotation_from_task', we add this group in the groups attribute of the button and check the user has the group in the compute method of allow_quotation field to fix this problem.
- (industry_fsm_sale) sale_line_id visibility does not depend on sale_order_id in project.
task-2388500
Forward-Port-Of: odoo/enterprise#15025Courtesy of Transifex's translators for reporting bad/unclear sentences. Enterprise version of odoo/odoo#62539 Forward-Port-Of: odoo/enterprise#15032
Original PR description
Courtesy of Transifex's translators for reporting bad/unclear sentences. Enterprise version of odoo/odoo#62539 Forward-Port-Of: odoo/enterprise#15032