Saturday, June 15, 2024
2 changes · master
Miscellaneous changes
Editing the `amount_currency` field of a product line in the "Journal Items" tab on an invoice is not really possible at the moment. On a technical level: The function `_compute_release_to_pay` assigns fields `release_to_pay` and `release_to_pay_manual`. Yet, it is only registered as compute function of `release_to_pay`. This behaviour is not correct; i.e. it causes a recomputation of the `amount_currency` field on the line mentioned above. In this commit a compute function for `rele
Original PR description
Editing the `amount_currency` field of a product line in the "Journal Items" tab on an invoice is not really possible at the moment. On a technical level: The function `_compute_release_to_pay`…
Editing the `amount_currency` field of a product line in the "Journal Items" tab on an invoice is not really possible at the moment. On a technical level: The function `_compute_release_to_pay` assigns fields `release_to_pay` and `release_to_pay_manual`. Yet, it is only registered as compute function of `release_to_pay`. This behaviour is not correct; i.e. it causes a recomputation of the `amount_currency` field on the line mentioned above. In this commit a compute function for `release_to_pay_manual` is introduced. It basically does the job that the old computation function did. To reproduce on runbot: 1. Create an invoice with a single line 2. Got to "Journal Items" 3. Edit the "Amount in currency" of the first line (product) 4. Save the invoice 5. The "Amount in currency" is reset to the original version. The same code also causes an issue in 17.0+; see https://github.com/odoo/odoo/pull/167014 Forward-Port-Of: odoo/enterprise#64695 Forward-Port-Of: odoo/enterprise#63336
__Current behavior before commit:__ When all slots from the first staff user/resource are taken, the `/appointment/<id>` page shows no availabilities even if the following users/resources still have slots. The user/resource selector is also not displayed. This means that it is not possible for a visitor to book an appointment as soon as the first one is fully booked. __Description of the fix:__ A new method `_get_slots_values` has been added to the `AppointmentController` class. This m
Original PR description
__Current behavior before commit:__ When all slots from the first staff user/resource are taken, the `/appointment/<id>` page shows no availabilities even if the following users/resources still have…
__Current behavior before commit:__ When all slots from the first staff user/resource are taken, the `/appointment/<id>` page shows no availabilities even if the following users/resources still have slots. The user/resource selector is also not displayed. This means that it is not possible for a visitor to book an appointment as soon as the first one is fully booked. __Description of the fix:__ A new method `_get_slots_values` has been added to the `AppointmentController` class. This method will compute the available slots for every possible user/resource until there is one that has slots available. And it starts by checking the default one. However if one is specifically selected by the visitor, it will be used even if there is no slots for it. This way the visitor can select it see that it has no availabilities but he can still switch user/resource with the selector. If there is no default nor selected user/resource then the slots are computed for all possible users/resources. A new test has been added to check if the shown staff user is the correct one and if the selector and calendar are visible even when the first one has no availabilities. __Example of steps to reproduce the issue:__ - Create a new `appointment.type` - Set the max scheduling days to 7 - Keep only one schedule time slot (e.g. Monday from 9:00 to 10:00) - Set **Availability on** to *Resources* - Put at least 2 courts in **Resources** - Click on `Share`, select **Assign to** *Any User/Resource* - Open the link - Book the slot of the first court - Come back the slot selector page -> No more slots available although the second court has still one opw-3862746 Forward-Port-Of: odoo/enterprise#62634