summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorIndoteknik . <andrifebriyadiputra@gmail.com>2025-04-30 14:55:49 +0700
committerIndoteknik . <andrifebriyadiputra@gmail.com>2025-04-30 14:55:49 +0700
commit6f93b7a7a47481f6f308295a49bce40505041411 (patch)
tree14e275a2402d4713a0e2dc387a03fcaf467da883 /indoteknik_custom/models
parent7b5b79e03e08dff76981dd9734d20c52f90c0b36 (diff)
(andri) add field area (kecamatan & kota) pada stock picking
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/stock_picking.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 0b688fab..ccb551b0 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -157,6 +157,15 @@ class StockPicking(models.Model):
so_lama = fields.Boolean('SO LAMA', copy=False)
linked_manual_bu_out = fields.Many2one('stock.picking', string='BU Out', copy=False)
+ area_name = fields.Char(string="Area", compute="_compute_area_name", store=True)
+
+ @api.depends('real_shipping_id.district_id_pengiriman', 'real_shipping_id.city_id_pengiriman')
+ def _compute_area_name(self):
+ for record in self:
+ district = record.real_shipping_id.district_id_pengiriman.name if record.real_shipping_id.district_id_pengiriman else ''
+ city = record.real_shipping_id.city_id_pengiriman.name if record.real_shipping_id.city_id_pengiriman else ''
+ record.area_name = f"{district}, {city}".strip(', ')
+
# def write(self, vals):
# if 'linked_manual_bu_out' in vals:
# for record in self: