Tuesday, May 28, 2024
2 changes · master
Code cleanup and technical improvements
The accounting interface code for attachment previews was simplified without changing user-facing behavior. This makes the area easier to maintain and reduces the chance of future issues when developers update it.
Original PR description
`attachmentPreviewState.previewEnabled` was more complex than needed: it was a state solely made to make a getter reactive, due to lack of observing UI service state reactively with `useState()`. By putting `useState()` around the ui service in the component, this let us simplify the code of `previewEnabled` to simplify it being a getter.
Manufacturing and product documents are now managed through one shared document system instead of a separate manufacturing-specific model. This makes documents easier to access from engineering change orders and ensures teams can see all product-related files in one place.
Original PR description
In https://github.com/odoo/odoo/pull/132739, the introduction of product documents generalized the previous document approach used in MRP. This commit removes the existing mrp_document model and merge it's data and behaviour with the product document one. In addition, we now allow the eco record to have access to all the documents related to the product instead of only the one related to the eco record. task-id: 3649991 closes: https://github.com/odoo/enterprise/pull/55634 community: https://github.com/odoo/odoo/pull/152286 upgrade: https://github.com/odoo/upgrade/pull/5622