summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-12 15:02:52 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-12 15:02:52 +0700
commitd2bc3e1d20f196628edaf6956777ca332b8d5063 (patch)
treee3859a938c3c3b27cf2eec20a80eff337b12194c /indoteknik_custom/models
parentb352a2c5f5899f7e8e46fbf728fb387efdda0fb7 (diff)
<Miqdad> create menu monitoring gudang service
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/__init__.py1
-rw-r--r--indoteknik_custom/models/gudang_service.py37
2 files changed, 38 insertions, 0 deletions
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py
index a14c766e..e6a59246 100755
--- a/indoteknik_custom/models/__init__.py
+++ b/indoteknik_custom/models/__init__.py
@@ -165,3 +165,4 @@ from . import partial_delivery
from . import domain_apo
from . import uom_uom
from . import commission_internal
+from . import gudang_service
diff --git a/indoteknik_custom/models/gudang_service.py b/indoteknik_custom/models/gudang_service.py
new file mode 100644
index 00000000..a84f5c8a
--- /dev/null
+++ b/indoteknik_custom/models/gudang_service.py
@@ -0,0 +1,37 @@
+from odoo import models, fields, api, _
+from odoo.exceptions import UserError, ValidationError
+import logging
+from datetime import datetime
+from collections import defaultdict
+
+
+class GudangService(models.Model):
+ _name = "gudang.service"
+ _description = "Gudang Service"
+ _inherit = ['mail.thread', 'mail.activity.mixin']
+
+ name = fields.Char('Name', readonly=True)
+ partner_id = fields.Many2one('res.partner', string='Customer', readonly=True)
+ origin = fields.Char(string='Origin SO')
+ picking_id = fields.Many2one('stock.picking', string = 'Picking ID')
+ # origin_so = fields.Many2one('sale.order', string='Origin SO', compute='_compute_origin_so')
+ date = fields.Datetime('Date', default=fields.Datetime.now, required=True)
+ gudang_service_lines = fields.One2many('gudang.service.line', 'gudang_service_id', string='Gudang Service Lines')
+
+ @api.model
+ def create(self, vals):
+ if not vals.get('name') or vals['name'] == 'New':
+ vals['name'] = self.env['ir.sequence'].next_by_code('gudang.service')
+ return super(GudangService, self).create(vals)
+
+
+class GudangServiceLine(models.Model):
+ _name = "gudang.service.line"
+ _description = "Gudang Service Line"
+ _inherit = ['mail.thread', 'mail.activity.mixin']
+
+ product_id = fields.Many2one('product.product', string='Product')
+ quantity = fields.Float(string='Quantity')
+ picking_id = fields.Many2one('stock.picking', string = 'Nomor Picking')
+ # origin_so = fields.Many2one('sale.order', string='Origin SO', compute='_compute_origin_so')
+ gudang_service_id = fields.Many2one('gudang.service', string='Gudang Service ID') \ No newline at end of file