我想存储prodct.product 表的standard_price字段以在 sql 查询中使用此字段值。
代码在这里:
# -*- coding: utf-8 -*-
from odoo import fields, models
from odoo.addons import decimal_precision as dp
class Product(models.Model):
_inherit = "product.product"
standard_price = fields.Float(
'Cost', company_dependent=True,
digits=dp.get_precision('Product Price'),
groups="base.group_user",store=True,
help = "Cost used for stock valuation in standard price and as a first price to set in average/fifo. "
"Also used as a base price for pricelists. "
"Expressed in the default unit of measure of the product.")
Run Code Online (Sandbox Code Playgroud) 如何限制/禁用表单视图,同时单击 Odoo 中 one2many 字段的树视图。
我正在开发一个 Android 应用程序,我想从 Odoo 服务器检索数据。
为此,我在 Odoo 中开发了一个自定义模块,并在其中创建了一个控制器。
import json
import xmlrpc.client as xmlrpclib
from odoo import http
from openerp.http import Response
class resUserController(http.Controller):
url = '<my url>'
db = '<name of my database>'
@http.route('/user/login', type='json', method='GET', auth='public')
def get_login(self, **kwargs):
username = kwargs.get('email')
password = kwargs.get('password')
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(self.url), allow_none=True)
uid = common.authenticate(self.db, username, password, {})
if uid:
Response.status = '200 Succesful operation'
json_result = {'token': uid}
return json.dumps(json_result)
Response.status = '400 Invalid credentials'
return
Run Code Online (Sandbox Code Playgroud)
当我从 python 脚本调用它来尝试它时,它工作正常,我得到一个 …
在V11企业中,对于某些型号有存档功能,但对于公司没有。如果我有多家公司,但我有一家停业的公司,我该如何禁用或存档该公司,使其不会出现在所有模块中,甚至管理员也无法将其分配给任何用户?好像一旦创建了公司,即使我还没有任何交易,我也无法删除它,因为我在数据库中收到引用完整性错误,并且存档功能对公司不可用。
我试图删除公司记录,但收到以下错误消息。
The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records
still reference it
- creation/update: a mandatory field is not correctly set
[object with reference: Account - account.account]
Run Code Online (Sandbox Code Playgroud) 我已经安装了Odoo版本10模块,但我没有在About部分下看到激活开发者模式.
当我在Odoo 10中使用它时,我有一个非常好用的模块.但是,在Odoo 11中,工作流程的一部分不起作用.
我是新用的Odoo 11,我无法找到有关工作流程的信息.Odoo 10和Odoo 11之间的工作流程有何不同?我认为我必须更改.xml文件.
提前致谢.
odoo11中的write和update方法之间有什么区别,因为当我使用write时,它仅在第一次工作时才起作用。
我阅读了官方教程,Odoo 的脚手架可以设置一个基本模块。要快速开始,只需调用:
$ ./odoo-bin scaffold Academy my-modules
Run Code Online (Sandbox Code Playgroud)
我试过了,没有用,因为它提醒Odoo-bin不是命令
我已经进入odoo安装目录
我只想显示没有标签的照片,而照片上却显示了单词Image和线条,我使用组标签使屏幕两侧显示,我只希望左侧的照片没有标签,这是默认出现在分组中。有蚂蚁的想法吗?

我正在自定义模块上,我需要向res.partner模型添加字段。我已经为此模型添加了一些字段,但是自1周以来,当我尝试添加一个新字段时,出现了此错误:
ERROR: column res_partner.my_field does not exist
Run Code Online (Sandbox Code Playgroud)
其他领域工作很好,但不是这个领域:
my_field = fields.Boolean(default=False)
Run Code Online (Sandbox Code Playgroud)
我真的不理解为什么会有这个问题。我尝试将“联系人”依赖项添加到我的模块中,它在我的本地版本上有效,但在我的在线版本上无效
如果某人有任何想法,那可能真的很好
谢谢你的帮助
编辑合作伙伴类
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
badge_ids = fields.One2many('mymodule.badge','client_i
sub_ids = fields.One2many('mymodule.subs','client_id')
#field that doesn't work
my_field = fields.Boolean(default=False)
Run Code Online (Sandbox Code Playgroud)
清单依赖
'depends': ['base', 'sale', 'website', 'calendar','contacts', 'point_of_sale', 'base_automation'],
Run Code Online (Sandbox Code Playgroud)