summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/stock_picking.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index c35c3047..a017a090 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -158,12 +158,13 @@ class StockPicking(models.Model):
linked_manual_bu_out = fields.Many2one('stock.picking', string='BU Out', copy=False)
area_name = fields.Char(string="Area", compute="_compute_area_name")
- # @api.depends('real_shipping_id.district_id_pengiriman', 'real_shipping_id.city_id_pengiriman')
+ @api.depends('real_shipping_id.kecamatan_id', 'real_shipping_id.kota_id')
def _compute_area_name(self):
for record in self:
- district = record.real_shipping_id.kelurahan_id.name if record.real_shipping_id.kelurahan_id else ''
- city = record.real_shipping_id.kota_id.name if record.real_shipping_id.kota_id else ''
+ district = record.real_shipping_id.kecamatan_id or ''
+ city = record.real_shipping_id.kota_id or ''
record.area_name = f"{district}, {city}".strip(', ')
+
# def write(self, vals):
# if 'linked_manual_bu_out' in vals: