Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] lighting_reporting_vanguard_product: show RAL after the Finish #62

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading