【发布时间】:2014-08-05 16:20:05
【问题描述】:
我想以交互方式创建新的 Odoo/OpenERP 产品。我已经导入了插件:
python
>>> import openerp
>>> openerp.tools.config.parse_config(['--addons-path=addons'])
>>> from openerp.addons.product import product
>>> p = new product.product_product()
SyntaxError: invalid syntax
>>> p = product.product_product()
>>> type(p)
NoneType # no luck here either
# And then there is...
>>> product.product_product.create()
TypeError: unbound method create() must be called with product_product instance as first argument (got nothing instead)
# Ok I get that, but how do I create a product_product instance?
# And this one is not very clear either:
>>> product.product_product.create_instance()
TypeError: create_instance() takes exactly 3 arguments (1 given)
但不幸的是,create_instance 文档字符串不是很有帮助,ack-grep create_instance 在插件目录中没有给我任何结果。
我一直在寻找好的 osv(Odoo ORM)示例,但到目前为止运气不佳。
【问题讨论】: