diff --git a/deltatech_report_prn/static/src/js/action_manager.esm.js b/deltatech_report_prn/static/src/js/action_manager.esm.js index afa05d99d6..65aa1a8feb 100644 --- a/deltatech_report_prn/static/src/js/action_manager.esm.js +++ b/deltatech_report_prn/static/src/js/action_manager.esm.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -// import config from "web.config"; import {download} from "@web/core/network/download"; +import {isMobileOS} from "@web/core/browser/feature_detection"; import {registry} from "@web/core/registry"; async function prnReportHandler(action, options, env) { - if (config.device.isMobile) { + if (isMobileOS()) { return; } if (action.device_id) { diff --git a/deltatech_service_base/security/service_security.xml b/deltatech_service_base/security/service_security.xml index eed59a0f80..04ea1b0672 100644 --- a/deltatech_service_base/security/service_security.xml +++ b/deltatech_service_base/security/service_security.xml @@ -1,9 +1,12 @@ - + Service + + Warranty + Client @@ -21,7 +24,18 @@ - + + User + + + + + + Manager + + + + diff --git a/deltatech_service_maintenance/__manifest__.py b/deltatech_service_maintenance/__manifest__.py index 508897176a..1f805e2e2f 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": "17.0.1.1.2", + "version": "17.0.1.1.3", "author": "Terrabit, Dorin Hongu", "website": "https://www.terrabit.ro", "category": "Services/Maintenance", @@ -30,6 +30,8 @@ "views/report_notification.xml", "views/report_order.xml", "views/service_work_center_view.xml", + "views/service_warranty_view.xml", + "views/res_config_view.xml", "security/ir.model.access.csv", ], "images": ["static/description/main_screenshot.png"], diff --git a/deltatech_service_maintenance/data/data.xml b/deltatech_service_maintenance/data/data.xml index 1da0b95f29..f5bf516138 100644 --- a/deltatech_service_maintenance/data/data.xml +++ b/deltatech_service_maintenance/data/data.xml @@ -8,6 +8,14 @@ 1 1 + + Warranty + service.warranty + W/%(year)s/ + 5 + 1 + 1 + Service Order service.order diff --git a/deltatech_service_maintenance/models/__init__.py b/deltatech_service_maintenance/models/__init__.py index 78a898340a..32c1bc6dc6 100644 --- a/deltatech_service_maintenance/models/__init__.py +++ b/deltatech_service_maintenance/models/__init__.py @@ -12,3 +12,5 @@ from . import service_equipment from . import stock from . import service_work_center +from . import service_warranty +from . import res_config_settings diff --git a/deltatech_service_maintenance/models/res_config_settings.py b/deltatech_service_maintenance/models/res_config_settings.py new file mode 100644 index 0000000000..73460eefc9 --- /dev/null +++ b/deltatech_service_maintenance/models/res_config_settings.py @@ -0,0 +1,13 @@ +# © 2008-2021 Deltatech +# Dorin Hongu 1: + raise UserError(_("No lines or multiple lines in linked warranty found")) + else: + line.write({"price_unit": value / line.quantity if line.quantity else 0.0}) + return res + + +class StockLot(models.Model): + _inherit = "stock.lot" + + def action_lot_open_warranty(self): + self.ensure_one() + equipments = self.env["service.equipment"].search([("serial_id", "=", self.id)]) + if equipments: + warranties = self.env["service.warranty"].search([("equipment_id", "in", equipments.ids)]) + if warranties: + action = { + "res_model": "service.warranty", + "type": "ir.actions.act_window", + "name": _("Warranties for serial %s", self.name), + "domain": [("id", "in", warranties.ids)], + "view_mode": "tree,form", + } + return action + raise UserError(_("No warranties for this serial!")) diff --git a/deltatech_service_maintenance/security/ir.model.access.csv b/deltatech_service_maintenance/security/ir.model.access.csv index b29f4be2d2..5e3595c2c6 100644 --- a/deltatech_service_maintenance/security/ir.model.access.csv +++ b/deltatech_service_maintenance/security/ir.model.access.csv @@ -41,3 +41,6 @@ access_service_work_center_manager,access_service_work_center,model_service_work access_service_notification_operation_manager,access_service_notification_operation,model_service_notification_operation,deltatech_service_base.group_service_manager,1,1,1,1 + +access_service_warranty_manager,access_service_warranty_manager,model_service_warranty,deltatech_service_base.group_warranty_user,1,1,1,1 +access_service_warranty_item_manager,access_service_warranty_item,model_service_warranty_item,deltatech_service_base.group_warranty_user,1,1,1,1 diff --git a/deltatech_service_maintenance/views/res_config_view.xml b/deltatech_service_maintenance/views/res_config_view.xml new file mode 100644 index 0000000000..2c4a800d21 --- /dev/null +++ b/deltatech_service_maintenance/views/res_config_view.xml @@ -0,0 +1,36 @@ + + + + res.config.settings.view.form + res.config.settings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deltatech_service_maintenance/views/service_warranty_view.xml b/deltatech_service_maintenance/views/service_warranty_view.xml new file mode 100644 index 0000000000..01a7a33182 --- /dev/null +++ b/deltatech_service_maintenance/views/service_warranty_view.xml @@ -0,0 +1,295 @@ + + + + + service.warranty.tree + service.warranty + + + + + + + + + + + + + + + + + + + service.warranty.form + service.warranty + +
+
+ +
+ +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + +
+
+
+
+ + Quantity: + + + +
+
+ +
+
+
+
+ + +
+ +
+
+
+
+ + + +
+
+
+
+ + + + + service.warranty.search + service.warranty + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Warranty + service.warranty + tree,form,activity + [('type', '=', 'warranty')] + {'default_type': 'warranty'} + + + + + + + Reconditions + service.warranty + tree,form,activity + [('type', '=', 'recondition')] + {'default_type': 'recondition'} + + + +