Odoo 10 - 将记录添加到现有记录集

时间:2018-01-05 23:27:02

标签: openerp odoo-10

我有:

myset = self.env['sale.order'].search(......)

sale_order_foo_record = self.env['sale.order'].create(....)

如何将 sale_order_foo_record 添加到 myset

1 个答案:

答案 0 :(得分:3)

你可以这样做:

myset = self.env['sale.order'].search(...)
sale_order_foo_record = self.env['sale.order'].create(...)
myset |= sale_order_foo_record

或者:

myset = self.env['sale.order'].search(...)
myset |= self.env['sale.order'].create(...)

或者:

myset = self.env['sale.order'].search(...) + self.env['sale.order'].create(...)