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][FIX] add is_company_detail_empty boolean computed field on res.brand #195

Merged
merged 3 commits into from
Jan 1, 2025
Merged
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
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 @@ -68,13 +68,21 @@
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 82 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#L82

Added line #L82 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
Loading