我想在以下代码中将当前日期分配给日期字段'start_date':
calendar_obj.create(cr,uid,
{'name' : rec_res.act_ion,
'user_id' : rec_res.asgnd_to.id,
'start_date' : lambda *a:datetime.today().strftime('%m-%d-%Y'),
'stop_date' : rec_res.due_date,
'allday' : True,
'partner_ids' : [(6,0, [rec_res.asgnd_to.partner_id.id])]
},
context=context)
Run Code Online (Sandbox Code Playgroud)
如何设置或将当前日期值分配给start_date字段?
如果任何人都知道什么是外部id,以及它的用途,我会感激他.
我没有在网上找到有关该资源的资源.
提前致谢.
我正在尝试使用PHP和xmlrpc更新有关我的odoo产品的信息。这是我用于更新产品名称的代码。
$models->execute_kw($db, $uid, $password, 'product.product', 'write',
array(array(5), array('name'=>"Newer product 3",'type'=>"consu")));
Run Code Online (Sandbox Code Playgroud)
现在,我想更改“现有数量”字段,所以我尝试以下代码:
$models->execute_kw($db, $uid, $password, 'product.product', 'write',
array(array(5), array('name'=>"Newer product 3",'type'=>"consu",'qty_available'=>'7')));
Run Code Online (Sandbox Code Playgroud)
但是它不起作用,任何人都知道如何解决它?谢谢。
我为产品创建了一些自定义字段.产品出现在销售,采购,仓库和制造模块中.我想让我的自定义字段只出现在制造模块中,并隐藏在其他任何地方.所以如何将条件放在隐形属性上.我试过像这个并且得到了错误 Unknown field _name in domain
attrs="{'invisible': [('_name', '!=', 'mrp.bom')]}"
Run Code Online (Sandbox Code Playgroud)
Python文件,
from openerp import fields,models, api
class product_template(models.Model):
_inherit = "product.template"
rim_weight = fields.Float(string='Rim Weight(KG)', readonly=True, compute='_compute_one_rim_weight')
width = fields.Float(string='Width(cm)',default='50')
length = fields.Float(string='Length(cm)',default='63')
gsm = fields.Float(string='Gram per square meter(gsm)',default='230')
Run Code Online (Sandbox Code Playgroud)
Xml文件,
<record id="product_template_form_view_dis_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.dis.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[@string='Accounting']" position='after'>
<page string='Cover Page Paper'>
<group>
<field name="width"/>
<field name="length"/>
<field name="gsm"/>
<field name="rim_weight"/>
</group>
</page>
</xpath>
</field>
</record>
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个QWeb报告.我有一个产品清单,我想在同一页上打印每个礼仪.这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Déclaration des rapports -->
<report
id="etiquette_produit"
model="product.template"
string="Etiquette Produit"
report_type="qweb-pdf"
file="Product_Etiquette_QWeb.produit_etiquette"
name="Product_Etiquette_QWeb.produit_etiquette"
/>
<template id="produit_etiquette">
<t t-call="report.external_layout">
<t t-foreach="docs" t-as="o">
<div class="page">
<table class="table table-striped">
<tr>
<td class="col-xs-1"><span t-field="o.default_code"/></td>
<td class="col-xs-5 text-center"><span t-field="o.name"/></td>
<td class="col-xs-1"><span t-field="o.default_code"/></td>
<td class="col-xs-5 text-center"><span t-field="o.name"/></td>
</tr>
<tr>
<td colspan="2" class="text-center">* M E 2 1 5 9 *</td>
<td colspan="2" class="text-center">* M E 2 0 1 7 *</td>
</tr>
</table>
</div>
</t>
</t>
</template>
</data>
</openerp>
Run Code Online (Sandbox Code Playgroud)
问题:当我选择要打印的所有产品时,我有一个错误(见下文).但是,当我只选择一种产品时,我可以打印报告.
Odoo Server …Run Code Online (Sandbox Code Playgroud) 我有一个向导来研究结果并将其添加到表中,并且创建了一个树状视图来读取该表中的项目。我希望我的向导在完成研究后打开该树视图,但是我找不到从python重定向到特定视图的方法。有人有主意吗?
我的模块称为sale_recherche_client_produit
我所有的文件都在我的项目文件夹的根目录下
我的主要python文件(sale_recherche_client_produit_wizard.py)
# -*- coding: utf-8 -*-
from openerp import models, fields, api, tools, exceptions
from openerp.exceptions import Warning
import math, json, urllib
class SaleRechercheClientProduitWizard(models.TransientModel):
_name = "sale.order.line.search"
products = fields.Many2one("product.template", string="Meubles", required=True)
lieu = fields.Char(string="Lieu", required=False)
distance = fields.Selection([
('10', "10km"),
('50', "50km"),
('100', "100km"),
('aucune', "Aucune limite"),
], default='50',string="Distance", required=True)
@api.one
def recherche(self):
lieu = self.lieu
distance = self.distance
products = self.products
clients = self.env["res.partner"].search([['is_company', '=', True], ['customer', '=', True]])
clients_proches = []
if (distance=="aucune"): …Run Code Online (Sandbox Code Playgroud) 在odoo v8中,我希望某些字段仅在视图模式下显示,但是当用户单击编辑或创建时,那些字段应该是不可见的(仅在视图模式下可见).
这两个在odoo安全文件中有什么区别。
<field name="users" eval="[(4, ref('base.user_root'))]"/>
<field name="implied_ids" eval="[(4, ref('base.group_hr_manager'))]"/>
Run Code Online (Sandbox Code Playgroud)
请任何人解释一下!
这三个术语在XML和python文件中占有很多位置,所以可以解释它的用法,这些关键字有什么影响?
我在Ubuntu Server中使用Odoo 10。我正在尝试使用wkhtmltopdf以pdf格式打印报价报告。但是设计看起来并不好。看来CSS无法运作
我试图更改其中的一些XML文件,mypath/addons但是它不起作用
这是我的报价pdf文件: