Daily updates from Odoo
Navigate
Branch
Wednesday, November 23, 2022
19 changes
Enhancements to existing features
The payroll indexing wizard now prevents users from confirming indexing for contracts that are not running. This avoids a confusing error message and guides users away from an action that cannot be completed.
Original PR description
Up until now, even though it is not possible to index non-running contracts, it was possible to attempt this and 'confirm' this action, leading to a User Error. With this commit, the 'confirm' button is disabled, preventing the user from completing this invalid action. task-2974271
This update makes project and timesheet screens easier to use by improving button placement, default views, and reporting groupings. Users can more quickly understand remaining work in days, review billed timesheets by invoice and employee, and navigate sub-task planning views.
Original PR description
**= sale_timesheet_enterprise Purpose of this commit to improve generic usage of project app. So, in this commit done following changes: -display the 'assign to me' button on the right of the 'start' one when the task is already assigned for project.task form view -indicate 'x days remaining' if the timesheet encoding unit is in days task-2819458
Payslips now clearly mark attendance entries that cover only part of a day with “(half-day)”. This helps payroll users review worked days more accurately and quickly identify partial-day attendance records.
Original PR description
Show "(half-day)" next to attendances that were not done on a full day. task-2902011
Resolved issues and error corrections
Appointment pages now display profile and related images more smoothly by preventing a brief resizing flicker during load. This improves the visual experience for visitors booking or confirming appointments without changing the booking flow.
Original PR description
In appointment, images flicker because of the use of an HTML <img> tag. This is because the image is first loaded and displayed in the IMG tag, then styles are applied and the image is redimensionned. To avoid this, a solution is to use a div with a background image - because everything happens in CSS, the image will not be displayed until its style has first been calculated. The use of a background image is valid here because the pictures are not editable from those pages. Task-3002352
Code cleanup and technical improvements
The salary simulation link flow has been reorganized so the right contract information is set consistently in one place. This makes the process easier to maintain and helps reduce the chance of incorrect contract details being used when preparing compensation simulations.
Original PR description
The various information in generate.simulation.link is currently calculated and determined in multiple unrelated places. This commit streamlines the flow of this wizard to make the code more readable. task-3001402
Miscellaneous changes
Steps : Go to project > settings. Check 'timesheet' config and save. Uncheck it back and save. Issue : See errors in the logs, due to sql constraint. Cause : Record 'sale_timesheet.time_product' from data is deleted when sale_timesheet is uninstalled. Yet some project records still use it. As the constraint checks that timesheet_product_id is not null if allow_billable, we get an error. Fix : At uninstall, unset allow_billable on projects with this product to allow its deletion.
Original PR description
Steps : Go to project > settings. Check 'timesheet' config and save. Uncheck it back and save. Issue : See errors in the logs, due to sql constraint. Cause : Record 'sale_timesheet.time_product' from data is deleted when sale_timesheet is uninstalled. Yet some project records still use it. As the constraint checks that timesheet_product_id is not null if allow_billable, we get an error. Fix : At uninstall, unset allow_billable on projects with this product to allow its deletion. task-2998416 Forward-Port-Of: odoo/enterprise#34223 Forward-Port-Of: odoo/enterprise#32022
> **[FIX] stock_barcode_product_expiry: tour test** > Following the fix f6aa40763bfb5890026dadecc512952a6641a246 Showing the subline doesn't select by default the first subline, so the tour test `test_gs1_receipt_expiration_date` needed to be updated. > > Build error: 11835 > **[FIX] stock_barcode: test_delivery_reserved_1 fail** > In the test `test_delivery_reserved_1`, the trigger for close the picking's note was outdated (`.close` instead of `.btn-close`). > > Build error: 11832
Original PR description
> **[FIX] stock_barcode_product_expiry: tour test** > Following the fix f6aa40763bfb5890026dadecc512952a6641a246 Showing the subline doesn't select by default the first subline, so the tour test `test_gs1_receipt_expiration_date` needed to be updated. > > Build error: 11835 > **[FIX] stock_barcode: test_delivery_reserved_1 fail** > In the test `test_delivery_reserved_1`, the trigger for close the picking's note was outdated (`.close` instead of `.btn-close`). > > Build error: 11832 Forward-Port-Of: odoo/enterprise#34244
The Sunat has updated the catalog 54 Legal Reference: https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20221111.xlsx No. | 54 -- | -- Catálogo | Códigos de bienes y servicios sujetos a detracciones Código | Descripción 001 | Azúcar y melaza de caña 002 | Arroz 003 | Alcohol etílico 004 | Recursos hidrobiológicos 005 | Maíz amarillo duro 007 | Caña de azúcar 008 | Madera 009 | Arena y piedra. 010 | Residuos, subproductos, desechos, recortes y desp
Original PR description
The Sunat has updated the catalog 54 Legal Reference: https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20221111.xlsx No. | 54 -- | -- Catálogo | Códigos de bienes y…
The Sunat has updated the catalog 54 Legal Reference: https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20221111.xlsx No. | 54 -- | -- Catálogo | Códigos de bienes y servicios sujetos a detracciones Código | Descripción 001 | Azúcar y melaza de caña 002 | Arroz 003 | Alcohol etílico 004 | Recursos hidrobiológicos 005 | Maíz amarillo duro 007 | Caña de azúcar 008 | Madera 009 | Arena y piedra. 010 | Residuos, subproductos, desechos, recortes y desperdicios 011 | Bienes gravados con el IGV, o renuncia a la exoneración 012 | Intermediación laboral y tercerización 013 | Animales vivos 014 | Carnes y despojos comestibles 015 | Abonos, cueros y pieles de origen animal 016 | Aceite de pescado 017 | Harina, polvo y “pellets” de pescado, crustáceos, moluscos y demás invertebrados acuáticos 019 | Arrendamiento de bienes muebles 020 | Mantenimiento y reparación de bienes muebles 021 | Movimiento de carga 022 | Otros servicios empresariales 023 | Leche 024 | Comisión mercantil 025 | Fabricación de bienes por encargo 026 | Servicio de transporte de personas 027 | Servicio de transporte de carga 028 | Transporte de pasajeros 030 | Contratos de construcción 031 | Oro gravado con el IGV 032 | Paprika y otros frutos de los generos capsicum o pimienta 034 | Minerales metálicos no auríferos 035 | Bienes exonerados del IGV 036 | Oro y demás minerales metálicos exonerados del IGV 037 | Demás servicios gravados con el IGV 039 | Minerales no metálicos 040 | Bien inmueble gravado con IGV 041 | Plomo 099 | Ley 30737 The minimum amount to generate a detraction is eliminated Legal Reference: https://orientacion.sunat.gob.pe/como-funcionan-las-detracciones Latam Task: https://latam-localizations.odoo.com/web#id=937&cids=1&model=project.task&view_type=form Forward-Port-Of: odoo/enterprise#34220
At the moment, Digiflow's getStatusCdr endpoint returns this response: ```xml <statusCdr> <statusCode>100</statusCode> <statusMessage>El sistema no puede responder su solicitud. Intente nuevamente o comuniquese con su Administrador</statusMessage> </statusCdr> ``` We need to handle this case by raising an error, and not assume that `<statusCdr>` contains a `<content>` node. Latam-localizations ticket #932 Forward-Port-Of: odoo/enterprise#34266
Original PR description
At the moment, Digiflow's getStatusCdr endpoint returns this response:
```xml
<statusCdr>
<statusCode>100</statusCode>
<statusMessage>El sistema no puede responder su solicitud. Intente
nuevamente o comuniquese con su Administrador</statusMessage>
</statusCdr>
```
We need to handle this case by raising an error, and not assume that `<statusCdr>` contains a `<content>` node.
Latam-localizations ticket #932
Forward-Port-Of: odoo/enterprise#34266The onClose() param of doAction is bind in tablet.js to rerender everything after closing a modal. In some cases, a notification is displayed thanks to a message passed throught this bind method. The issue was that the notification message was given as the only plain string argument of the onClose method while it sometimes receives an object (from the Discrad button for instance). This commit ensure the bind method always receives an object. If the 'message' key is in, it display the value in
Original PR description
The onClose() param of doAction is bind in tablet.js to rerender everything after closing a modal. In some cases, a notification is displayed thanks to a message passed throught this bind method. The issue was that the notification message was given as the only plain string argument of the onClose method while it sometimes receives an object (from the Discrad button for instance). This commit ensure the bind method always receives an object. If the 'message' key is in, it display the value in a notification. Forward-Port-Of: odoo/enterprise#34207
This field is not necessary on non invoice related journal entries. A side effect of this, and the reason why it was detected was that setting `release_to_pay_manual` in `_compute_release_to_pay` triggers a `write` because the compute method is not supposed to modify that field. The `write` then triggered the computation of other fields, including the `name`. In the case of the PoS[1], entries could not be balanced while in a transient state (in memory) but flushing the record would raise an
Original PR description
This field is not necessary on non invoice related journal entries. A side effect of this, and the reason why it was detected was that setting `release_to_pay_manual` in `_compute_release_to_pay` triggers a `write` because the compute method is not supposed to modify that field. The `write` then triggered the computation of other fields, including the `name`. In the case of the PoS[1], entries could not be balanced while in a transient state (in memory) but flushing the record would raise an error. [1]: see test_correct_partner_on_invoice_receivables [1]: see https://runbot.odoo.com/runbot/build/21236209 Forward-Port-Of: odoo/enterprise#34236
Reproduction steps: - Install the timesheet_gird module - Open my timesheet gridview - Add line - Select the current weekend date(Ex: Saturday) Issue Issue: If there is a timesheet date in the range of the timesheet grid view, the notification will also appear. After the commit: If there is no date in the range of the timesheet grid view then the notification will appear. Week (9 Oct to 15 Oct): Case A-timesheet date 15 Oct: notificati
Original PR description
Reproduction steps:
- Install the timesheet_gird module
- Open my timesheet gridview
- Add line
- Select the current weekend date(Ex: Saturday)
Issue Issue:
If there is a timesheet date in the range of the timesheet grid view, the notification will also appear.
After the commit:
If there is no date in the range of the timesheet grid view then the notification will appear.
Week (9 Oct to 15 Oct):
Case A-timesheet date 15 Oct: notification does not appear
Case B-timesheet date 7 Oct: notification is appear
Why the issue occurs:
The isBetween() did not consider the start or end date. So we have passed an extra argument in isBetween().
- `[ ]` is inclusion value
task-3012469
Forward-Port-Of: odoo/enterprise#32801The access link field is now readonly and completely removed from HR employee form view. In hr_departure_wizard view, authorized users can now change the private email address of the employee before archiving. task-3002105 Forward-Port-Of: odoo/enterprise#32087
Original PR description
The access link field is now readonly and completely removed from HR employee form view. In hr_departure_wizard view, authorized users can now change the private email address of the employee before archiving. task-3002105 Forward-Port-Of: odoo/enterprise#32087
The test `test_student` does not work properly. The expected values are based on the hourly wage of the contract without any rounding. However, because `hourly_wage` is a monetary field, when writing any value in the database, a rounding based on the related currency is applied on that value (see `Monetary.convert_to_column`) Forward-Port-Of: odoo/enterprise#34227 Forward-Port-Of: odoo/enterprise#34091
Original PR description
The test `test_student` does not work properly. The expected values are based on the hourly wage of the contract without any rounding. However, because `hourly_wage` is a monetary field, when writing any value in the database, a rounding based on the related currency is applied on that value (see `Monetary.convert_to_column`) Forward-Port-Of: odoo/enterprise#34227 Forward-Port-Of: odoo/enterprise#34091
This commit add the missing `o_action_delegate_scroll` on the gantt view controller on small screen device to scroll the gantt view content only instead of the whole controller (i.e. control panel included). Steps to reproduce: 1. Open Project on small screen device like a smartphone 2. Open a Project like 'Office Design' 3. Switch to the Gantt view and try to scroll horizontally => The whole gantt controller currently scroll => bug Forward-Port-Of: odoo/enterprise#34195
Original PR description
This commit add the missing `o_action_delegate_scroll` on the gantt view controller on small screen device to scroll the gantt view content only instead of the whole controller (i.e. control panel included). Steps to reproduce: 1. Open Project on small screen device like a smartphone 2. Open a Project like 'Office Design' 3. Switch to the Gantt view and try to scroll horizontally => The whole gantt controller currently scroll => bug Forward-Port-Of: odoo/enterprise#34195
To reproduce ============ - on new db with appointment installed - create to appointments with different intro - go to path `/appointment` - you will have dropdown to select an appointment and the intro must change on selection Problem ======= the `div` containing the intro message has a class `o_calendar_intro` that was used to access it from js to change it's content, but this class was changed to `o_appointment_intro` on v16 Solution ======== change `o_calendar_intro` to `o_app
Original PR description
To reproduce ============ - on new db with appointment installed - create to appointments with different intro - go to path `/appointment` - you will have dropdown to select an appointment and the intro must change on selection Problem ======= the `div` containing the intro message has a class `o_calendar_intro` that was used to access it from js to change it's content, but this class was changed to `o_appointment_intro` on v16 Solution ======== change `o_calendar_intro` to `o_appointment_intro`. opw-3064420 Forward-Port-Of: odoo/enterprise#34187
Batch of fixes for Knowledge: * Undo a web_editor style for embedded views primary links so that the text appears white. * Make it so that calendar embedded views are smaller along with the viewport (instead of always 800px tall). * Previously the macro copy pasted content at the beginning of an html_field. It has been decided to add the content at the end instead, to follow a more natural flow of edition. * This fix will prevent any asset file from being shown in the media dialo
Original PR description
Batch of fixes for Knowledge: * Undo a web_editor style for embedded views primary links so that the text appears white. * Make it so that calendar embedded views are smaller along with the viewport…
Batch of fixes for Knowledge: * Undo a web_editor style for embedded views primary links so that the text appears white. * Make it so that calendar embedded views are smaller along with the viewport (instead of always 800px tall). * Previously the macro copy pasted content at the beginning of an html_field. It has been decided to add the content at the end instead, to follow a more natural flow of edition. * This fix will prevent any asset file from being shown in the media dialog of /file command in Knowledge. * When an embedded view calls the `switchView` method of the JS framework, the system will try to switch the view of the main view rather than the view shown in the embedded view. With that behavior, an error can be raised if the main view does not support the given view type. To fix the issue, we will overwrite the `switchView` method of the embedded views to execute a new action window to open the view we want rather than trying to "switch" the current view. This will ensure that the user be able to open the view even if the embedded view does not support the view type that needs to be loaded. * When an error occurs after the embedded view is loaded, the component will show the view and the error placeholder at the same time. This commit will ensure that the component will only show the error message when an error occurs. * Change class="oe-blackbox" to data-oe-protected="true" (same purpose), because the name was decided in a rush before 16.0 Task-3012552 Forward-Port-Of: odoo/enterprise#32627
When marking a WO as done, if the serial number defined is related to an unbuilt product, an error will be raised and the user will not be able to mark the WO as done To reproduce the issue: 1. Create a BoM for product P with one operation - P is tracked by SN 2. Produce one P with serial S 3. Unbuild it 4. Create and confirm a second MO with 1 x P 5. Start the WO 6. On tablet view, set the finished lot to S 7. Mark the WO as done Error: a UserError is raised because "This se
Original PR description
When marking a WO as done, if the serial number defined is related to an unbuilt product, an error will be raised and the user will not be able to mark the WO as done To reproduce the issue: 1.…
When marking a WO as done, if the serial number defined is related to an
unbuilt product, an error will be raised and the user will not be able
to mark the WO as done
To reproduce the issue:
1. Create a BoM for product P with one operation
- P is tracked by SN
2. Produce one P with serial S
3. Unbuild it
4. Create and confirm a second MO with 1 x P
5. Start the WO
6. On tablet view, set the finished lot to S
7. Mark the WO as done
Error: a UserError is raised because "This serial number [...] has
already been produced". However, this serial number has been unbuilt so
the worker should be able to use it again
When marking the WO as done, we check the uniqueness of the defined
serial number. But:
- The check is not accurate enough, hence the above error
- The lot of the WO is a computed/inverse field based on lot of the MO
- Once the WO closed, we can still change the lot of the MO
- When marking the MO as done, a better method checks the SN uniqueness
(does not fail in the above case)
Therefore, the checking on WO side is useless. We should let the MO side
handle this.
Moreover, let's say that there is already one P in stock with serial S2.
On tablet view, if the worker set the lot to S2, there should be a
warning so he can be aware of the situation. This is already the case on
MO side:
https://github.com/odoo/odoo/blob/45e37b2ad7bdcfd9f9f7e1dabbd0a99c9a0b5cdc/addons/mrp/models/mrp_production.py#L694-L705
OPW-3002424
Forward-Port-Of: odoo/enterprise#34108
Forward-Port-Of: odoo/enterprise#33377[FIX] hr_recruitment_extract: digitization when auto_send Before this commit, the `recruitment_extract_show_ocr_option_selection` value was not verified in the `function _message_set_main_attachment_id`. This is needed because `message_post` from the parent `mail.thread`, calls this function, and we do not want to send the attachment upon post to the OCR if the `recruitment_extract_show_ocr_option_selection` is not `auto_send`. --- [IMP] hr_recruitment_extract: add tests Addin
Original PR description
[FIX] hr_recruitment_extract: digitization when auto_send Before this commit, the `recruitment_extract_show_ocr_option_selection` value was not verified in the `function _message_set_main_attachment_id`. This is needed because `message_post` from the parent `mail.thread`, calls this function, and we do not want to send the attachment upon post to the OCR if the `recruitment_extract_show_ocr_option_selection` is not `auto_send`. --- [IMP] hr_recruitment_extract: add tests Adding tests to the hr_recruitment_extract module. task-2894506 Forward-Port-Of: odoo/enterprise#33253