我将'report.external_layout_footer'qweb视图扩展为显示图像.
下面是我的文件reports/external_layout.xml中的代码:
<template id="report_footer_custom" inherit_id="report.external_layout_footer">
<xpath expr="//div[@class='footer']" position="replace">
<div class="footer">
<img t-att-src="'data:image/jpeg;base64,/var/www/cbl_openerp/openerp/cap_addons/cap_sale/img/footer.jpeg'"/>
<ul class="list-inline">
<li>Page:</li>
<li>
<span class="page"/>
</li>
<li>/</li>
<li>
<span class="topage"/>
</li>
</ul>
</div>
</xpath>
</template>
Run Code Online (Sandbox Code Playgroud)
这是我的openerp .py内容:
...
"depends": ["base","sale","report"],
...
"data": ['sale.xml',
'reports/reports.xml',
'reports/external_layout.xml',
'reports/informations_prestation.xml',
'views/product_template.xml',
'filter.xml'],
...
"images":['img/footer.jpeg',],
...
Run Code Online (Sandbox Code Playgroud)
但是当我打印销售订单时,我无法在页面底部查看我的图像.
有没有人有什么建议?
美好的一天!加载kanban视图时,我每个人都有错误。我继承了hr.employee Kanbanxml并仅在某些文档过期时添加条件,它将在kanban视图中添加“过期文档”通知,这是xml代码:
<record model="ir.ui.view" id="hr_kanban_view_employees_recruitment_kanban">
<field name="name">HR - Employees Kanban Document Status</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field name="employee_id"/>
<field name="documents_status"/>
</xpath>
<xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
<span t-if="record.documents_status.raw_value" style="font-size: 100%%"
t-att-class="record.documents_status.raw_value==true'oe_kanban_button oe_kanban_color_3'">
<field name="employee_id" readonly = "1"/>
Has Expired Documents
</span>
</xpath>
</field>
</record>
Run Code Online (Sandbox Code Playgroud)
和documents_status领域模型
并且在加载时
documents_status = fields.Boolean('DocumentStatus', readonly = True,store = False,compute ='getdocumentStatus')
@api.one
def getdocumentStatus(self):
raise Warning(self.employee_id)
server_date = datetime.datetime.strptime(DATE_NOW.strftime("%Y-%m-%d") ,"%Y-%m-%d")
result = {} …Run Code Online (Sandbox Code Playgroud) 我试图用逗号分隔打印一个one2many字段值,
<div class="col-xs-3">
<strong>Attendees:</strong>
<p t-esc="o.matp.empname"/>
</div>
Run Code Online (Sandbox Code Playgroud)
我如何实现这一点,还想打印以逗号分隔的值?
尝试扩展 qweb 模板时出现此错误。有没有人遇到过这样的事情。我无法找到与此相关的任何内容。
Uncaught Error: QWeb2: Error while extending template 'ClientDetailsNo expression given
http://localhost:8069/web/content/246-17d551a/web.assets_common.js:2444Traceback:
Error: QWeb2: Error while extending template 'ClientDetailsNo expression given
at Object.exception (http://localhost:8069/web/content/246-17d551a/web.assets_common.js:2444:7)
at Engine.extend (http://localhost:8069/web/content/246-17d551a/web.assets_common.js:2482:507)
at Engine._render (http://localhost:8069/web/content/246-17d551a/web.assets_common.js:2477:454)
at Engine.render (http://localhost:8069/web/content/246-17d551a/web.assets_common.js:2477:151)
at Class.display_client_details (http://localhost:8069/web/content/313-25bfa95/point_of_sale.assets.js:337:1375)
at Class.line_select (http://localhost:8069/web/content/313-25bfa95/point_of_sale.assets.js:332:528)
at HTMLTableRowElement.<anonymous> (http://localhost:8069/web/content/313-25bfa95/point_of_sale.assets.js:327:86)
at HTMLTableSectionElement.dispatch (http://localhost:8069/web/content/246-17d551a/web.assets_common.js:740:451)
at HTMLTableSectionElement.elemData.handle (http://localhost:8069/web/content/246-17d551a/web.assets_common.js:713:173)
Run Code Online (Sandbox Code Playgroud)
代码:
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="ClientDetails">
<t t-query="div.client-details-right" t-operation="append">
<div class="client-detail">
<span class="label">RNC</span>
<span class="detail client-phone">Test</span>
</div>
</t>
</t>
Run Code Online (Sandbox Code Playgroud)
如何在原报告中的最后一段后继承 qweb 添加新元素:
<p t-if="o.comment">
<strong>Comment:</strong>
<span t-field="o.comment"/>
</p>
//add after <p t-if="o.comment">
<xpath expr="??" position="after">
<p>new</p>
</xpath>
Run Code Online (Sandbox Code Playgroud) 我正在生成的所有默认报告和新报告都将打印在页面左侧.仅当报告以PDF格式生成时才会发生这种情况.在HTML格式中,报告显示正常.我做了一些研究,发现将wkhtmltox降级到版本0.21.1可以解决这个问题.我做到了,但问题仍然存在.
我想知道如何在报表qweb中打印很多很多字段,类似于销售模块的报价,发票中的内容。
或者,如果可以在报告中单独打印它们
cie10_app模型
from odoo import models, api, fields
class Cie10Db(models.Model):
_name = 'cie10.list'
_rec_name = 'detalleCie'
codCie = fields.Char('Codigo Cie10')
detalleCie = fields.Char('Detalle Diagnostico')
Run Code Online (Sandbox Code Playgroud)
cie10_informed
from odoo import models, fields
class DiagRec(models.Model):
_name = 'info.cie10'
ob_cie10 = fields.Many2one('cie10.list',string='Dx (CIE 10)')
ob_codCie10 = fields.Char(related='ob_cie10.codCie')
ob_observaciones = fields.Char('Observaciones')
Run Code Online (Sandbox Code Playgroud)
notify_app
from odoo import models, fields, api
class InfMed(models.Model):
dx1 = fields.Many2many('info.cie10')
Run Code Online (Sandbox Code Playgroud)
我需要在报告qweb中打印整个字段many2many
通报的报告
<span t-field="o.tratRec1"/>
Run Code Online (Sandbox Code Playgroud)
但我只有这个