-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] lighting_reporting_vanguard_product: show RAL after the Finish
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
30
lighting_reporting_vanguard_product/models/lighting_product.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters