From 01507fad2a05124137541dc187a06631732c606e Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 11 Dec 2024 15:14:31 +0700 Subject: master vendor sla --- indoteknik_custom/__manifest__.py | 1 + indoteknik_custom/models/__init__.py | 1 + indoteknik_custom/models/vendor_sla.py | 26 ++++++++++++++++ indoteknik_custom/security/ir.model.access.csv | 1 + indoteknik_custom/views/vendor_sla.xml | 42 ++++++++++++++++++++++++++ indoteknik_custom/views/x_banner_category.xml | 2 +- 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 indoteknik_custom/models/vendor_sla.py create mode 100644 indoteknik_custom/views/vendor_sla.xml diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index 89f62524..5f77d2de 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -155,6 +155,7 @@ 'report/report_invoice.xml', 'report/report_picking.xml', 'report/report_sale_order.xml', + 'views/vendor_sla.xml', ], 'demo': [], 'css': [], diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index ad6d75dd..70a84bd0 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -134,3 +134,4 @@ from . import find_page from . import approval_retur_picking from . import va_multi_approve from . import va_multi_reject +from . import vendor_sla diff --git a/indoteknik_custom/models/vendor_sla.py b/indoteknik_custom/models/vendor_sla.py new file mode 100644 index 00000000..1e0a344f --- /dev/null +++ b/indoteknik_custom/models/vendor_sla.py @@ -0,0 +1,26 @@ +from odoo import models, fields, api + +class VendorSLA(models.Model): + _name = 'vendor.sla' + _description = 'Vendor SLA' + _rec_name = 'id_vendor' + + id_vendor = fields.Many2one('res.partner', string='Name') + duration = fields.Integer(string='Duration', description='Duration SLA') + unit = fields.Selection( + [('jam', 'Jam'),('hari', 'Hari')], + string="Unit" + ) + duration_unit = fields.Char(string="Duration (Unit)", compute="_compute_duration_unit") + + + @api.depends('duration', 'unit') + def _compute_duration_unit(self): + for record in self: + if record.duration and record.unit: + record.duration_unit = f"{record.duration} {record.unit}" + else: + record.duration_unit = "" + + + \ No newline at end of file diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index 2375df9d..dcfee14b 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -148,3 +148,4 @@ access_sales_order_fulfillment_v2,access.sales.order.fulfillment.v2,model_sales_ access_v_move_outstanding,access.v.move.outstanding,model_v_move_outstanding,,1,1,1,1 access_va_multi_approve,access.va.multi.approve,model_va_multi_approve,,1,1,1,1 access_va_multi_reject,access.va.multi.reject,model_va_multi_reject,,1,1,1,1 +access_vendor_sla,access.vendor_sla,model_vendor_sla,,1,1,1,1 diff --git a/indoteknik_custom/views/vendor_sla.xml b/indoteknik_custom/views/vendor_sla.xml new file mode 100644 index 00000000..d0e7f3e6 --- /dev/null +++ b/indoteknik_custom/views/vendor_sla.xml @@ -0,0 +1,42 @@ + + + + Vendor SLA + vendor.sla + tree,form + + + + Vendor SLA + vendor.sla + + + + + + + + + + Vendor SLA + vendor.sla + +
+ + + + + + + +
+
+
+ + +
\ No newline at end of file diff --git a/indoteknik_custom/views/x_banner_category.xml b/indoteknik_custom/views/x_banner_category.xml index 11feb207..a83c4129 100755 --- a/indoteknik_custom/views/x_banner_category.xml +++ b/indoteknik_custom/views/x_banner_category.xml @@ -23,7 +23,7 @@ - + -- cgit v1.2.3