Tuesday, November 19, 2024
3 changes · 17.0
Enhancements to existing features
This update enhances the Gantt chart's usability by introducing a dynamic range toggle and a quarter view option. This allows users to switch between static and dynamic views, providing greater flexibility for managing projects with varying task durations, particularly on longer-term initiatives.
Original PR description
This PR is meant to use the standard dynamic range option in gantt view and allow one to go from static to dynamic view by ticking only one button and selecting a date. This PR adds quarter scale in gantt view to add granularity between month and year view. Since year view is very static and based on month-step, the view is not really useful for tasks with heterogeneous durations on long-term projects. The quarter view, added to the dynamic toggle option gives a more smooth experience of the gantt view. Forward-port of https://github.com/odoo/enterprise/pull/50340
Resolved issues and error corrections
This update fixes an issue where email notifications were sent prematurely when creating sales orders, leading to inaccurate quotation documents. The change ensures the sales order is confirmed after the order line is created, preventing work on potentially cancelled quotations. This improves data accuracy and user experience.
Original PR description
Steps to reproduce: - Sales app > Configuration > Settings > Enable 'Quotation Templates' - Default template > Search more > New - Set 'Confirmation Mail' to 'Sales: Order Confirmation' - Project app > New > Enable 'Billable' in the project's settings - New Task > Set any Customer - Sales Order Item > Search More > New > Add product then save - Click 'Sales Order' button Coupled with https://github.com/odoo/odoo/pull/183586 You'll see in the chatter that the confirmation email is sent before the product is added to the sales order, resulting in a $0 quotation document being sent to the customer. This happens because we confirm the SO at the same time as we create it (After pressing the New button). Instead we would rather confirm the SO on save, after the order line creation. The SO confirmation is necessary because we don't want people to work on tasks/projects that are still in quotation since they could hypothetically still be cancelled. opw-4190402
This update resolves an error that occurred when editing barcode scanning records, specifically during rapid switching between the barcode view and the detailed record. The fix ensures the barcode component correctly updates database information, preventing a 'undefined record' error. This improves the reliability of the barcode scanning feature.
Original PR description
### Steps to reproduce: - Create a delivery order for 2 units of a product - Scan 1 unit and click on the pencil icon to edit the record further - On the digipad access the backend by clicking on the…
### Steps to reproduce: - Create a delivery order for 2 units of a product - Scan 1 unit and click on the pencil icon to edit the record further - On the digipad access the backend by clicking on the prodcut name. - Come back to the record the faster you can. #### > Error in Owl lifecycle: undefined record in get moveIds ### Cause of the issue: Since the barcode app relies on stock move line's data to generate its main component it is necessary to split moves in DB when you exit the barcode app in order to rerender the main component with appropriate data the next time you enter the barcode. Currently this split is done `onWillDestroy`: https://github.com/odoo/enterprise/blob/c97daa0127725411ba16ed8c94e6b31a0f4e1cc3/stock_barcode/static/src/components/main.js#L105-L107 https://github.com/odoo/enterprise/blob/c97daa0127725411ba16ed8c94e6b31a0f4e1cc3/stock_barcode/static/src/models/barcode_picking_model.js#L1327-L1329 However, if you come back to the barcode app fast enough you will start the creation of a new barcode main component before this rpc call has ended, in turn you will modify the content of the component before it has even mounted (even prior to the assignment of this.record) and owl will therefore destroy that component and recreate a new one with the appropriate content. But since this non-mounted component is destroyed it triggers the onWillDestroy and since it has no record yet it triggers an error by trying to access `this.moveIds`: https://github.com/odoo/enterprise/blob/c97daa0127725411ba16ed8c94e6b31a0f4e1cc3/stock_barcode/static/src/models/barcode_picking_model.js#L656-L658 ### Fix: Since we only want to trigger our `_onExit` method to update DB's data if the component has been mounted and since the `this.record` will always exist in that case, we should use the onWillUnmount hook rather than the onWillDestroy. Follow-up of c16acf3617442d3048f6a1246a2bc826af3c02fd (fixed in forward ports post 17.0). opw-4232106