mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
24 lines
713 B
Python
24 lines
713 B
Python
# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class StockLocationRoute(models.Model):
|
|
_inherit = "stock.location.route"
|
|
|
|
description = fields.Char(translate=True)
|
|
|
|
def name_get(self):
|
|
if self.env.context.get("show_description", False):
|
|
result = []
|
|
for rec in self:
|
|
name = ""
|
|
if rec.description:
|
|
name = rec.name + ": " + rec.description
|
|
else:
|
|
name = rec.name
|
|
result.append((rec.id, name))
|
|
return result
|
|
return super().name_get()
|