Skip to content

Commit

Permalink
[ADD] is_company_detail_empty Boolean on res.brand
Browse files Browse the repository at this point in the history
The field works like on res.company model

[FIX] add missing import

[IMP] formatting
  • Loading branch information
RemiFr82 authored and antonioburic committed Oct 1, 2024
1 parent 9242064 commit c9eda59
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions brand_external_report_layout/models/res_brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,21 @@ def _get_default_brand_logo(self):
string="Brand Details",
help="Header text displayed at the top of all reports.",
)
is_company_details_empty = fields.Boolean(compute="_compute_empty_company_details")
layout_background = fields.Selection(
[("Blank", "Blank"), ("Geometric", "Geometric"), ("Custom", "Custom")],
default="Blank",
required=True,
)
layout_background_image = fields.Binary("Background Image")

@api.depends("company_details")
def _compute_empty_company_details(self):
for record in self:
record.is_company_details_empty = not tools.html2plaintext(

Check warning on line 81 in brand_external_report_layout/models/res_brand.py

View check run for this annotation

Codecov / codecov/patch

brand_external_report_layout/models/res_brand.py#L81

Added line #L81 was not covered by tests
record.company_details or ""
)

def change_report_template(self):
self.ensure_one()
context = {"default_brand_id": self.id}
Expand Down

0 comments on commit c9eda59

Please sign in to comment.