我在odoo中有一个自定义的Web表单.我需要上传文件.我的controllers.py:
@http.route(['/test/'], type='http', auth="user", methods=['GET', 'POST'], website=True)
def upload_files(self, **post):
    values = {}
    form_vals = {}
              ...........
    if post.get('attachment',False):
        Attachments = request.registry['ir.attachment']
        name = post.get('attachment').filename      
        file = post.get('attachment')
        attachment_id = Attachments.create(request.cr, request.uid, {
            'name':name,
            'res_name': name,
            'type': 'binary',
            'res_model': 'project.issue',
            'res_id': form_id,
            'datas': base64.encode(file.read()),
        }, request.context)
            ............
上面的代码创建附件,名称为res_model等,但附加文件已损坏且无法打开.
XML文件:
    ..........
<form t-attf-action="/test/done" method="post" enctype="multipart/form-data" class="form-horizontal mt32"><div t-attf-class="form-group">
    ..........
    <div t-attf-class="form-group">
        <label class="col-md-3 col-sm-4 control-label" for="attachment">Attachments</label>
        <div class="col-md-7 col-sm-8">
            <input name="attachment" type="file" class="file" multiple="true" data-show-upload="true" data-show-caption="true" lass="file" data-show-preview="true"/>
        </div>
    </div>>
    .......... …我使用本指南从头开始创建了一份新报告:http://odoo.guide/report-design-workshop/
我的问题:如果我的报告中有很多产品,则不显示包括总金额等在内的最后一部分.我想有一种分页符或至少第二个pdf页面.
注意:如果我使用基本的odoo报告,我在pdf中有第二页,但显示如下:http: //fs5.directupload.net/images/150924/bf9lsx6u.jpg
欢迎任何其他想法!
编辑:在使用分页标记的基本报告中工作真的很好,但它根本没有影响我自己的报告设计.
我的代码尝试使用分页符标记:
account.Name_report
<?xml version="1.0"?>
<t t-name="account.Name_report">
<t t-call="report.Name_layout">
<t t-foreach="docs" t-as="o"> <!-- this makes the context model data accessible throughout the variable "o" -->
<div class="page"> 
<div style="color:white">.</div><!--as reference for fixed positions-->
<img src="/document/static/img/Briefpapier_rechnung.svg" style="position: fixed; left:-20px;top:0px;z-index:-100"/>
<div style="color: white;
    font-size: 20px;
    z-index: 1;
    position: fixed;
    left: 390px;
    top: 36px;
    font-size: 38px;">Rechnung
</div>
<!--Adresse-->
<div style="color: black;
    font-size: -1px;
    z-index: 1;
    position: fixed;
    top: 138px;
    left: 60px;
    font-size: 12px;"> …如何将css文件添加到自定义模块以更改xml视图?我发现这篇文章,但解决方案无效.
我想修改模块中的所有元素,例如表单,列表,输入等.
我在5432和5433端口预装了postgres,postgres-9.3和pgadmin.
卸载它们然后尝试使用http://openies.com/blog/install-openerp-odoo-9-on-ubuntu-server-14-04-lts/安装odoo 9
本教程.
但是当我试着执行命令时
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
然后它给出以下错误:
createuser:无法连接到数据库postgres:无法连接到服务器:没有这样的文件或目录服务器是否在本地运行并接受Unix域套接字"/var/run/postgresql/.s.PGSQL.5432"上的连接?
sudo netstat -nltp | grep 5432 没有显示任何结果.
的pg_hba.conf
# Database administrative login by Unix domain socket
local   all             postgres                                peer
# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, …工人的目的是什么?这些工作人员是多线程还是其他什么?当Odoo实例启动时,我在命令行上看到至少6名工人通知:
2016-03-10 13:55:09,602 15504 INFO ? openerp.service.server: Worker WorkerHTTP (15504) alive
2016-03-10 13:55:09,606 15503 INFO ? openerp.service.server: Worker WorkerHTTP (15503) alive
2016-03-10 13:55:09,625 15507 INFO ? openerp.service.server: Worker WorkerCron (15507) alive
2016-03-10 13:55:09,628 15506 INFO ? openerp.service.server: Worker WorkerCron (15506) alive
2016-03-10 13:55:09,629 15508 INFO ? openerp.service.server: Worker WorkerCron (15508) alive
2016-03-10 13:55:09,629 15509 INFO ? openerp.service.server: Worker WorkerCron (15509) alive
和之间有什么区别WorkerHTTP和WorkerCron?老实说,我不知道他们做了什么.
在 Odoo 中,默认端口设置为 8069,我想将其更改为另一个端口。
我已经尝试在 openerp-server.conf 中更改 xmlprc 的值,但即使在重新启动服务器后,新端口也不起作用
我正在尝试创建一种形式,这将简化我尚未注册的产品的添加到我的小商店的命名法.为此,我创建了以下形式的模块:
<t t-extend="ConfirmPopupWidget">
    <t t-jquery="p.body" t-operation="replace">
        <div class="product-container">
            <div id="search_row" style="padding-bottom: 12px;padding-top: 11px;border-bottom: 1px solid gray;">
                <label>Barcode </label>
                <input style="height: 18px;" type="text" id="is_ean13" class="search" placeholder="EAN13 Barcode"/>
            </div>
            <div class="form-group">
                <label for="is_name" class="col-sm-2 control-label">Product Name </label>
                <div class="col-sm-10">
                    <input type="text" id="is_name" class="form-control" placeholder="Product name" style="height: 32px;background-color:#D2D2FF"/>
                </div>
            </div>
            <div class="form-group">
                <label for="is_sale_price" class="col-sm-2 control-label">Sale price</label>
                <div class="col-sm-10">
                    <input type="text" id="is_sale_price" class="form-control" placeholder="Sale Price"/>
                </div>
            </div>
            <div class="form-group">
                <label for="is_internal_reference" class="col-sm-2 control-label">Internal Reference</label>
                <div class="col-sm-10">
                    <input type="text" id="is_internal_reference" class="form-control" placeholder="Internal Reference"/>
                </div> …在 Odoo/openerp 文档中,它说“客户端操作”完全在客户端实现,就是这样。他们没有为 Odoo v10 提供任何有关它的示例详细文档。
有谁知道如何实施客户行动及其全部潜力吗?(我们可以通过客户行动来实现的可能性。)
from PyPDF2 import PdfFileMerger, PdfFileReader
filepath_list = ['/tmp/abc.pdf','/tmp/xyz.pdf']
merger = PdfFileMerger()
for file_name in filepath_list:
 with open(file_name, 'rb') as f:
    merger.append(f)
merger.write("result.pdf")
在通过 python 代码合并 2 pdf 时,我收到了错误意外目的地 '/__WKANCHOR_2' 并且我使用以下代码,请提供解决方案
我在联系表单中选择了预先存在的密钥。我使用“selection_add”参数添加了新键,我想找出与 select_add 参数相反的参数,以从选择中删除任何旧键。
odoo ×10
odoo-8 ×3
python ×3
odoo-9 ×2
odoo-view ×2
openerp ×2
xml ×2
css ×1
file-storage ×1
file-upload ×1
javascript ×1
odoo-10 ×1
page-break ×1
pdf ×1
postgresql ×1
python-2.7 ×1
python-3.x ×1
qweb ×1
report ×1
ubuntu ×1
web ×1
worker ×1