我在product.product模型上使用Odoo V10中的UI定义了一个新字段。该字段的定义如下:
Name = x_sellable_inventory
Type = float
Readonly = true
Dependencies = qty_available,outgoing_qty
计算方法是:
for record in self:
record['x_sellable_inventory'] = record.qty_available - record.outgoing_qty
我将此字段添加到视图中,并确认如果对现有库存进行了调整,则该字段将
我想使用res.partner从xl中使用他们的名字搜索他们的客户,如果是的话,我在xmlrpc创建的销售顺序im中指定他们的合作伙伴id,插入该合作伙伴并在销售顺序im creating.note中使用他的id,目的是将销售订单从xls文件迁移到odoo,目前实际的代码如下。
import psycopg2
import psycopg2.extras
import pyexcel_xls
import pyexcel as pe
from pyexcel_xls import get_data
from datetime import datetime
import xmlrpclib
i
我希望在直接选择销售订单时设置销售团队引用,以确认和选择正在创建的销售订单。
但我没有得到足够的提示,我怎么能做到这一点。因为在确认销售订单时调用的方法如下所示。
def action_button_confirm(self, cr, uid, ids, context=None):
if not context:
context = {}
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
self.signal_workf
我继承了res.partner并在其中添加了两个字段。
class Partner(models.Model):
_inherit = 'res.partner'
type = fields.Selection(selection_add=[(('mina', 'Mina'))])
origen = fields.Char(string="Origen")
destino = fields.Char(string="Destino")
我想在另一个模型上显示这些字段,就像这样:
c
在模型account_move中,我有一个名为"invoice_origin“的字段,它具有销售订单的ID,但我需要整个sale.order。这两种模型都没有关联。如何在sale.order文件中搜索并返回整个move_account?
我试过这样的方法,但不起作用
client_order_ref = fields.Char('get_sale_order().client_order_ref')
# Get a sale order with the invoice_origin field
def get_sale_order(self):
sale_o
实际上,我需要帮助从openerp获得销售订单,我正在获取记录,但问题是,当我登录openerp,进入销售订单,检查某一特定日期的记录时,它会在网站上向我显示22条记录。
同时,我们在脚本中输入的获得销售订单的逻辑仅为同一日期获得3条记录。
We have put logic as below:-
1. We are making connection and getting res.partner id's using below code
$ids = $models->execute_kw($db, $uid, $password,
'res.partner