diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-07-23 16:39:30 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-07-23 16:39:30 +0700 |
| commit | 6a804c8d3604d7654fce48ce9e1aa1cb7c95ae87 (patch) | |
| tree | 8b5760e7e66ce62f8fb18cb85f019e9f4d4ab8cd | |
| parent | 4d0ba0dc130697e6dec1422efa7339b5e6445b53 (diff) | |
<hafid> Label Refund Type
| -rw-r--r-- | indoteknik_custom/models/refund_sale_order.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py index 5c9c4d83..559ca07a 100644 --- a/indoteknik_custom/models/refund_sale_order.py +++ b/indoteknik_custom/models/refund_sale_order.py @@ -58,6 +58,8 @@ class RefundSaleOrder(models.Model): ('lainnya', 'Lainnya') ], string='Refund Type', required=True) + refund_type_display = fields.Char(string="Refund Type Label", compute="_compute_refund_type_display") + line_ids = fields.One2many('refund.sale.order.line', 'refund_id', string='Refund Lines') invoice_line_ids = fields.One2many( comodel_name='account.move.line', @@ -104,6 +106,11 @@ class RefundSaleOrder(models.Model): is_locked = fields.Boolean(string="Locked", compute="_compute_is_locked") + @api.depends('refund_type') + def _compute_refund_type_display(self): + for rec in self: + rec.refund_type_display = dict(self.fields_get(allfields=['refund_type'])['refund_type']['selection']).get(rec.refund_type, '') + @api.model def create(self, vals): |
