[14.0][IMP] add layout for clean template

This commit is contained in:
Iryna Vyshnevska
2021-12-30 11:44:08 +02:00
parent 1468fb3237
commit 61998e991b
9 changed files with 180 additions and 96 deletions

View File

@@ -8,22 +8,16 @@ class BaseDocumentLayout(models.TransientModel):
_inherit = "base.document.layout"
full_header_img = fields.Binary(
related="company_id.full_header_img", readonly=False
related="company_id.full_header_img",
readonly=False,
help="Replaces whole header with image",
)
full_footer_img = fields.Binary(
related="company_id.full_footer_img", readonly=False
related="company_id.full_footer_img",
readonly=False,
help="Replaces whole footer, disables footer logo",
)
need_images_layout = fields.Boolean(
compute="_compute_need_images_layout", readonly=True
)
@api.depends("report_layout_id")
def _compute_need_images_layout(self):
self.ensure_one()
img_lay = self.env.ref("report_layout_config.external_layout_images").view_id
self.need_images_layout = self.external_report_layout_id == img_lay
@api.depends(
"full_footer_img",
"full_header_img",