summaryrefslogtreecommitdiff
path: root/vit_kelurahan/model
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
commit1ca3b3df3421961caec3b747a364071c80f5c7da (patch)
tree6778a1f0f3f9b4c6e26d6d87ccde16e24da6c9d6 /vit_kelurahan/model
parentb57188be371d36d96caac4b8d65a40745c0e972c (diff)
initial commit
Diffstat (limited to 'vit_kelurahan/model')
-rw-r--r--vit_kelurahan/model/__init__.py1
-rw-r--r--vit_kelurahan/model/partner.py31
2 files changed, 32 insertions, 0 deletions
diff --git a/vit_kelurahan/model/__init__.py b/vit_kelurahan/model/__init__.py
new file mode 100644
index 0000000..3f4a5ff
--- /dev/null
+++ b/vit_kelurahan/model/__init__.py
@@ -0,0 +1 @@
+from . import partner \ No newline at end of file
diff --git a/vit_kelurahan/model/partner.py b/vit_kelurahan/model/partner.py
new file mode 100644
index 0000000..e7e1d67
--- /dev/null
+++ b/vit_kelurahan/model/partner.py
@@ -0,0 +1,31 @@
+from odoo import api, fields, models, _
+import time
+import logging
+_logger = logging.getLogger(__name__)
+
+class partner(models.Model):
+ _name = 'res.partner'
+ _inherit = 'res.partner'
+
+ # after zip
+ kelurahan_id = fields.Many2one(comodel_name="vit.kelurahan", string="Kelurahan", required=False, )
+ kecamatan_id = fields.Many2one(comodel_name="vit.kecamatan", string="Kecamatan", required=False, )
+ kota_id = fields.Many2one(comodel_name="vit.kota", string="Kota/Kab", required=False, )
+
+class kelurahan(models.Model):
+ _name = 'vit.kelurahan'
+ name = fields.Char('Kelurahan')
+ zip = fields.Integer(string="Kode POS", required=False, )
+ kecamatan_id = fields.Many2one(comodel_name="vit.kecamatan", string="Kecamatan", required=False, )
+
+class kecamatan(models.Model):
+ _name = 'vit.kecamatan'
+ name = fields.Char('Kecamatan', index=1)
+ kota_id = fields.Many2one(comodel_name="vit.kota", string="Kota", required=False, )
+
+class kota(models.Model):
+ _name = 'vit.kota'
+ name = fields.Char('Kota/Kab', index=1)
+ jenis = fields.Selection(string="Jenis", selection=[('kota', 'Kota'), ('kab', 'Kab.'), ], required=False, index=1)
+ state_id = fields.Many2one(comodel_name="res.country.state", string="State", required=False, )
+