Skip to content

Commit

Permalink
[IMP] lighting_reporting_vanguard_product: show RAL after the Finish
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankC013 committed Sep 18, 2024
1 parent 215c280 commit 3fd47f9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions lighting_reporting_vanguard_product/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import res_config_settings
from . import lighting_product_source_line
from . import lighting_product
30 changes: 30 additions & 0 deletions lighting_reporting_vanguard_product/models/lighting_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright NuoBiT Solutions - Frank Cespedes <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import models


class LightingProduct(models.Model):
_inherit = "lighting.product"

def get_finish_display(self):
self.ensure_one()
res, res_l = None, []

# add finish description
finish_l = []
if self.finish_id:
finish_l.append(self.finish_id.display_name)
if self.finish2_id:
finish_l.append(self.finish2_id.display_name)
if finish_l:
res_l.append("/".join(finish_l))

# add RAL description
if self.ral_id:
res_l.append("(%s)" % self.ral_id.display_name)

if res_l:
res = " ".join(res_l)

return res
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@
Finish
</td>
<td>
<span
t-out="' / '.join(filter(None, [doc.finish_id.display_name, doc.finish2_id.display_name]))"
/>
<span t-out="doc.get_finish_display()" />
</td>
</tr>
<tr t-if="doc.location_ids">
Expand Down

0 comments on commit 3fd47f9

Please sign in to comment.