diff --git a/README.md b/README.md index ea1da884ff..917930d6e0 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ addon | version | maintainers | summary | price [deltatech_service_consumable](deltatech_service_consumable/) | 14.0.1.1.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Consumable | Free [deltatech_service_equipment](deltatech_service_equipment/) | 14.0.1.2.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Equipment Management | Free [deltatech_service_equipment_base](deltatech_service_equipment_base/) | 14.0.1.1.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Service Equipment Management | Free -[deltatech_service_maintenance](deltatech_service_maintenance/) | 14.0.1.1.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free +[deltatech_service_maintenance](deltatech_service_maintenance/) | 14.0.1.1.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free [deltatech_service_maintenance_agreement](deltatech_service_maintenance_agreement/) | 14.0.1.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance | Free [deltatech_service_maintenance_plan](deltatech_service_maintenance_plan/) | 14.0.1.0.6 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Services Maintenance Plan | Free [deltatech_sms](deltatech_sms/) | 14.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Send SMS to custom endpoint | Free diff --git a/deltatech_service_maintenance/README.rst b/deltatech_service_maintenance/README.rst index beaa048605..bd7a71f993 100644 --- a/deltatech_service_maintenance/README.rst +++ b/deltatech_service_maintenance/README.rst @@ -7,7 +7,7 @@ Deltatech Services Maintenance !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:a9779586e3d4dc40d441ae70e7bc88ede142466019d9a047f67e70c0fdd6f8ed + !! source digest: sha256:f0381c9f50a805a1f567df81f38596a76b431067e0b80a306c916284187889e2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/deltatech_service_maintenance/__manifest__.py b/deltatech_service_maintenance/__manifest__.py index d83fd7fbc8..bd4cf2e5af 100644 --- a/deltatech_service_maintenance/__manifest__.py +++ b/deltatech_service_maintenance/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Deltatech Services Maintenance", "summary": "Services Maintenance", - "version": "14.0.1.1.3", + "version": "14.0.1.1.4", "author": "Terrabit, Dorin Hongu", "website": "https://www.terrabit.ro", "category": "Services/Maintenance", diff --git a/deltatech_service_maintenance/models/service_warranty.py b/deltatech_service_maintenance/models/service_warranty.py index 3bf5010cf1..9baefbfb76 100644 --- a/deltatech_service_maintenance/models/service_warranty.py +++ b/deltatech_service_maintenance/models/service_warranty.py @@ -89,13 +89,17 @@ def onchange_equipment_id(self): if self.equipment_id: self.user_id = self.equipment_id.technician_user_id or self.user_id if self.equipment_id.serial_id: - move_lines = self.env["stock.move.line"].search( - [ - ("lot_id", "=", self.equipment_id.serial_id.id), - ("state", "=", "done"), - ("product_id", "=", self.equipment_id.product_id.id), - ], - order="date DESC", + move_lines = ( + self.env["stock.move.line"] + .sudo() + .search( + [ + ("lot_id", "=", self.equipment_id.serial_id.id), + ("state", "=", "done"), + ("product_id", "=", self.equipment_id.product_id.id), + ], + order="date DESC", + ) ) if move_lines: last_move = False @@ -107,13 +111,13 @@ def onchange_equipment_id(self): if move.location_dest_id.usage == "customer": last_move = move break - if last_move and last_move.move_id.sale_line_id: - self.sale_order_id = last_move.move_id.sale_line_id.order_id - invoice_lines = last_move.move_id.sale_line_id.invoice_lines - invoices = invoice_lines.move_id - if len(invoices) == 1: - if invoices.state == "posted" and invoices.move_type == "out_invoice": - self.invoice_id = invoices + if last_move and last_move.sudo().move_id.sale_line_id: + self.sudo().sale_order_id = last_move.move_id.sudo().sale_line_id.order_id + invoice_lines = last_move.move_id.sudo().sale_line_id.invoice_lines + invoices = invoice_lines.sudo().move_id + if len(invoices.sudo()) == 1: + if invoices.sudo().state == "posted" and invoices.sudo().move_type == "out_invoice": + self.invoice_id = invoices.sudo() self.partner_id = invoices.partner_id else: self.invoice_id = False diff --git a/deltatech_service_maintenance/static/description/index.html b/deltatech_service_maintenance/static/description/index.html index e450cb62a2..e4982dfb70 100644 --- a/deltatech_service_maintenance/static/description/index.html +++ b/deltatech_service_maintenance/static/description/index.html @@ -368,7 +368,7 @@

Deltatech Services Maintenance

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:a9779586e3d4dc40d441ae70e7bc88ede142466019d9a047f67e70c0fdd6f8ed +!! source digest: sha256:f0381c9f50a805a1f567df81f38596a76b431067e0b80a306c916284187889e2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: AGPL-3 dhongu/deltatech