Daily updates from Odoo
Thursday, March 4, 2021
1 change
Code cleanup and technical improvements
The field service product quantity control was redesigned so users can adjust quantities directly with integrated plus and minus buttons or manual entry. The update also improves usability by preventing flickering, resizing the quantity display for larger numbers, and adding tests to protect the behavior.
Original PR description
Purpose ====== In `industry_fsm_sale` module, the fsmProductQuantity widget is creating and manipulating dom elements which is not a best practice design. In addition, the '+' and '-' buttons are not part of it, these buttons are part of the kanban view. That's why a refactoring of this widget is made. ## Details - Review the template xml of this widget - Add the both buttons in this widget. - Use the method defined in the FieldInteger widget to keep the functional behaviour when the user manually edits the quantity. - Apply some changes to improve the usability of this widget. ### Additionnal points - When the user clicked on the quantity span, the display name of the product was flicker. This visual problem has been fixed. - When the user manually edits the product quantity, the span tag automatically resizes based on the number of digits. - Add unit tests in JS to validate the widget. task-2447258