custom_report
This commit is contained in:
parent
a22bb3522e
commit
cddda602f7
|
|
@ -0,0 +1,3 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
{
|
||||||
|
'name': "Custom Report Layout",
|
||||||
|
'version': '18.0.1.0.0', # تم تحديث النسخة لأودو 18
|
||||||
|
'summary': 'A module to configure report header and footer',
|
||||||
|
'sequence': -100,
|
||||||
|
'description': 'A module to configure report header and footer manually from company form',
|
||||||
|
'author': "Ismail Mohamedi",
|
||||||
|
'website': "https://www.linkedin.com/in/ismail-mohamedi-605537179",
|
||||||
|
'category': 'Odex25-base',
|
||||||
|
'license': 'LGPL-3',
|
||||||
|
'depends': ['base'], # تأكد وجود الحزم المطلوبة لأودو 18
|
||||||
|
'data': [
|
||||||
|
'report/base_document_layout.xml',
|
||||||
|
'views/views.xml',
|
||||||
|
],
|
||||||
|
'images': ['static/description/header_footer.png'],
|
||||||
|
'installable': True,
|
||||||
|
'application': True,
|
||||||
|
'auto_install': False,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
|
||||||
|
|
||||||
|
class ResCompany(models.Model):
|
||||||
|
""""""
|
||||||
|
_inherit = "res.company"
|
||||||
|
|
||||||
|
header = fields.Image("Header")
|
||||||
|
footer = fields.Image("Footer")
|
||||||
|
header_width = fields.Char("Header Width", default="1000")
|
||||||
|
header_height = fields.Char("Header height", default="150")
|
||||||
|
footer_width = fields.Char("Footer Width", default="1000")
|
||||||
|
footer_height = fields.Char("Footer height", default="100")
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<template id="einv_external_layout_standard" inherit_id="web.external_layout_standard">
|
||||||
|
<xpath expr="//div[contains(@t-attf-class, 'header')]" position="replace">
|
||||||
|
<div class="header" style="width: 100%;height: 100%;">
|
||||||
|
<img t-if="company.header" t-att-src="image_data_uri(company.header)"
|
||||||
|
t-att-width="company.header_width" t-att-height="company.header_height"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//div[contains(@t-attf-class,'footer')]" position="replace">
|
||||||
|
<div class="footer" style="width: 100%;height: 100%;">
|
||||||
|
<img t-if="company.footer" t-att-src="image_data_uri(company.footer)"
|
||||||
|
t-att-width="company.footer_width" t-att-height="company.footer_height"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</odoo>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="view_res_company_layout_inherit" model="ir.ui.view">
|
||||||
|
<field name="name">res.company.form.layout.inherit</field>
|
||||||
|
<field name="model">res.company</field>
|
||||||
|
<field name="inherit_id" ref="base.view_company_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//notebook" position="inside">
|
||||||
|
<page string="Header & Footer Layout">
|
||||||
|
<div class="o_row">
|
||||||
|
<field name="header" widget="image" class="float-left oe_avatar"
|
||||||
|
options="{'size': [300, 80]}" required="1"/>
|
||||||
|
<field name="header_width" required="1"/>
|
||||||
|
<span>,</span>
|
||||||
|
<field name="header_height" required="1"/>
|
||||||
|
</div>
|
||||||
|
<div class="o_row">
|
||||||
|
<field name="footer" widget="image" class="float-left oe_avatar"
|
||||||
|
options="{'size': [300, 80]}" required="1"/>
|
||||||
|
<field name="footer_width" required="1"/>
|
||||||
|
<span>,</span>
|
||||||
|
<field name="footer_height" required="1"/>
|
||||||
|
</div>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
Loading…
Reference in New Issue