diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-05-02 09:23:08 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-05-02 09:23:08 +0000 |
| commit | 58f5d865f661d60624ca23a10088338ffd0691f7 (patch) | |
| tree | 8cae3b26feb6f184a53af3ccd2d7aff361fffc31 | |
| parent | f050f06b6f057e20ecc99427850c9c43c7f02224 (diff) | |
| parent | 9bc2b6612c81844dbbee40a8678862a241dafb11 (diff) | |
Merged in area-list-picking (pull request #294)
Area list picking
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 7 | ||||
| -rw-r--r-- | indoteknik_custom/views/stock_picking.xml | 2 |
2 files changed, 5 insertions, 4 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: diff --git a/indoteknik_custom/views/stock_picking.xml b/indoteknik_custom/views/stock_picking.xml index 0a6f4752..b45debd0 100644 --- a/indoteknik_custom/views/stock_picking.xml +++ b/indoteknik_custom/views/stock_picking.xml @@ -26,7 +26,7 @@ <field name="countdown_ready_to_ship" /> --> </field> <field name="partner_id" position="after"> - <field name="area_name"/> + <field name="area_name" optional="hide"/> <field name="purchase_representative_id"/> <field name="status_printed"/> </field> |
